Bullet Collision Detection & Physics Library
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
btGImpactMeshShape Class Reference

This class manages a mesh supplied by the btStridingMeshInterface interface. More...

#include <btGImpactShape.h>

Inheritance diagram for btGImpactMeshShape:
Inheritance graph
[legend]
Collaboration diagram for btGImpactMeshShape:
Collaboration graph
[legend]

Public Member Functions

 btGImpactMeshShape (btStridingMeshInterface *meshInterface)
 
virtual ~btGImpactMeshShape ()
 
btStridingMeshInterfacegetMeshInterface ()
 
const btStridingMeshInterfacegetMeshInterface () const
 
int getMeshPartCount () const
 
btGImpactMeshShapePartgetMeshPart (int index)
 
const btGImpactMeshShapePartgetMeshPart (int index) const
 
virtual void setLocalScaling (const btVector3 &scaling)
 
virtual void setMargin (btScalar margin)
 
virtual void postUpdate ()
 Tells to this object that is needed to refit all the meshes. More...
 
virtual void calculateLocalInertia (btScalar mass, btVector3 &inertia) const
 
virtual const btPrimitiveManagerBasegetPrimitiveManager () const
 Obtains the primitive manager. More...
 
virtual int getNumChildShapes () const
 Gets the number of children. More...
 
virtual bool childrenHasTransform () const
 if true, then its children must get transforms. More...
 
virtual bool needsRetrieveTriangles () const
 Determines if this shape has triangles. More...
 
virtual bool needsRetrieveTetrahedrons () const
 Determines if this shape has tetrahedrons. More...
 
virtual void getBulletTriangle (int prim_index, btTriangleShapeEx &triangle) const
 
virtual void getBulletTetrahedron (int prim_index, btTetrahedronShapeEx &tetrahedron) const
 
virtual void lockChildShapes () const
 call when reading child shapes More...
 
virtual void unlockChildShapes () const
 
