PxD6JointCreate_Prismatic

Defined in include/extensions/PxD6JointCreate.h

PxJoint *PxD6JointCreate_Prismatic(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float minLimit, float maxLimit, bool useD6)

Helper function to create a prismatic joint, using either a PxD6Joint or PxPrismaticJoint.

This function enforces that the joint frames have the same orientation, which is a local frame whose X is the desired translation axis. This orientation is computed by the function, so users only have to define the desired translation axis (typically 1;0;0 or 0;1;0 or 0;0;1).

The translation can be limited. Limits are enforced if minLimit<maxLimit. If minLimit=maxLimit the axis is locked. If minLimit>maxLimit the limits are not enforced and the axis is free. The limit values are computed relative to the position of actor0’s joint frame.

The function creates hard limits, and uses PhysX’s default contact distance parameter.

Parameters
  • physics[in] The physics SDK

  • actor0[in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame

  • localPos0[in] The position of the joint relative to actor0

  • actor1[in] An actor to which the joint is attached. NULL may be used to attach the joint to a specific point in the world frame

  • localPos1[in] The position of the joint relative to actor1

  • axis[in] The axis along which objects are allowed to move, expressed in the actors’ local space

  • minLimit[in] The minimum allowed position along the axis

  • maxLimit[in] The maximum allowed position along the axis

  • useD6[in] True to use a PxD6Joint, false to use a PxPrismaticJoint;

Returns

The created joint.