ReactPhysics3D
v0.10.2
C++ Physics engine library
|
This class describes a convex mesh made of faces and vertices. More...
#include <include/reactphysics3d/collision/ConvexMesh.h>
Public Member Functions | |
uint32 | getNbVertices () const |
Return the number of vertices. | |
const Vector3 & | getVertex (uint32 index) const |
Return a vertex. | |
uint32 | getNbFaces () const |
Return the number of faces. | |
const Vector3 & | getFaceNormal (uint32 faceIndex) const |
Return a face normal. | |
const HalfEdgeStructure & | getHalfEdgeStructure () const |
Return the half-edge structure of the mesh. | |
const Vector3 & | getCentroid () const |
Return the centroid of the mesh. | |
const AABB & | getBounds () const |
Return the bounds of the mesh in the x,y,z direction. | |
decimal | getVolume () const |
Compute and return the volume of the mesh. | |
Vector3 | getLocalInertiaTensor (decimal mass, Vector3 scale) const |
Return the local inertia tensor of the mesh. | |
This class describes a convex mesh made of faces and vertices.
The faces are made of polygons (not only triangles).
const AABB & ConvexMesh::getBounds | ( | ) | const |
Return the bounds of the mesh in the x,y,z direction.
RP3D_FORCE_INLINE const Vector3 & reactphysics3d::ConvexMesh::getCentroid | ( | ) | const |
Return the centroid of the mesh.
RP3D_FORCE_INLINE const Vector3 & reactphysics3d::ConvexMesh::getFaceNormal | ( | uint32 | faceIndex | ) | const |
Return a face normal.
faceIndex | The index of a given face of the mesh |
RP3D_FORCE_INLINE const HalfEdgeStructure & reactphysics3d::ConvexMesh::getHalfEdgeStructure | ( | ) | const |
Return the half-edge structure of the mesh.
RP3D_FORCE_INLINE Vector3 reactphysics3d::ConvexMesh::getLocalInertiaTensor | ( | decimal | mass, |
Vector3 | scale | ||
) | const |
Return the local inertia tensor of the mesh.
The local inertia tensor of the convex mesh is approximated using the inertia tensor of its bounding box.
mass | Mass to use to compute the inertia tensor of the collision shape |
scale | Scaling factor for the mesh |
RP3D_FORCE_INLINE uint32 reactphysics3d::ConvexMesh::getNbFaces | ( | ) | const |
Return the number of faces.
RP3D_FORCE_INLINE uint32 reactphysics3d::ConvexMesh::getNbVertices | ( | ) | const |
Return the number of vertices.
RP3D_FORCE_INLINE const Vector3 & reactphysics3d::ConvexMesh::getVertex | ( | uint32 | index | ) | const |
Return a vertex.
index | Index of a given vertex in the mesh |
RP3D_FORCE_INLINE decimal reactphysics3d::ConvexMesh::getVolume | ( | ) | const |
Compute and return the volume of the mesh.