void pJointD6::setDrivePosition(VxVector pos) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return ; joint->saveToDesc(descr); joint->setDrivePosition(pMath::getFrom(pos)); descr.drivePosition = (pMath::getFrom(pos)); joint->loadFromDesc(descr); }
int pJointD6::setZDrive(pJD6Drive drive) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return -1 ; joint->saveToDesc(descr); NxJointDriveDesc sdrive; sdrive.damping = drive.damping; sdrive.spring = drive.spring; sdrive.forceLimit = drive.forceLimit; sdrive.driveType=drive.driveType; descr.zDrive = sdrive; joint->loadFromDesc(descr); return 1; }
void pJointD6::setDriveLinearVelocity(VxVector linVel) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return ; joint->saveToDesc(descr); //joint->setDriveLinearVelocity(pMath::getFrom(linVel)); descr.driveLinearVelocity = (pMath::getFrom(linVel)); joint->loadFromDesc(descr); }
int pJointD6::setSlerpDrive(pJD6Drive drive) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return -1 ; joint->saveToDesc(descr); NxJointDriveDesc sdrive; sdrive.damping = drive.damping; sdrive.spring = drive.spring; sdrive.forceLimit = drive.forceLimit; sdrive.driveType=drive.driveType; descr.slerpDrive = sdrive; descr.flags |=NX_D6JOINT_SLERP_DRIVE; joint->loadFromDesc(descr); return 1; }
void pJointD6::enableCollision( bool value ) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return ; joint->saveToDesc(descr); if (value) { descr.jointFlags|=NX_JF_COLLISION_ENABLED; }else { descr.jointFlags&=~NX_JF_COLLISION_ENABLED; } joint->loadFromDesc(descr); }
void pJointD6::setRatio(float ratio) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return ; joint->saveToDesc(descr); if (ratio!=0.0f) { descr.jointFlags|=NX_D6JOINT_GEAR_ENABLED; descr.gearRatio = ratio; }else { descr.jointFlags&=~NX_D6JOINT_GEAR_ENABLED; } joint->loadFromDesc(descr); }
int pJointD6::setLinearLimit(pJD6SoftLimit limit) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return -1 ; joint->saveToDesc(descr); NxJointLimitSoftDesc sLimit; sLimit.value = limit.value; sLimit.spring = limit.spring; sLimit.damping = limit.damping; sLimit.restitution = limit.restitution; if (!sLimit.isValid())return -1; descr.linearLimit = sLimit; joint->loadFromDesc(descr); return 1; }
void pJointD6::setProjectionAngle(float angle) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return ; joint->saveToDesc(descr); descr.projectionAngle= angle; joint->loadFromDesc(descr); }
void pJointD6::setProjectionMode(ProjectionMode mode) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return ; joint->saveToDesc(descr); descr.projectionMode = (NxJointProjectionMode)mode; joint->loadFromDesc(descr); }
void pJointD6::setZMotionMode(D6MotionMode mode) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint());if (!joint)return;joint->saveToDesc(descr); descr.zMotion = (NxD6JointMotion)mode; joint->loadFromDesc(descr); }
void pJointD6::setDriveRotation(VxQuaternion rot) { NxD6JointDesc descr; NxD6Joint *joint = static_cast<NxD6Joint*>(getJoint()); if (!joint)return ; joint->saveToDesc(descr); joint->setDriveOrientation(pMath::getFrom(rot)); joint->loadFromDesc(descr); }