|
pXcon_edit6djoint ( ENTITY* entity, var JointMotion[6] ); |
With this function you can change the Joint Motion of an D6Joint. D6Joints can be created with pXcon_add6djoint.
|
Parameters: |
|
entity |
registered Entity pointer (D6JOINT Actor) |
|
JointMotion[6] |
JointMotion[0-2]
defines the linear degrees of freedom JointMotion[3-5]
Define the angular degrees of freedom |
|
Returns: |
1 if successful, 0 otherwise.
|
Remarks: |
For every axis you can set three Motions:
NX_D6JOINT_MOTION_LOCKED locks the specified axis.
NX_D6JOINT_MOTION_LIMITED limits the specified axis.
NX_D6JOINT_MOTION_FREE frees the specified axis.
|
Speed: |
Slow
VECTOR*
globalAxis = vector(0,0,-1); //
using the z axis
var
limits[5];
limits[0] = 1.0; //
linearLimit
limits[1]
= NxPiF32 / 180.0 * 30.0; //
swing1Limit
limits[2]
= NxPiF32 / 180.0 * 70.0; //
swing2Limit
limits[3]
= NxPiF32 / 180.0 * -90.0; //
TwistLowLimit
limits[4]
= NxPiF32 / 180.0 * 45.0; //
TwistHighLimit
// upper joint
pXcon_add6djoint(NULL,
box4, box4.x, globalAxis, limits); //
when you use NULL you attach the entity (box4) to the world
//
lower joint
pXcon_add6djoint(box4,
box5, box5.x, globalAxis, limits);
var Motion[6];
Motion[0]
= NX_D6JOINT_MOTION_FREE; //
This frees box4 from the world (NULL)
Motion[1]
= NX_D6JOINT_MOTION_FREE;
Motion[2] =
NX_D6JOINT_MOTION_FREE;
Motion[3] = NX_D6JOINT_MOTION_LIMITED;
//this limits
the angles
Motion[4]
= NX_D6JOINT_MOTION_LIMITED;
Motion[5] =
NX_D6JOINT_MOTION_LIMITED;
pXcon_edit6djoint(box4,Motion);
Motion[0]
= NX_D6JOINT_MOTION_LOCKED; //this
locks box5 on box4
Motion[1]
= NX_D6JOINT_MOTION_LOCKED;
Motion[2] =
NX_D6JOINT_MOTION_LOCKED;
pXcon_edit6djoint(box5,Motion);