00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 INLINE PhysxController::
00023 PhysxController() : PhysxObject() {
00024
00025 _speed = NxVec3(0.0f, 0.0f, 0.0f);
00026 _omega = 0.0f;
00027 _heading = 0.0f;
00028
00029 _jumping = false;
00030 _jump_time = 0.0f;
00031 _jump_v0 = 0.0f;
00032
00033 _sharpness = 1.0f;
00034 _min_dist = 0.0001f;
00035
00036 _up_vector = NxVec3(0.0f, 1.0f, 0.0f);
00037 _up_axis = (NxHeightFieldAxis)physx_up_axis.get_value();
00038
00039 switch (_up_axis) {
00040 case NX_Z:
00041 _up_quat = NxQuat(90.0f, NxVec3(1.0f, 0.0f, 0.0f));
00042 break;
00043 case NX_Y:
00044 _up_quat = NxQuat(0.0f, NxVec3(1.0f, 0.0f, 0.0f));
00045 break;
00046 default:
00047 physx_cat.error() << "only y-up and z-up are permitted" << endl;
00048 }
00049
00050 _up_quat_inv = _up_quat;
00051 _up_quat_inv.invert();
00052 }
00053
00054
00055
00056
00057
00058
00059 INLINE void PhysxController::
00060 ls() const {
00061
00062 ls(nout);
00063 }
00064
00065
00066
00067
00068
00069
00070 INLINE void PhysxController::
00071 ls(ostream &out, int indent_level) const {
00072
00073 indent(out, indent_level) << get_type().get_name()
00074 << " (at 0x" << this << ")";
00075
00076 out << " A:0x" << get_actor();
00077 out << "\n";
00078 }
00079