pXcon_set6djoint ( ENTITY* entity, var JointMotion[6], var JointDrive[6]): void*

Changes the behavior of a 6-degrees-of-freedom joint. Joints can be created with pXcon_add.

Parameters:

entity Registered joint entity (PH_6DJOINT).
JointMotion[6]

JointMotion[0-2] defines the 3 linear degrees of freedom relative to the joint axis.
JointMotion[3-5] defines the 3 angular degrees of freedom: pan, tilt, and roll about the joint axis.

Use 0 for not using this axis, or one of these flags as values:
NX_D6JOINT_MOTION_LOCKED locks the specified axis (default).
NX_D6JOINT_MOTION_LIMITED
limits the specified axis to the limits given in pXcon_setparams2.
NX_D6JOINT_MOTION_FREE
frees the specified axis.

JointDrive[6] JointDrive[0-2] defines the modes of the 3 linear motors. A8.12
JointDrive[3] defines the mode of the swing motor.
JointDrive[4] defines the mode of the slerp motor.
JointDrive[5] defines the mode of the twist motor.


Use 0 for not using a motor on a certain axis, or one of these flags:
NX_D6JOINT_DRIVE_POSITION for a motor that moves towards a given position.
NX_D6JOINT_DRIVE_VELOCITY
for a motor that moves with a given velocity.

Returns:

NxD6Joint* pointer for further joint manipulation if successful, 0 otherwise.

Speed:

Medium

Remarks:

Example:

function main()
{
// set up a simple level  
  shadow_stencil = 1;
  d3d_antialias = 1;
  physX_open();
  level_load(""); // load an empty level
  pXent_settype(NULL,PH_STATIC,PH_PLANE); // create a static plane at groundlevel zero
  ENTITY* ground = ent_createterrain(NULL,NULL,32,32,1000);
  bmap_fill(bmap_for_entity(ground,0),COLOR_RED,100);  
  vec_set(camera.x,vector(-150,0,50));
  
// set up a chain of 6D joints 
  ENTITY* previous = NULL;
  int i;
  for(i=0; i<3; i++) 
  {
    you = ent_create(CUBE_MDL,vector(0,0,17+i*34),NULL);
    you.scale_z = 2;
set(you,SHADOW|CAST);
pXent_settype(you,PH_RIGID,PH_BOX);
// define a joint with a twist motor pXcon_add(PH_6DJOINT,you,previous,0); var Motion[6] = { 0,0,0,0,0,NX_D6JOINT_MOTION_FREE }; var Drive[6] = { 0,0,0,0,0,NX_D6JOINT_DRIVE_VELOCITY }; pXcon_set6djoint(you,Motion,Drive); // rotate joint against the previous joint pXcon_setmotor(you,vector(20,0,0),0); previous = you; } }

See also:

Constraints, pXcon_add, pXcon_setparams1, pXcon_setparams2, pXcon_setmotor