ReactPhysics3D  v0.10.1
C++ Physics engine library
reactphysics3d::ConcaveShape Class Referenceabstract

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

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

Inheritance diagram for reactphysics3d::ConcaveShape:
reactphysics3d::CollisionShape reactphysics3d::ConcaveMeshShape reactphysics3d::HeightFieldShape

Public Member Functions

 ConcaveShape (CollisionShapeName name, MemoryAllocator &allocator, const Vector3 &scaling)
 Constructor.
 
virtual ~ConcaveShape () override=default
 Destructor.
 
 ConcaveShape (const ConcaveShape &shape)=delete
 Deleted copy-constructor.
 
ConcaveShapeoperator= (const ConcaveShape &shape)=delete
 Deleted assignment operator.
 
TriangleRaycastSide getRaycastTestType () const
 Return the raycast test type (front, back, front-back)
 
void setRaycastTestType (TriangleRaycastSide testType)
 
const Vector3getScale () const
 Return the scale of the shape.
 
virtual void setScale (const Vector3 &scale)
 Set the scale of the shape. More...
 
virtual Vector3 getLocalInertiaTensor (decimal mass) const override
 Return the local inertia tensor of the collision shape. More...
 
virtual bool isConvex () const override
 Return true if the collision shape is convex, false if it is concave.
 
virtual bool isPolyhedron () const override
 Return true if the collision shape is a polyhedron.
 
virtual void computeOverlappingTriangles (const AABB &localAABB, Array< Vector3 > &triangleVertices, Array< Vector3 > &triangleVerticesNormals, Array< uint32 > &shapeIds, MemoryAllocator &allocator) const =0
 Use a callback method on all triangles of the concave shape inside a given AABB.
 
virtual decimal getVolume () const override
 Compute and return the volume of the collision shape. More...
 
- 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. More...
 
CollisionShapeType getType () const
 Return the type of the collision shape. More...
 
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 AABB computeTransformedAABB (const Transform &transform) const
 Compute the transformed AABB of the collision shape given a transform. More...
 
virtual std::string to_string () const =0
 Return the string representation of the shape.
 

Detailed Description

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

Member Function Documentation

◆ getLocalInertiaTensor()

RP3D_FORCE_INLINE Vector3 reactphysics3d::ConcaveShape::getLocalInertiaTensor ( decimal  mass) const
overridevirtual

Return the local inertia tensor of the collision shape.

Parameters
massMass to use to compute the inertia tensor of the collision shape

Implements reactphysics3d::CollisionShape.

◆ getVolume()

decimal ConcaveShape::getVolume ( ) const
overridevirtual

Compute and return the volume of the collision shape.

Note that we approximate the volume of a concave shape with the volume of its AABB.

Implements reactphysics3d::CollisionShape.

◆ setRaycastTestType()

RP3D_FORCE_INLINE void reactphysics3d::ConcaveShape::setRaycastTestType ( TriangleRaycastSide  testType)
Parameters
testTypeRaycast test type for the triangle (front, back, front-back)

◆ setScale()

RP3D_FORCE_INLINE void reactphysics3d::ConcaveShape::setScale ( const Vector3 scale)
virtual

Set the scale of the shape.

Note that you might want to recompute the inertia tensor and center of mass of the body after changing the scale of a collision shape.

Reimplemented in reactphysics3d::ConcaveMeshShape.


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