ReactPhysics3D  v0.10.1
C++ Physics engine library
reactphysics3d::ConvexMesh Class Reference

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. More...
 
const Vector3getVertex (uint32 index) const
 Return a vertex. More...
 
uint32 getNbFaces () const
 Return the number of faces. More...
 
const Vector3getFaceNormal (uint32 faceIndex) const
 Return a face normal. More...
 
const HalfEdgeStructuregetHalfEdgeStructure () const
 Return the half-edge structure of the mesh. More...
 
const Vector3getCentroid () const
 Return the centroid of the mesh. More...
 
const AABBgetBounds () const
 Return the bounds of the mesh in the x,y,z direction. More...
 
decimal getVolume () const
 Compute and return the volume of the mesh. More...
 
Vector3 getLocalInertiaTensor (decimal mass, Vector3 scale) const
 Return the local inertia tensor of the mesh. More...
 

Detailed Description

This class describes a convex mesh made of faces and vertices.

The faces are made of polygons (not only triangles).

Member Function Documentation

◆ getBounds()

const AABB & ConvexMesh::getBounds ( ) const

Return the bounds of the mesh in the x,y,z direction.

Returns
The three mimimum bounds of the mesh in the x,y,z direction

◆ getCentroid()

RP3D_FORCE_INLINE const Vector3 & reactphysics3d::ConvexMesh::getCentroid ( ) const

Return the centroid of the mesh.

Returns
The centroid of the mesh

◆ getFaceNormal()

RP3D_FORCE_INLINE const Vector3 & reactphysics3d::ConvexMesh::getFaceNormal ( uint32  faceIndex) const

Return a face normal.

Parameters
faceIndexThe index of a given face of the mesh
Returns
The normal vector of a given face of the mesh

◆ getHalfEdgeStructure()

RP3D_FORCE_INLINE const HalfEdgeStructure & reactphysics3d::ConvexMesh::getHalfEdgeStructure ( ) const

Return the half-edge structure of the mesh.

Returns
The Half-Edge structure of the mesh

◆ getLocalInertiaTensor()

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.

Parameters
massMass to use to compute the inertia tensor of the collision shape
scaleScaling factor for the mesh

◆ getNbFaces()

RP3D_FORCE_INLINE uint32 reactphysics3d::ConvexMesh::getNbFaces ( ) const

Return the number of faces.

Returns
The number of faces in the mesh

◆ getNbVertices()

RP3D_FORCE_INLINE uint32 reactphysics3d::ConvexMesh::getNbVertices ( ) const

Return the number of vertices.

Returns
The number of vertices in the mesh

◆ getVertex()

RP3D_FORCE_INLINE const Vector3 & reactphysics3d::ConvexMesh::getVertex ( uint32  index) const

Return a vertex.

Parameters
indexIndex of a given vertex in the mesh
Returns
The coordinates of a given vertex in the mesh

◆ getVolume()

RP3D_FORCE_INLINE decimal reactphysics3d::ConvexMesh::getVolume ( ) const

Compute and return the volume of the mesh.

Returns
The volume of the mesh

The documentation for this class was generated from the following files: