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

This class is used to describe the vertices and faces of a mesh. More...

#include <include/reactphysics3d/collision/PolygonVertexArray.h>

Classes

struct  PolygonFace
 Represent a polygon face of the mesh. More...
 

Public Types

enum class  VertexDataType { VERTEX_FLOAT_TYPE , VERTEX_DOUBLE_TYPE }
 Data type for the vertices in the array.
 
enum class  IndexDataType { INDEX_INTEGER_TYPE , INDEX_SHORT_TYPE }
 Data type for the indices in the array.
 

Public Member Functions

 PolygonVertexArray ()
 Constructor.
 
 PolygonVertexArray (uint32 nbVertices, const void *verticesStart, uint32 verticesStride, const void *indexesStart, uint32 indexesStride, uint32 nbFaces, PolygonFace *facesStart, VertexDataType vertexDataType, IndexDataType indexDataType)
 Constructor. More...
 
void init (uint32 nbVertices, const void *verticesStart, uint32 verticesStride, const void *indexesStart, uint32 indexesStride, uint32 nbFaces, PolygonFace *facesStart, VertexDataType vertexDataType, IndexDataType indexDataType)
 Initialize the PolygonVertexArray.
 
VertexDataType getVertexDataType () const
 Return the vertex data type. More...
 
IndexDataType getIndexDataType () const
 Return the index data type. More...
 
uint32 getNbVertices () const
 Return the number of vertices. More...
 
uint32 getNbFaces () const
 Return the number of faces. More...
 
uint32 getVerticesStride () const
 Return the vertices stride (number of bytes) More...
 
uint32 getIndicesStride () const
 Return the indices stride (number of bytes) More...
 
uint32 getVertexIndexInFace (uint32 faceIndex32, uint32 noVertexInFace) const
 Return the vertex index of a given vertex in a face. More...
 
Vector3 getVertex (uint32 vertexIndex) const
 Return the coordinates of a given vertex.
 
PolygonFacegetPolygonFace (uint32 faceIndex) const
 Return a polygon face of the mesh. More...
 
const unsigned char * getVerticesStart () const
 Return the pointer to the start of the vertices array. More...
 
const unsigned char * getIndicesStart () const
 Return the pointer to the start of the indices array. More...
 

Detailed Description

This class is used to describe the vertices and faces of a mesh.

A PolygonVertexArray represents an array of vertices and polygon faces of a mesh. When you create a PolygonVertexArray, no data is copied into the array. It only stores pointer to the data.

Constructor & Destructor Documentation

◆ PolygonVertexArray()

PolygonVertexArray::PolygonVertexArray ( uint32  nbVertices,
const void *  verticesStart,
uint32  verticesStride,
const void *  indexesStart,
uint32  indexesStride,
uint32  nbFaces,
PolygonFace facesStart,
VertexDataType  vertexDataType,
IndexDataType  indexDataType 
)

Constructor.

Note that your data will not be copied into the PolygonVertexArray and therefore, you need to make sure that those data are always valid during the lifetime of the PolygonVertexArray.

Parameters
nbVerticesNumber of vertices in the array
verticesStartPointer to the start of the vertices data
verticesStrideThe number of bytes between two consecutive vertices in the array
indexesStartPointer to the start of the face indices data
indexesStrideThe number of bytes between two consecutive face indices in the array
nbFacesThe number of faces in the array
facesStartPointer to the start of the faces data
vertexDataTypeData type of the vertices data
indexDataTypeData type of the face indices data

Member Function Documentation

◆ getIndexDataType()

RP3D_FORCE_INLINE PolygonVertexArray::IndexDataType reactphysics3d::PolygonVertexArray::getIndexDataType ( ) const

Return the index data type.

Returns
The data type of the indices in the array

◆ getIndicesStart()

RP3D_FORCE_INLINE const unsigned char * reactphysics3d::PolygonVertexArray::getIndicesStart ( ) const

Return the pointer to the start of the indices array.

Returns
A pointer to the start of the face indices array of the mesh

◆ getIndicesStride()

RP3D_FORCE_INLINE uint32 reactphysics3d::PolygonVertexArray::getIndicesStride ( ) const

Return the indices stride (number of bytes)

Returns
The number of bytes between two consecutive face indices

◆ getNbFaces()

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

Return the number of faces.

Returns
The number of faces in the array

◆ getNbVertices()

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

Return the number of vertices.

Returns
The number of vertices in the array

◆ getPolygonFace()

RP3D_FORCE_INLINE PolygonVertexArray::PolygonFace * reactphysics3d::PolygonVertexArray::getPolygonFace ( uint32  faceIndex) const

Return a polygon face of the mesh.

Parameters
faceIndexIndex of a given face
Returns
A polygon face

◆ getVertexDataType()

RP3D_FORCE_INLINE PolygonVertexArray::VertexDataType reactphysics3d::PolygonVertexArray::getVertexDataType ( ) const

Return the vertex data type.

Returns
The data type of the vertices in the array

◆ getVertexIndexInFace()

uint32 PolygonVertexArray::getVertexIndexInFace ( uint32  faceIndex32,
uint32  noVertexInFace 
) const

Return the vertex index of a given vertex in a face.

Returns
The index of a vertex (in the array of vertices data) of a given vertex in a face

◆ getVerticesStart()

RP3D_FORCE_INLINE const unsigned char * reactphysics3d::PolygonVertexArray::getVerticesStart ( ) const

Return the pointer to the start of the vertices array.

Returns
A pointer to the start of the vertex array of the mesh

◆ getVerticesStride()

RP3D_FORCE_INLINE uint32 reactphysics3d::PolygonVertexArray::getVerticesStride ( ) const

Return the vertices stride (number of bytes)

Returns
The number of bytes between two vertices

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