Skip to content

Commit

Permalink
Edit user manual
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielChappuis committed Mar 5, 2024
1 parent ba037b7 commit 9e50537
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions documentation/UserManual/ReactPhysics3D-UserManual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
\item Documentation (user manual and Doxygen API)
\item Testbed application with demos
\item Integrated profiler
\item Debugging renderer
\item Debug renderer
\item Logs
\item Unit tests
\end{itemize}
Expand Down Expand Up @@ -1192,7 +1192,8 @@
not limited to triangular faces, you can create faces with more than three vertices. \\

Also note that meshes with duplicated vertices are not supported. The number of vertices you pass to create the \texttt{PolygonVertexArray} must
be exactly the number of vertices in your convex mesh. \\
be exactly the number of vertices in your convex mesh. The \texttt{PhysicsCommon::createConvexMesh()} will also report errors if some faces of your
mesh have almost zero area (degenerated face). You will need to fix those errors in order to create the \texttt{ConvexMesh}. \\

When you specify the vertices for each face of your convex mesh, be careful with their order. The vertices of a face must be specified in
counter clockwise order as seen from the outside of your convex mesh. \\
Expand Down Expand Up @@ -1359,6 +1360,10 @@
\emph{TriangleVertexArray}, the automatic vertices normals computation will not give correct normals because each vertex of the mesh will only be
part of a single triangle face. In this case, you must provide your own vertices normals when you create the \emph{TriangleVertexArray}. \\

The \texttt{PhysicsCommon::createTriangleMesh()} will also report errors if some faces of your mesh have almost zero area
(degenerated face). You will need to fix those errors in order to create the \texttt{TriangleMesh}. It is also a good idea to avoid coplanar faces
for better collision detection. \\

Now that we have a \texttt{TriangleMesh}, we can create the actual \texttt{ConcaveMeshShape}. \\

\begin{lstlisting}
Expand Down Expand Up @@ -1575,7 +1580,8 @@
if you want to simulate a body that is falling on the floor and bumping against it, you will need to have a least of simulation collider in both the
falling body and the floor body. \\

To set a collider as being a simulation collider, you need to use the \texttt{Collider::setIsSimulationCollider()} method as in the following example: \\
To set a collider as being a simulation collider, you need to use the
\texttt{Collider::\allowbreak setIsSimulationCollider()} method as in the following example: \\

\begin{lstlisting}
bombCollider->setIsSimulationCollider(true);
Expand All @@ -1600,7 +1606,7 @@

For instance, if you want to test a body of your scene with raycasting, you need to set the collider of that body as being a world query collider.

To set a collider as being a world query collider, you need to use the \texttt{Collider::setIsWorldQueryCollider()} method as in the following example: \\
To set a collider as being a world query collider, you need to use the \texttt{Collider::\allowbreak setIsWorldQueryCollider()} method as in the following example: \\

\begin{lstlisting}
bombCollider->setIsWorldQueryCollider(true);
Expand Down Expand Up @@ -2360,7 +2366,9 @@
\begin{sloppypar}
By default, the debug rendering is disabled. You can activate it using the \texttt{PhysicsWorld::setIsDebugRenderingEnabled()} method. Note that you
should disable it for the final release because this can be quite expensive to compute. You can get a reference to \texttt{DebugRenderer} of the physics
world using the \texttt{PhysicsWorld::getDebugRenderer()} method. Then, you need to select the debug items
world using the \texttt{PhysicsWorld::getDebugRenderer()} method. You also need to enable debugging for each body that you want to debug using the
\texttt{Body::setIsDebugEnabled()} method. By default,
debuging is disabled for all bodies. Then, you need to select the debug items
(class \texttt{DebugRenderer:DebugItem}) you want to display. For instance, you might want to display the shapes of the colliders
(\texttt{DebugItem::COLLISION\_SHAPE}), the broad-phase AABBs of the colliders (\texttt{DebugItem::COLLIDER\_BROADPHASE\_AABB}), the colliders AABBs
(\texttt{DebugItem::COLLIDER\_AABB}), the contact points (\texttt{DebugItem::CONTACT\_POINT}) or the contact normals (\texttt{DebugItem::CONTACT\_NORMAL}).
Expand All @@ -2373,6 +2381,11 @@
// Enable debug rendering
physicsWorld->setIsDebugRenderingEnabled(true);

// Enable debugging for each rigid body that we want to display
for (RigidBody* body: rigidBodies) {
body->setIsDebugEnabled(true);
}

// Get a reference to the debug renderer
DebugRenderer& debugRenderer = physicsWorld->getDebugRenderer();

Expand Down

0 comments on commit 9e50537

Please sign in to comment.