ReactPhysics3D: reactphysics3d::HalfEdgeStructure Class Reference

| ReactPhysics3D v0.10.2 C++ Physics engine library

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
reactphysics3d::HalfEdgeStructure Class Reference

This class describes a polyhedron mesh made of faces and vertices. More...

`#include <include/reactphysics3d/collision/HalfEdgeStructure.h>`

## Classes
struct | Edge
| Edge. More...
struct | Face
| Face. More...
struct | Vertex
| Vertex. More...

## Public Types
using | VerticesPair = Pair< uint32, uint32 >

## Public Member Functions
| HalfEdgeStructure (MemoryAllocator &allocator, uint32 facesCapacity, uint32 verticesCapacity, uint32 edgesCapacity)
| Constructor.
| ~HalfEdgeStructure ()=default
| Destructor.
void | computeHalfEdges ()
| Compute the half-edges (when all vertices and faces have been added)
uint32 | addVertex (uint32 vertexPointIndex)
| Add a vertex.
void | addFace (const Array< uint32 > &faceVertices)
| Add a face.
uint32 | getNbFaces () const
| Return the number of faces.
uint32 | getNbHalfEdges () const
| Return the number of half-edges.
uint32 | getNbVertices () const
| Return the number of vertices.
const Face & | getFace (uint32 index) const
| Return a given face.
const Edge & | getHalfEdge (uint32 index) const
| Return a given edge.
const Vertex & | getVertex (uint32 index) const
| Return a given vertex.
void | reserve (uint32 facesCapacity, uint32 verticesCapacity, uint32 edgesCapacity)
| Reserve some memory for vertices, faces and edges.
std::string | to_string () const
| Return a string representation of the half-edge structure.

## Detailed Description

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

The faces do not have to be triangle.

## Member Function Documentation

## ◆ addFace()

RP3D_FORCE_INLINE void reactphysics3d::HalfEdgeStructure::addFace | ( | const Array< uint32 > & | faceVertices | ) |

Add a face.

Parameters

  faceVertices | Array of the vertices in a face (ordered in CCW order as seen from outside the polyhedron). The indices are the internal indices of the vertices inside the HalfEdgeStructure.

## ◆ addVertex()

RP3D_FORCE_INLINE uint32 reactphysics3d::HalfEdgeStructure::addVertex | ( | uint32 | vertexPointIndex | ) |

Add a vertex.

Parameters

  vertexPointIndex | Index of the vertex in the external user vertex data array

## ◆ getFace()

RP3D_FORCE_INLINE const HalfEdgeStructure::Face & reactphysics3d::HalfEdgeStructure::getFace | ( | uint32 | index | ) | const

Return a given face.

Returns
  A given face of the polyhedron

## ◆ getHalfEdge()

RP3D_FORCE_INLINE const HalfEdgeStructure::Edge & reactphysics3d::HalfEdgeStructure::getHalfEdge | ( | uint32 | index | ) | const

Return a given edge.

Returns
  A given edge of the polyhedron

## ◆ getNbFaces()

RP3D_FORCE_INLINE uint32 reactphysics3d::HalfEdgeStructure::getNbFaces | ( |  | ) | const

Return the number of faces.

Returns
  The number of faces in the polyhedron

## ◆ getNbHalfEdges()

RP3D_FORCE_INLINE uint32 reactphysics3d::HalfEdgeStructure::getNbHalfEdges | ( |  | ) | const

Return the number of half-edges.

Returns
  The number of edges in the polyhedron

## ◆ getNbVertices()

RP3D_FORCE_INLINE uint32 reactphysics3d::HalfEdgeStructure::getNbVertices | ( |  | ) | const

Return the number of vertices.

Returns
  The number of vertices in the polyhedron

## ◆ getVertex()

RP3D_FORCE_INLINE const HalfEdgeStructure::Vertex & reactphysics3d::HalfEdgeStructure::getVertex | ( | uint32 | index | ) | const

Return a given vertex.

Returns
  A given vertex of the polyhedron

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

- include/reactphysics3d/collision/HalfEdgeStructure.h
- src/collision/HalfEdgeStructure.cpp