diff --git a/documentation/UserManual/ReactPhysics3D-UserManual.pdf b/documentation/UserManual/ReactPhysics3D-UserManual.pdf index d4b10c5c..c8db0274 100644 Binary files a/documentation/UserManual/ReactPhysics3D-UserManual.pdf and b/documentation/UserManual/ReactPhysics3D-UserManual.pdf differ diff --git a/documentation/UserManual/ReactPhysics3D-UserManual.tex b/documentation/UserManual/ReactPhysics3D-UserManual.tex index 6b1000bb..7cb5daa0 100644 --- a/documentation/UserManual/ReactPhysics3D-UserManual.tex +++ b/documentation/UserManual/ReactPhysics3D-UserManual.tex @@ -1569,7 +1569,25 @@ BallAndSocketJoint* joint; joint = dynamic_cast(world->createJoint(jointInfo)); \end{lstlisting} - \vspace{0.6cm} + \subsubsection{Cone limit} + + With the ball and socket joint, it is possible to enable a cone limit. The idea is to constrain the rotation of body 2 around the anchor point + in to stay inside a cone. This can be used to limit the rotation angle of body 2 with respect to the main cone axis. \\ + + In the following example, we enable the cone limit for a given ball and socket joint. We limit the rotation with a maximum angle with respect to + the main axis of the cone (here the local-space Y axis of each body). \\ + + \begin{lstlisting} +// Set the main axis of the cone (in both local-spaces of body 1 and 2) +joint->setConeLimitLocalAxisBody1(rp3d::Vector3(0, 1, 0)); +joint->setConeLimitLocalAxisBody2(rp3d::Vector3(0, 1, 0)); + +// Set the maximum half angle (in radians) +joint->setConeLimitHalfAngle(45.0 * PI / 180.0); + +// Enable the cone limit for this joint +joint->enableConeLimit(true); + \end{lstlisting} \subsection{Hinge Joint}