Blender V5.0
btGImpactMeshShapePart Class Reference

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

#include <btGImpactShape.h>

Inherits btGImpactShapeInterface.

Classes

class  TrimeshPrimitiveManager
 Trimesh primitive manager. More...

Public Member Functions

 btGImpactMeshShapePart ()
 btGImpactMeshShapePart (btStridingMeshInterface *meshInterface, int part)
virtual ~btGImpactMeshShapePart ()
virtual bool childrenHasTransform () const
 if true, then its children must get transforms.
virtual void lockChildShapes () const
 call when reading child shapes
virtual void unlockChildShapes () const
virtual int getNumChildShapes () const
 Gets the number of children.
virtual btCollisionShapegetChildShape (int index)
 Gets the children.
virtual const btCollisionShapegetChildShape (int index) const
 Gets the child.
virtual btTransform getChildTransform (int index) const
 Gets the children transform.
virtual void setChildTransform (int index, const btTransform &transform)
 Sets the children transform.
virtual const btPrimitiveManagerBasegetPrimitiveManager () const
 Obtains the primitive manager.
SIMD_FORCE_INLINE TrimeshPrimitiveManagergetTrimeshPrimitiveManager ()
virtual void calculateLocalInertia (btScalar mass, btVector3 &inertia) const
virtual const char * getName () const
virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType () const
 Base method for determinig which kind of GIMPACT shape we get.
virtual bool needsRetrieveTriangles () const
 Determines if this shape has triangles.
virtual bool needsRetrieveTetrahedrons () const
 Determines if this shape has tetrahedrons.
