New update! Big new shape- and 6D-joint features!

shapes
  • NxShape datatype was introduced, old hull types were renamed (e.g. PH_BOX -> NX_SHAPE_BOX) to be in canon with PhysX
  • PH_MODIFIED was renamed to NX_SHAPE_RAW_MESH
  • new: pXentAddShape can be used to add a sphere, box, capsule, wheel or convex-shape (!!!) from the same entity, another entity, at the local position/orientation of the source/other entity; or a given global position and/or orientation
  • new: pXentAddBoxShapeByEnt, pXentAddCapsuleShapeByEnt, pXentAddConvexShapeByEnt, pXentAddSphereShapeByEnt, pXentAddWheelShapeByEnt can be used to add like with pXentAddShape a shape, but directly for the given shape type
  • new: pXentNumShapes returns the number of shapes an entity has
  • new: pXentGetShapeId returns the index of a given shape in the shape list of an entity
  • new: pXentShapeIsType returns true/false if a given shape is of a given type
  • new: pXentGetShape... returns a shape by its id, first or last
  • new: pXentGetTypedShape... returns the a shape of a given type, by its index, first, or last
  • new: pXentRemoveShape removes and deletes a given shape of an entity
  • new: pXentRemoveShapeById does the same as pXentRemoveShape, but with an index rather than with a passed shape


joints
  • for joint types, the NxJointType datatype was introduced
  • NxJointProjectionMode datatype and values were introduced for future functions using that
  • NxD6JointMotion, NxD6JointFlag and NxD6JointDriveType datatypes were introduced
  • all (!) characterizing 6D-joint parameters are now settable (except drive orientation), see below
  • pXconAddDistanceJoint creates a new distant joint, with a full parameter list


new 6D functions:
Click to reveal..
Code:
// defines the linear and angular degree of freedom, default: NX_D6JOINT_MOTION_FREE
NxJoint* pXconSetD6JointLinearMotion (NxJoint*, NxD6JointMotion x, NxD6JointMotion y, NxD6JointMotion z);
NxJoint* pXconSetD6JointAngularMotion (NxJoint*, NxD6JointMotion swing1, NxD6JointMotion swing2, NxD6JointMotion twist);

// Sets the characteristics of linear limit (if some linear DOF is limited)
NxJoint* pXconSetD6JointLinearLimit (NxJoint*, float quants, float restitution, float spring, float damping);

// Sets the characteristics of the angular limit of swing1/2 (if swing1/2Motion is NX_D6JOINT_MOTION_LIMITED)
NxJoint* pXconSetD6JointSwing1Limit (NxJoint*, float degree, float restitution, float spring, float damping);
NxJoint* pXconSetD6JointSwing2Limit (NxJoint*, float degree, float restitution, float spring, float damping);

// Sets the characteristics of the lower and upper limit of the twist (if twistMotion is NX_D6JOINT_MOTION_LIMITED)
NxJoint* pXconSetD6JointTwistLowLimit (NxJoint*, float low, float restitution, float spring, float damping);
NxJoint* pXconSetD6JointTwistHighLimit (NxJoint*, float high, float restitution, float spring, float damping);

// Sets the drive properties of the three linear DOF's 
NxJoint* pXconSetD6JointXDrive (NxJoint*, NxD6JointDriveType type, float spring, float damping, float forceLimit);
NxJoint* pXconSetD6JointYDrive (NxJoint*, NxD6JointDriveType type, float spring, float damping, float forceLimit);
NxJoint* pXconSetD6JointZDrive (NxJoint*, NxD6JointDriveType type, float spring, float damping, float forceLimit);

// Sets the drive types of the three linear DOF's
NxJoint* pXconSetD6JointLinearDriveType (NxJoint* joint, NxD6JointDriveType x, NxD6JointDriveType y, NxD6JointDriveType z);

// Sets the swing/twist drive, which is used, if flag NX_D6JOINT_SLERP_DRIVE is not set
NxJoint* pXconSetD6JointSwingDrive (NxJoint*, NxD6JointDriveType type, float spring, float damping, float forceLimit);
NxJoint* pXconSetD6JointTwistDrive (NxJoint*, NxD6JointDriveType type, float spring, float damping, float forceLimit);

// Sets the slerp drive, if the flag NX_D6JOINT_SLERP_DRIVE is set
NxJoint* pXconSetD6JointSlerpDrive (NxJoint*, NxD6JointDriveType type, float spring, float damping, float forceLimit);

// Sets the swing, twist and slerp drive type
NxJoint* pXconSetD6JointAngularDriveType (NxJoint* joint, NxD6JointDriveType swing, NxD6JointDriveType twist, NxD6JointDriveType slerp);

// If the x,y, and/or z linear drive type is NX_D6JOINT_DRIVE_POSITION, pos defines the
// goal position, in local entity coordinates
NxJoint* pXconSetD6JointDrivePosition (NxJoint*, VECTOR* pos);

//NxJoint* pXconSetD6JointDriveOrientation (NxJoint*, ...); // TODO

// If the x,y, and/or z linear drive type is NX_D6JOINT_DRIVE_VELOCITY, vel/ang defines
// the goal linear velocity / angular velocity
NxJoint* pXconSetD6JointDriveLinearVelocity (NxJoint*, VECTOR* vel);
NxJoint* pXconSetD6JointDriveAngularVelocity (NxJoint*, VECTOR* vel);

// If mode is NX_JPM_NONE, projection is disabled. If NX_JPM_POINT_MINDIST, bodies are
// projected to limits leaving an linear error of the projection distance and an angular
// error of the projection angle.
NxJoint* pXconSetD6JointProjection (NxJoint*, NxJointProjectionMode mode, float dist, float angle);

// When the flag NX_D6JOINT_GEAR_ENABLED is set, the angular velocity of the second actor
// is driven towards the angular velocity of the first actor times gearRatio (both w.r.t.
// their primary axis) 
NxJoint* pXconSetD6JointGearRatio (NxJoint*, float ratio);

// Sets flags, which control the general behavior of D6 joints
NxJoint* pXconSetD6JointFlags (NxJoint*, NxD6JointFlag flags);



internal
  • new "pXent" and "pXcon" filter added to VS project
  • pXentShape.cpp/.h will be the new future home of all shape-related functions
  • pXconD6.cpp/.h will be the new future home of all D6 joint related functions
  • NxMat33ForAngle returns the rotation matrix for an ANGLE*
  • NxForEntScale returns the scale of an entity as NxVec3
  • NxForEntPos returns the transformed position of a given entity
  • NxMat33ForEntAngle returns the rotation matrix of a given entity
  • InvNxMat33ForEntAngle like NxMat33ForEntAngle, but the inverse


Remarks:
The new 6D-joints features were kindly sponsored by Superku. Thank you!

Download the new dll for A8 (and the header) here: ackphysx.20111115.dll.h.rar

Checkout on SVN as always.

Cheers,
-Christian