PxD6JointCreate_Revolute
Defined in include/extensions/PxD6JointCreate.h
-
PxJoint *PxD6JointCreate_Revolute(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 revolute joint, using either a PxD6Joint or PxRevoluteJoint.
This function enforces that the joint frames have the same orientation, which is a local frame whose X is the desired rotation axis. This orientation is computed by the function, so users only have to define the desired rotation axis (typically 1;0;0 or 0;1;0 or 0;0;1).
The rotation 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 rotation of actor0’s joint frame.
The function creates hard limits, and uses PhysX’s default contact distance parameter.
Limits are expressed in radians. Allowed range is ]-2*PI;+2*PI[
See also
PxD6Joint PxRevoluteJoint
- 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 around which objects are allowed to move, expressed in the actors’ local space
minLimit – [in] The minimum allowed rotation along the axis
maxLimit – [in] The maximum allowed rotation along the axis
useD6 – [in] True to use a PxD6Joint, false to use a PxRevoluteJoint;
- Returns
The created joint.