15 #include "physxD6JointDesc.h"
16 #include "physxManager.h"
17 #include "physxJointDriveDesc.h"
18 #include "physxJointLimitSoftDesc.h"
25 void PhysxD6JointDesc::
26 set_x_motion(PhysxD6JointMotion xMotion) {
28 _desc.xMotion = (NxD6JointMotion)xMotion;
36 void PhysxD6JointDesc::
37 set_y_motion(PhysxD6JointMotion yMotion) {
39 _desc.yMotion = (NxD6JointMotion)yMotion;
47 void PhysxD6JointDesc::
48 set_z_motion(PhysxD6JointMotion zMotion) {
50 _desc.zMotion = (NxD6JointMotion)zMotion;
58 void PhysxD6JointDesc::
59 set_swing1_motion(PhysxD6JointMotion swing1Motion) {
61 _desc.swing1Motion = (NxD6JointMotion)swing1Motion;
69 void PhysxD6JointDesc::
70 set_swing2_motion(PhysxD6JointMotion swing2Motion) {
72 _desc.swing2Motion = (NxD6JointMotion)swing2Motion;
80 void PhysxD6JointDesc::
81 set_twist_motion(PhysxD6JointMotion twistMotion) {
83 _desc.twistMotion = (NxD6JointMotion)twistMotion;
91 void PhysxD6JointDesc::
94 _desc.xDrive = drive._desc;
102 void PhysxD6JointDesc::
105 _desc.yDrive = drive._desc;
113 void PhysxD6JointDesc::
116 _desc.zDrive = drive._desc;
124 void PhysxD6JointDesc::
127 _desc.swingDrive = drive._desc;
135 void PhysxD6JointDesc::
138 _desc.twistDrive = drive._desc;
146 void PhysxD6JointDesc::
149 _desc.slerpDrive = drive._desc;
164 _desc.flags &= ~(flag);
173 void PhysxD6JointDesc::
176 _desc.linearLimit = limit._desc;
184 void PhysxD6JointDesc::
187 _desc.swing1Limit = limit._desc;
195 void PhysxD6JointDesc::
198 _desc.swing2Limit = limit._desc;
206 void PhysxD6JointDesc::
209 _desc.twistLimit.low = limit._desc;
217 void PhysxD6JointDesc::
220 _desc.twistLimit.high = limit._desc;
228 void PhysxD6JointDesc::
229 set_projection_distance(
float distance) {
231 _desc.projectionDistance = distance;
239 void PhysxD6JointDesc::
240 set_projection_angle(
float angle) {
242 _desc.projectionAngle = angle;
250 void PhysxD6JointDesc::
251 set_gear_ratio(
float ratio) {
253 _desc.gearRatio = ratio;
261 void PhysxD6JointDesc::
262 set_drive_position(
const LPoint3f &pos) {
273 void PhysxD6JointDesc::
274 set_drive_linear_velocity(
const LVector3f &v) {
285 void PhysxD6JointDesc::
286 set_drive_angular_velocity(
const LVector3f &v) {
297 void PhysxD6JointDesc::
312 _desc.projectionMode = (NxJointProjectionMode)mode;
320 PhysxEnums::PhysxD6JointMotion PhysxD6JointDesc::
321 get_x_motion()
const {
323 return (PhysxD6JointMotion)_desc.xMotion;
331 PhysxEnums::PhysxD6JointMotion PhysxD6JointDesc::
332 get_y_motion()
const {
334 return (PhysxD6JointMotion)_desc.yMotion;
342 PhysxEnums::PhysxD6JointMotion PhysxD6JointDesc::
343 get_z_motion()
const {
345 return (PhysxD6JointMotion)_desc.zMotion;
353 PhysxEnums::PhysxD6JointMotion PhysxD6JointDesc::
354 get_swing1_motion()
const {
356 return (PhysxD6JointMotion)_desc.swing1Motion;
364 PhysxEnums::PhysxD6JointMotion PhysxD6JointDesc::
365 get_swing2_motion()
const {
367 return (PhysxD6JointMotion)_desc.swing2Motion;
375 PhysxEnums::PhysxD6JointMotion PhysxD6JointDesc::
376 get_twist_motion()
const {
378 return (PhysxD6JointMotion)_desc.twistMotion;
387 get_x_drive()
const {
390 value._desc = _desc.xDrive;
400 get_y_drive()
const {
403 value._desc = _desc.yDrive;
413 get_z_drive()
const {
416 value._desc = _desc.zDrive;
426 get_swing_drive()
const {
429 value._desc = _desc.swingDrive;
439 get_twist_drive()
const {
442 value._desc = _desc.twistDrive;
452 get_slerp_drive()
const {
455 value._desc = _desc.slerpDrive;
464 bool PhysxD6JointDesc::
465 get_flag(PhysxD6JointFlag flag)
const {
467 return (_desc.flags & flag) ?
true :
false;
476 get_linear_limit()
const {
479 value._desc = _desc.linearLimit;
489 get_swing1_limit()
const {
492 value._desc = _desc.swing1Limit;
502 get_swing2_limit()
const {
505 value._desc = _desc.swing2Limit;
515 get_twist_limit_low()
const {
518 value._desc = _desc.twistLimit.low;
528 get_twist_limit_high()
const {
531 value._desc = _desc.twistLimit.high;
540 float PhysxD6JointDesc::
541 get_projection_distance()
const {
543 return _desc.projectionDistance;
551 float PhysxD6JointDesc::
552 get_projection_angle()
const {
554 return _desc.projectionAngle;
562 float PhysxD6JointDesc::
563 get_gear_ratio()
const {
565 return _desc.gearRatio;
574 get_drive_position()
const {
585 get_drive_linear_velocity()
const {
596 get_drive_angular_velocity()
const {
607 get_drive_orientation()
const {
617 PhysxEnums::PhysxProjectionMode PhysxD6JointDesc::
618 get_projection_mode()
const {
620 return (PhysxProjectionMode)_desc.projectionMode;
void set_flag(PhysxD6JointFlag flag, bool value)
Sets or clears a single D6JointFlag flag.
void set_projection_mode(PhysxProjectionMode mode)
Use this to enable joint projection.
static NxQuat quat_to_nxQuat(const LQuaternionf &q)
Converts from LQuaternionf to NxQuat.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
Used to describe drive properties for a PhysxD6Joint.
static NxVec3 vec3_to_nxVec3(const LVector3f &v)
Converts from LVector3f to NxVec3.
static LQuaternionf nxQuat_to_quat(const NxQuat &q)
Converts from NxQuat to LQuaternionf.
static LVector3f nxVec3_to_vec3(const NxVec3 &v)
Converts from NxVec3 to LVector3f.
This is the base quaternion class.
static LPoint3f nxVec3_to_point3(const NxVec3 &p)
Converts from NxVec3 to LPoint3f.