ReactPhysics3D  v0.10.2
C++ Physics engine library
Loading...
Searching...
No Matches
reactphysics3d::ConvexPolyhedronShape Class Referenceabstract

This abstract class represents a convex polyhedron collision shape associated with a body that is used during the narrow-phase collision detection. More...

#include <include/reactphysics3d/collision/shapes/ConvexPolyhedronShape.h>

Inheritance diagram for reactphysics3d::ConvexPolyhedronShape:
reactphysics3d::ConvexShape reactphysics3d::CollisionShape reactphysics3d::BoxShape reactphysics3d::ConvexMeshShape reactphysics3d::TriangleShape

Public Member Functions

 ConvexPolyhedronShape (CollisionShapeName name, MemoryAllocator &allocator)
 Constructor.
 
virtual ~ConvexPolyhedronShape () override=default
 Destructor.
 
 ConvexPolyhedronShape (const ConvexPolyhedronShape &shape)=delete
 Deleted copy-constructor.
 
ConvexPolyhedronShapeoperator= (const ConvexPolyhedronShape &shape)=delete
 Deleted assignment operator.
 
virtual uint32 getNbFaces () const =0
 Return the number of faces of the polyhedron.
 
virtual const HalfEdgeStructure::FacegetFace (uint32 faceIndex) const =0
 Return a given face of the polyhedron.
 
virtual uint32 getNbVertices () const =0
 Return the number of vertices of the polyhedron.
 
virtual const HalfEdgeStructure::VertexgetVertex (uint32 vertexIndex) const =0
 Return a given vertex of the polyhedron.
 
virtual Vector3 getVertexPosition (uint32 vertexIndex) const =0
 Return the position of a given vertex.
 
virtual Vector3 getFaceNormal (uint32 faceIndex) const =0
 Return the normal vector of a given face of the polyhedron.
 
virtual uint32 getNbHalfEdges () const =0
 Return the number of half-edges of the polyhedron.
 
virtual const HalfEdgeStructure::EdgegetHalfEdge (uint32 edgeIndex) const =0
 Return a given half-edge of the polyhedron.
 
virtual bool isPolyhedron () const override
 Return true if the collision shape is a polyhedron.
 
virtual Vector3 getCentroid () const =0
 Return the centroid of the polyhedron.
 
uint32 findMostAntiParallelFace (const Vector3 &direction) const
 Find and return the index of the polyhedron face with the most anti-parallel face normal given a direction vector.
 
- Public Member Functions inherited from reactphysics3d::ConvexShape
 ConvexShape (CollisionShapeName name, CollisionShapeType type, MemoryAllocator &allocator, decimal margin=decimal(0.0))
 Constructor.
 
virtual ~ConvexShape () override=default
 Destructor.
 
 ConvexShape (const ConvexShape &shape)=delete
 Deleted copy-constructor.
 
ConvexShapeoperator= (const ConvexShape &shape)=delete
 Deleted assignment operator.
 
decimal getMargin () const
 Return the current object margin.
 
virtual bool isConvex () const override
 Return true if the collision shape is convex, false if it is concave.
 
- Public Member Functions inherited from reactphysics3d::CollisionShape
 CollisionShape (CollisionShapeName name, CollisionShapeType type, MemoryAllocator &allocator)
 Constructor.
 
virtual ~CollisionShape ()=default
 Destructor.
 
 CollisionShape (const CollisionShape &shape)=delete
 Deleted copy-constructor.
 
CollisionShapeoperator= (const CollisionShape &shape)=delete
 Deleted assignment operator.
 
CollisionShapeName getName () const
 Return the name of the collision shape.
 
CollisionShapeType getType () const
 Return the type of the collision shape.
 
virtual AABB getLocalBounds () const =0
 Return the local bounds of the shape in x, y and z directions.
 
uint32 getId () const
 Return the id of the shape.
 
