PxD6JointCreate_Spherical

Defined in include/extensions/PxD6JointCreate.h

PxJoint *PxD6JointCreate_Spherical(PxPhysics &physics, PxRigidActor *actor0, const PxVec3 &localPos0, PxRigidActor *actor1, const PxVec3 &localPos1, const PxVec3 &axis, float limit1, float limit2, bool useD6)

Helper function to create a spherical joint, using either a PxD6Joint or PxSphericalJoint.

This function supports a cone limit shape, defined by a cone axis and two angular limit values.

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

The rotations can be limited. Limits are enforced if limit1>0 and limit2>0. Otherwise the motion is free. The limit values define an ellipse, which is the cross-section of the cone limit shape.

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

Limits are expressed in radians. Allowed range is ]0;PI[. Limits are symmetric around the cone axis.

The cone axis is equivalent to the twist axis for the D6 joint. The twist motion is not limited.

See also

PxD6Joint PxSphericalJoint

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 cone axis, expressed in the actors’ local space

  • limit1[in] Max angular limit for the ellipse along the joint frame’s second axis (first axis = cone axis)

  • limit2[in] Max angular limit for the ellipse along the joint frame’s third axis (first axis = cone axis)

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

Returns

The created joint.