Learning Physics Modeling with PhysX by Unknown

Learning Physics Modeling with PhysX by Unknown

Author:Unknown
Language: eng
Format: epub
Publisher: Packt Publishing


We can also set the upper and lower rotational limits for a revolute joint. The setLimit() function is used to set the limit of a revolute joint. This function requires a parameter of type PxJointLimitPair. The PxJointLimitPair parameter itself requires three parameters of type PxReal, where lowerLimit specifies the lower value of the limit, upperLimit specifies the upper value of the limit, and limitContactDistance specifies the distance from the upper or lower limit at which the limit constraint becomes active. The lower limit value must always be less than the upper limit value. We enable the defined limits of a revolute joint by calling setRevoluteJointFlag() and setting the PxRevoluteJointFlag::eLIMIT_ENABLED flag to true.

The code snippet for setting the upper and lower rotational limits for a revolute joint is given as follows:

revoluteJoint->setLimit(PxJointLimitPair(lowerLimit, upperLimit, limitContactDistance)); revoluteJoint ->setRevoluteJointFlag(PxRevoluteJointFlag:: eLIMIT_ENABLED, true);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.