Add documentation for ball and socket joint cone limit in user manual
This commit is contained in:
parent
80c7d1289c
commit
b9e363fe87
Binary file not shown.
|
@ -1569,7 +1569,25 @@ BallAndSocketJoint* joint;
|
|||
joint = dynamic_cast<BallAndSocketJoint*>(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}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user