virtual Vector3 getLocalInertiaTensor (decimal mass) const =0
 Return the local inertia tensor of the collision shapes.
 
virtual decimal getVolume () const =0
 Compute and return the volume of the collision shape.
 
virtual AABB computeTransformedAABB (const Transform &transform) const
 Compute the transformed AABB of the collision shape given a transform.
 
virtual std::string to_string () const =0
 Return the string representation of the shape.
 

Detailed Description

This abstract class represents a convex polyhedron collision shape associated with a body that is used during the narrow-phase collision detection.

Member Function Documentation

◆ getCentroid()

virtual Vector3 reactphysics3d::ConvexPolyhedronShape::getCentroid ( ) const
pure virtual

Return the centroid of the polyhedron.

Implemented in reactphysics3d::BoxShape, reactphysics3d::ConvexMeshShape, and reactphysics3d::TriangleShape.

◆ getFace()

virtual const HalfEdgeStructure::Face & reactphysics3d::ConvexPolyhedronShape::getFace ( uint32  faceIndex) const
pure virtual

Return a given face of the polyhedron.

Implemented in reactphysics3d::BoxShape, reactphysics3d::ConvexMeshShape, and reactphysics3d::TriangleShape.

◆ getFaceNormal()

virtual Vector3 reactphysics3d::ConvexPolyhedronShape::getFaceNormal ( uint32  faceIndex) const
pure virtual

Return the normal vector of a given face of the polyhedron.

Implemented in reactphysics3d::BoxShape, reactphysics3d::ConvexMeshShape, and reactphysics3d::TriangleShape.

◆ getHalfEdge()

virtual const HalfEdgeStructure::Edge & reactphysics3d::ConvexPolyhedronShape::getHalfEdge ( uint32  edgeIndex) const
pure virtual

Return a given half-edge of the polyhedron.

Implemented in reactphysics3d::BoxShape, reactphysics3d::ConvexMeshShape, and reactphysics3d::TriangleShape.

◆ getNbFaces()

virtual uint32 reactphysics3d::ConvexPolyhedronShape::getNbFaces ( ) const
pure virtual

Return the number of faces of the polyhedron.

Implemented in reactphysics3d::BoxShape, reactphysics3d::ConvexMeshShape, and reactphysics3d::TriangleShape.

◆ getNbHalfEdges()

virtual uint32 reactphysics3d::ConvexPolyhedronShape::getNbHalfEdges ( ) const
pure virtual

Return the number of half-edges of the polyhedron.

Implemented in reactphysics3d::BoxShape, reactphysics3d::ConvexMeshShape, and reactphysics3d::TriangleShape.

◆ getNbVertices()

virtual uint32 reactphysics3d::ConvexPolyhedronShape::getNbVertices ( ) const
pure virtual

Return the number of vertices of the polyhedron.

Implemented in reactphysics3d::BoxShape, reactphysics3d::ConvexMeshShape, and reactphysics3d::TriangleShape.

◆ getVertex()

virtual const HalfEdgeStructure::Vertex & reactphysics3d::ConvexPolyhedronShape::getVertex ( uint32  vertexIndex) const
pure virtual

Return a given vertex of the polyhedron.

Implemented in reactphysics3d::BoxShape, reactphysics3d::ConvexMeshShape, and reactphysics3d::TriangleShape.

◆ getVertexPosition()

virtual Vector3 reactphysics3d::ConvexPolyhedronShape::getVertexPosition ( uint32  vertexIndex) const
pure virtual

Return the position of a given vertex.

Implemented in reactphysics3d::BoxShape, reactphysics3d::ConvexMeshShape, and reactphysics3d::TriangleShape.

◆ isPolyhedron()

RP3D_FORCE_INLINE bool reactphysics3d::ConvexPolyhedronShape::isPolyhedron ( ) const
overridevirtual

Return true if the collision shape is a polyhedron.

Implements reactphysics3d::CollisionShape.


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