virtual void getBulletTriangle (int prim_index, btTriangleShapeEx &triangle) const
virtual void getBulletTetrahedron (int prim_index, btTetrahedronShapeEx &tetrahedron) const
SIMD_FORCE_INLINE int getVertexCount () const
SIMD_FORCE_INLINE void getVertex (int vertex_index, btVector3 &vertex) const
SIMD_FORCE_INLINE void setMargin (btScalar margin)
SIMD_FORCE_INLINE btScalar getMargin () const
virtual void setLocalScaling (const btVector3 &scaling)
virtual const btVector3getLocalScaling () const
SIMD_FORCE_INLINE int getPart () const
virtual void processAllTriangles (btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
 Function for retrieve triangles.
virtual void processAllTrianglesRay (btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
 Function for retrieve triangles.
Public Member Functions inherited from btGImpactShapeInterface
 btGImpactShapeInterface ()
SIMD_FORCE_INLINE void updateBound ()
 performs refit operation
void getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
 If the Bounding box is not updated, then this class attemps to calculate it.
virtual void postUpdate ()
 Tells to this object that is needed to refit the box set.
SIMD_FORCE_INLINE const btAABBgetLocalBox ()
 Obtains the local box, which is the global calculated box of the total of subshapes.
virtual int getShapeType () const
virtual void rayTest (const btVector3 &rayFrom, const btVector3 &rayTo, btCollisionWorld::RayResultCallback &resultCallback) const
 virtual method for ray collision
SIMD_FORCE_INLINE const btGImpactBoxSetgetBoxSet () const
 gets boxset
SIMD_FORCE_INLINE bool hasBoxSet () const
 Determines if this class has a hierarchy structure for sorting its primitives.
SIMD_FORCE_INLINE void getPrimitiveTriangle (int index, btPrimitiveTriangle &triangle) const
 if this trimesh
virtual void getChildAabb (int child_index, const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
 Retrieves the bound from a child.

Protected Attributes

TrimeshPrimitiveManager m_primitive_manager
Protected Attributes inherited from btGImpactShapeInterface
btAABB m_localAABB
bool m_needs_update
btVector3 localScaling
btGImpactBoxSet m_box_set

Additional Inherited Members

Protected Member Functions inherited from btGImpactShapeInterface
virtual void calcLocalAABB ()

Detailed Description

This class manages a sub part of a mesh supplied by the btStridingMeshInterface interface.

  • Simply create this shape by passing the btStridingMeshInterface to the constructor btGImpactMeshShapePart, then you must call updateBound() after creating the mesh
  • When making operations with this shape, you must call lock before accessing to the trimesh primitives, and then call unlock
  • You can handle deformable meshes with this shape, by calling postUpdate() every time when changing the mesh vertices.

Definition at line 502 of file btGImpactShape.h.

Constructor & Destructor Documentation

◆ btGImpactMeshShapePart() [1/2]

btGImpactMeshShapePart::btGImpactMeshShapePart ( )
inline

Definition at line 695 of file btGImpactShape.h.

References btGImpactShapeInterface::m_box_set, and m_primitive_manager.

◆ btGImpactMeshShapePart() [2/2]

btGImpactMeshShapePart::btGImpactMeshShapePart ( btStridingMeshInterface * meshInterface,
int part )

◆ ~btGImpactMeshShapePart()

btGImpactMeshShapePart::~btGImpactMeshShapePart ( )
virtual

Definition at line 46 of file btGImpactShape.cpp.

References m_primitive_manager.

Member Function Documentation

◆ calculateLocalInertia()

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

◆ childrenHasTransform()

virtual bool btGImpactMeshShapePart::childrenHasTransform ( ) const
inlinevirtual

if true, then its children must get transforms.

Implements btGImpactShapeInterface.

Definition at line 704 of file btGImpactShape.h.

◆ getBulletTetrahedron()

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

Implements btGImpactShapeInterface.

Definition at line 794 of file btGImpactShape.h.

References btAssert.

◆ getBulletTriangle()

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

◆ getChildShape() [1/2]

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

Gets the children.

Implements btGImpactShapeInterface.

Definition at line 720 of file btGImpactShape.h.

References btAssert, and btCollisionShape.

◆ getChildShape() [2/2]

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

Gets the child.

Implements btGImpactShapeInterface.

Definition at line 728 of file btGImpactShape.h.

References btAssert, and btCollisionShape.

◆ getChildTransform()

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

Gets the children transform.

Implements btGImpactShapeInterface.

Definition at line 736 of file btGImpactShape.h.

References btAssert, and btTransform.

◆ getGImpactShapeType()

virtual eGIMPACT_SHAPE_TYPE btGImpactMeshShapePart::getGImpactShapeType ( ) const
inlinevirtual

Base method for determinig which kind of GIMPACT shape we get.

Subshape member functions

Implements btGImpactShapeInterface.

Definition at line 772 of file btGImpactShape.h.

References CONST_GIMPACT_TRIMESH_SHAPE_PART.

◆ getLocalScaling()

virtual const btVector3 & btGImpactMeshShapePart::getLocalScaling ( ) const
inlinevirtual

Reimplemented from btGImpactShapeInterface.

Definition at line 828 of file btGImpactShape.h.

References btVector3, and m_primitive_manager.

◆ getMargin()

SIMD_FORCE_INLINE btScalar btGImpactMeshShapePart::getMargin ( ) const
inline

◆ getName()

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

Definition at line 767 of file btGImpactShape.h.

◆ getNumChildShapes()

virtual int btGImpactMeshShapePart::getNumChildShapes ( ) const
inlinevirtual

Gets the number of children.

Implements btGImpactShapeInterface.

Definition at line 714 of file btGImpactShape.h.

References m_primitive_manager.

◆ getPart()

SIMD_FORCE_INLINE int btGImpactMeshShapePart::getPart ( ) const
inline

Definition at line 833 of file btGImpactShape.h.

References m_primitive_manager, and SIMD_FORCE_INLINE.

Referenced by processAllTriangles(), and processAllTrianglesRay().

◆ getPrimitiveManager()

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

Obtains the primitive manager.

Implements btGImpactShapeInterface.

Definition at line 755 of file btGImpactShape.h.

References m_primitive_manager.

◆ getTrimeshPrimitiveManager()

SIMD_FORCE_INLINE TrimeshPrimitiveManager * btGImpactMeshShapePart::getTrimeshPrimitiveManager ( )
inline

Definition at line 760 of file btGImpactShape.h.

References m_primitive_manager, and SIMD_FORCE_INLINE.

◆ getVertex()

SIMD_FORCE_INLINE void btGImpactMeshShapePart::getVertex ( int vertex_index,
btVector3 & vertex ) const
inline

◆ getVertexCount()

SIMD_FORCE_INLINE int btGImpactMeshShapePart::getVertexCount ( ) const
inline

◆ lockChildShapes()

◆ needsRetrieveTetrahedrons()

virtual bool btGImpactMeshShapePart::needsRetrieveTetrahedrons ( ) const
inlinevirtual

Determines if this shape has tetrahedrons.

Implements btGImpactShapeInterface.

Definition at line 784 of file btGImpactShape.h.

◆ needsRetrieveTriangles()

virtual bool btGImpactMeshShapePart::needsRetrieveTriangles ( ) const
inlinevirtual

Determines if this shape has triangles.

Implements btGImpactShapeInterface.

Definition at line 778 of file btGImpactShape.h.

◆ processAllTriangles()

void btGImpactMeshShapePart::processAllTriangles ( btTriangleCallback * callback,
const btVector3 & aabbMin,
const btVector3 & aabbMax ) const
virtual

◆ processAllTrianglesRay()

void btGImpactMeshShapePart::processAllTrianglesRay ( btTriangleCallback * ,
const btVector3 & ,
const btVector3 &  ) const
virtual

◆ setChildTransform()

virtual void btGImpactMeshShapePart::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 747 of file btGImpactShape.h.

References btAssert, btTransform, and transform().

◆ setLocalScaling()

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

Reimplemented from btGImpactShapeInterface.

Definition at line 822 of file btGImpactShape.h.

References btVector3, m_primitive_manager, and btGImpactShapeInterface::postUpdate().

Referenced by btGImpactMeshShape::setLocalScaling().

◆ setMargin()

SIMD_FORCE_INLINE void btGImpactMeshShapePart::setMargin ( btScalar margin)
inlinevirtual

◆ unlockChildShapes()

Member Data Documentation

◆ m_primitive_manager


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