virtual void getChildAabb (int child_index, const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
 Retrieves the bound from a child. More...
 
virtual btCollisionShapegetChildShape (int index)
 Gets the children. More...
 
virtual const btCollisionShapegetChildShape (int index) const
 Gets the child. More...
 
virtual btTransform getChildTransform (int index) const
 Gets the children transform. More...
 
virtual void setChildTransform (int index, const btTransform &transform)
 Sets the children transform. More...
 
virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType () const
 Subshape member functions. More...
 
virtual const char * getName () const
 
virtual void rayTest (const btVector3 &rayFrom, const btVector3 &rayTo, btCollisionWorld::RayResultCallback &resultCallback) const
 virtual method for ray collision More...
 
virtual void processAllTriangles (btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
 Function for retrieve triangles. More...
 
virtual void processAllTrianglesRay (btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
 Function for retrieve triangles. More...
 
virtual int calculateSerializeBufferSize () const
 
virtual const char * serialize (void *dataBuffer, btSerializer *serializer) const
 fills the dataBuffer and returns the struct name (and 0 on failure) More...
 
- Public Member Functions inherited from btGImpactShapeInterface
 btGImpactShapeInterface ()
 
void updateBound ()
 performs refit operation More...
 
void getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
 If the Bounding box is not updated, then this class attemps to calculate it. More...
 
virtual void postUpdate ()
 Tells to this object that is needed to refit the box set. More...
 
const btAABBgetLocalBox ()
 Obtains the local box, which is the global calculated box of the total of subshapes. More...
 
virtual int getShapeType () const
 
virtual void setLocalScaling (const btVector3 &scaling)
 
virtual const btVector3getLocalScaling () const
 
virtual void setMargin (btScalar margin)
 
virtual void rayTest (const btVector3 &rayFrom, const btVector3 &rayTo, btCollisionWorld::RayResultCallback &resultCallback) const
 virtual method for ray collision More...
 
virtual void processAllTriangles (btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
 Function for retrieve triangles. More...
 
virtual void processAllTrianglesRay (btTriangleCallback *, const btVector3 &, const btVector3 &) const
 Function for retrieve triangles. More...
 
const btGImpactBoxSetgetBoxSet () const
 gets boxset More...
 
bool hasBoxSet () const
 Determines if this class has a hierarchy structure for sorting its primitives. More...
 
void getPrimitiveTriangle (int index, btPrimitiveTriangle &triangle) const
 if this trimesh More...
 
- Public Member Functions inherited from btConcaveShape
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btConcaveShape ()
 
virtual ~btConcaveShape ()
 
virtual void processAllTriangles (btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const =0
 
virtual btScalar getMargin () const
 
virtual void setMargin (btScalar collisionMargin)
 
- Public Member Functions inherited from btCollisionShape
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btCollisionShape ()
 
virtual ~btCollisionShape ()
 
virtual void getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const =0
 getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t. More...
 
virtual void getBoundingSphere (btVector3 &center, btScalar &radius) const
 
virtual btScalar getAngularMotionDisc () const
 getAngularMotionDisc returns the maximum radius needed for Conservative Advancement to handle time-of-impact with rotations. More...
 
virtual btScalar getContactBreakingThreshold (btScalar defaultContactThresholdFactor) const
 
void calculateTemporalAabb (const btTransform &curTrans, const btVector3 &linvel, const btVector3 &angvel, btScalar timeStep, btVector3 &temporalAabbMin, btVector3 &temporalAabbMax) const
 calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep) result is conservative More...
 
bool isPolyhedral () const
 
bool isConvex2d () const
 
bool isConvex () const
 
bool isNonMoving () const
 
bool isConcave () const
 
bool isCompound () const
 
bool isSoftBody () const
 
bool isInfinite () const
 isInfinite is used to catch simulation error (aabb check) More...
 
virtual void setLocalScaling (const btVector3 &scaling)=0
 
virtual const btVector3getLocalScaling () const =0
 
virtual void calculateLocalInertia (btScalar mass, btVector3 &inertia) const =0
 
virtual const char * getName () const =0
 
int getShapeType () const
 
virtual btVector3 getAnisotropicRollingFrictionDirection () const
 the getAnisotropicRollingFrictionDirection can be used in combination with setAnisotropicFriction See Bullet/Demos/RollingFrictionDemo for an example More...
 
virtual void setMargin (btScalar margin)=0
 
virtual btScalar getMargin () const =0
 
void setUserPointer (void *userPtr)
 optional user data pointer More...
 
void * getUserPointer () const
 
void setUserIndex (int index)
 
int getUserIndex () const
 
void setUserIndex2 (int index)
 
int getUserIndex2 () const
 
virtual int calculateSerializeBufferSize () const
 
virtual const char * serialize (void *dataBuffer, btSerializer *serializer) const
 fills the dataBuffer and returns the struct name (and 0 on failure) More...
 
virtual void serializeSingleShape (btSerializer *serializer) const
 

Protected Member Functions

void buildMeshParts (btStridingMeshInterface *meshInterface)
 
virtual void calcLocalAABB ()
 use this function for perfofm refit in bounding boxes More...
 
virtual void calcLocalAABB ()
 use this function for perfofm refit in bounding boxes use this function for perfofm refit in bounding boxes More...
 

Protected Attributes

btAlignedObjectArray< btGImpactMeshShapePart * > m_mesh_parts
 
- Protected Attributes inherited from btGImpactShapeInterface
btAABB m_localAABB
 
bool m_needs_update
 
btVector3 localScaling
 
btGImpactBoxSet m_box_set
 
- Protected Attributes inherited from btConcaveShape
btScalar m_collisionMargin
 
- Protected Attributes inherited from btCollisionShape
int m_shapeType
 
void * m_userPointer
 
int m_userIndex
 
int m_userIndex2
 

Private Attributes

btStridingMeshInterfacem_meshInterface
 

Detailed Description

This class manages a mesh supplied by the btStridingMeshInterface interface.

Set of btGImpactMeshShapePart parts

Definition at line 850 of file btGImpactShape.h.

Constructor & Destructor Documentation

◆ btGImpactMeshShape()

btGImpactMeshShape::btGImpactMeshShape ( btStridingMeshInterface meshInterface)
inline

Definition at line 878 of file btGImpactShape.h.

◆ ~btGImpactMeshShape()

virtual btGImpactMeshShape::~btGImpactMeshShape ( )
inlinevirtual

Definition at line 884 of file btGImpactShape.h.

Member Function Documentation

◆ buildMeshParts()

void btGImpactMeshShape::buildMeshParts ( btStridingMeshInterface meshInterface)
inlineprotected

Definition at line 856 of file btGImpactShape.h.

◆ calcLocalAABB()

virtual void btGImpactMeshShape::calcLocalAABB ( )
inlineprotectedvirtual

use this function for perfofm refit in bounding boxes

Reimplemented from btGImpactShapeInterface.

Definition at line 866 of file btGImpactShape.h.

◆ calculateLocalInertia()

void btGImpactMeshShape::calculateLocalInertia ( btScalar  mass,
btVector3 inertia 
) const
virtual

Implements btCollisionShape.

Definition at line 156 of file btGImpactShape.cpp.

◆ calculateSerializeBufferSize()

int btGImpactMeshShape::calculateSerializeBufferSize ( ) const
inlinevirtual

Reimplemented from btCollisionShape.

Definition at line 1110 of file btGImpactShape.h.

◆ childrenHasTransform()

virtual bool btGImpactMeshShape::childrenHasTransform ( ) const
inlinevirtual

if true, then its children must get transforms.

Implements btGImpactShapeInterface.

Definition at line 978 of file btGImpactShape.h.

◆ getBulletTetrahedron()

virtual void btGImpactMeshShape::getBulletTetrahedron ( int  prim_index,
btTetrahedronShapeEx tetrahedron 
) const
inlinevirtual

Implements btGImpactShapeInterface.

Definition at line 1005 of file btGImpactShape.h.

◆ getBulletTriangle()

virtual void btGImpactMeshShape::getBulletTriangle ( int  prim_index,
btTriangleShapeEx triangle 
) const
inlinevirtual

Implements btGImpactShapeInterface.

Definition at line 998 of file btGImpactShape.h.

◆ getChildAabb()

virtual void btGImpactMeshShape::getChildAabb ( int  child_index,
const btTransform t,
btVector3 aabbMin,
btVector3 aabbMax 
) const
inlinevirtual

Retrieves the bound from a child.

Reimplemented from btGImpactShapeInterface.

Definition at line 1026 of file btGImpactShape.h.

◆ getChildShape() [1/2]

virtual btCollisionShape * btGImpactMeshShape::getChildShape ( int  index)
inlinevirtual

Gets the children.

Implements btGImpactShapeInterface.

Definition at line 1036 of file btGImpactShape.h.

◆ getChildShape() [2/2]

virtual const btCollisionShape * btGImpactMeshShape::getChildShape ( int  index) const
inlinevirtual

Gets the child.

Implements btGImpactShapeInterface.

Definition at line 1044 of file btGImpactShape.h.

◆ getChildTransform()

virtual btTransform btGImpactMeshShape::getChildTransform ( int  index) const
inlinevirtual

Gets the children transform.

Implements btGImpactShapeInterface.

Definition at line 1052 of file btGImpactShape.h.

◆ getGImpactShapeType()

virtual eGIMPACT_SHAPE_TYPE btGImpactMeshShape::getGImpactShapeType ( ) const
inlinevirtual

Subshape member functions.

Base method for determinig which kind of GIMPACT shape we get

Implements btGImpactShapeInterface.

Definition at line 1070 of file btGImpactShape.h.

◆ getMeshInterface() [1/2]

btStridingMeshInterface * btGImpactMeshShape::getMeshInterface ( )
inline

Definition at line 895 of file btGImpactShape.h.

◆ getMeshInterface() [2/2]

const btStridingMeshInterface * btGImpactMeshShape::getMeshInterface ( ) const
inline

Definition at line 900 of file btGImpactShape.h.

◆ getMeshPart() [1/2]

btGImpactMeshShapePart * btGImpactMeshShape::getMeshPart ( int  index)
inline

Definition at line 910 of file btGImpactShape.h.

◆ getMeshPart() [2/2]

const btGImpactMeshShapePart * btGImpactMeshShape::getMeshPart ( int  index) const
inline

Definition at line 915 of file btGImpactShape.h.

◆ getMeshPartCount()

int btGImpactMeshShape::getMeshPartCount ( ) const
inline

Definition at line 905 of file btGImpactShape.h.

◆ getName()

virtual const char * btGImpactMeshShape::getName ( ) const
inlinevirtual

Implements btCollisionShape.

Definition at line 1075 of file btGImpactShape.h.

◆ getNumChildShapes()

virtual int btGImpactMeshShape::getNumChildShapes ( ) const
inlinevirtual

Gets the number of children.

Implements btGImpactShapeInterface.

Definition at line 971 of file btGImpactShape.h.

◆ getPrimitiveManager()

virtual const btPrimitiveManagerBase * btGImpactMeshShape::getPrimitiveManager ( ) const
inlinevirtual

Obtains the primitive manager.

Implements btGImpactShapeInterface.

Definition at line 964 of file btGImpactShape.h.

◆ lockChildShapes()

virtual void btGImpactMeshShape::lockChildShapes ( ) const
inlinevirtual

call when reading child shapes

Reimplemented from btGImpactShapeInterface.

Definition at line 1013 of file btGImpactShape.h.

◆ needsRetrieveTetrahedrons()

virtual bool btGImpactMeshShape::needsRetrieveTetrahedrons ( ) const
inlinevirtual

Determines if this shape has tetrahedrons.

Implements btGImpactShapeInterface.

Definition at line 992 of file btGImpactShape.h.

◆ needsRetrieveTriangles()

virtual bool btGImpactMeshShape::needsRetrieveTriangles ( ) const
inlinevirtual

Determines if this shape has triangles.

Implements btGImpactShapeInterface.

Definition at line 985 of file btGImpactShape.h.

◆ postUpdate()

virtual void btGImpactMeshShape::postUpdate ( )
inlinevirtual

Tells to this object that is needed to refit all the meshes.

Reimplemented from btGImpactShapeInterface.

Definition at line 949 of file btGImpactShape.h.

◆ processAllTriangles()

void btGImpactMeshShape::processAllTriangles ( btTriangleCallback callback,
const btVector3 aabbMin,
const btVector3 aabbMax 
) const
virtual

Function for retrieve triangles.

It gives the triangles in local space

Reimplemented from btGImpactShapeInterface.

Definition at line 245 of file btGImpactShape.cpp.

◆ processAllTrianglesRay()

void btGImpactMeshShape::processAllTrianglesRay ( btTriangleCallback ,
const btVector3 ,
const btVector3  
) const
virtual

Function for retrieve triangles.

It gives the triangles in local space

Reimplemented from btGImpactShapeInterface.

Definition at line 254 of file btGImpactShape.cpp.

◆ rayTest()

void btGImpactMeshShape::rayTest ( const btVector3 rayFrom,
const btVector3 rayTo,
btCollisionWorld::RayResultCallback resultCallback 
) const
virtual

virtual method for ray collision

Reimplemented from btGImpactShapeInterface.

Definition at line 188 of file btGImpactShape.cpp.

◆ serialize()

const char * btGImpactMeshShape::serialize ( void *  dataBuffer,
btSerializer serializer 
) const
virtual

fills the dataBuffer and returns the struct name (and 0 on failure)

Reimplemented from btCollisionShape.

Definition at line 264 of file btGImpactShape.cpp.

◆ setChildTransform()

virtual void btGImpactMeshShape::setChildTransform ( int  index,
const btTransform transform 
)
inlinevirtual

Sets the children transform.

Postcondition
You must call updateBound() for update the box set.

Implements btGImpactShapeInterface.

Definition at line 1063 of file btGImpactShape.h.

◆ setLocalScaling()

virtual void btGImpactMeshShape::setLocalScaling ( const btVector3 scaling)
inlinevirtual
Postcondition
You must call updateBound() for update the box set.

Reimplemented from btGImpactShapeInterface.

Definition at line 920 of file btGImpactShape.h.

◆ setMargin()

virtual void btGImpactMeshShape::setMargin ( btScalar  margin)
inlinevirtual

Reimplemented from btGImpactShapeInterface.

Definition at line 934 of file btGImpactShape.h.

◆ unlockChildShapes()

virtual void btGImpactMeshShape::unlockChildShapes ( ) const
inlinevirtual

Reimplemented from btGImpactShapeInterface.

Definition at line 1018 of file btGImpactShape.h.

Member Data Documentation

◆ m_mesh_parts

btAlignedObjectArray<btGImpactMeshShapePart*> btGImpactMeshShape::m_mesh_parts
protected

Definition at line 855 of file btGImpactShape.h.

◆ m_meshInterface

btStridingMeshInterface* btGImpactMeshShape::m_meshInterface
private

Definition at line 852 of file btGImpactShape.h.


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