Blender  V3.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
btGImpactShapeInterface Class Referenceabstract

Base class for gimpact shapes. More...

#include <btGImpactShape.h>

Inheritance diagram for btGImpactShapeInterface:
btGImpactCompoundShape btGImpactMeshShape btGImpactMeshShapePart

Public Member Functions

 btGImpactShapeInterface ()
 
SIMD_FORCE_INLINE 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...
 
SIMD_FORCE_INLINE 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...
 
virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType () const =0
 Base method for determinig which kind of GIMPACT shape we get. More...
 
SIMD_FORCE_INLINE const btGImpactBoxSetgetBoxSet () const
 gets boxset More...
 
SIMD_FORCE_INLINE bool hasBoxSet () const
 Determines if this class has a hierarchy structure for sorting its primitives. More...
 
virtual const btPrimitiveManagerBasegetPrimitiveManager () const =0
 Obtains the primitive manager. More...
 
virtual int getNumChildShapes () const =0
 Gets the number of children. More...
 
virtual bool childrenHasTransform () const =0
 if true, then its children must get transforms. More...
 
virtual bool needsRetrieveTriangles () const =0
 Determines if this shape has triangles. More...
 
virtual bool needsRetrieveTetrahedrons () const =0
 Determines if this shape has tetrahedrons. More...
 
virtual void getBulletTriangle (int prim_index, btTriangleShapeEx &triangle) const =0
 
virtual void getBulletTetrahedron (int prim_index, btTetrahedronShapeEx &tetrahedron) const =0
 
virtual void lockChildShapes () const
 call when reading child shapes More...
 
virtual void unlockChildShapes () const
 
SIMD_FORCE_INLINE void getPrimitiveTriangle (int index, btPrimitiveTriangle &triangle) const
 if this trimesh More...
 
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)=0
 Gets the children. More...
 
virtual const btCollisionShapegetChildShape (int index) const =0
 Gets the child. More...
 
virtual btTransform getChildTransform (int index) const =0
 Gets the children transform. More...
 
virtual void setChildTransform (int index, const btTransform &transform)=0
 Sets the children transform. More...
 

Protected Member Functions

virtual void calcLocalAABB ()
 

Protected Attributes

btAABB m_localAABB
 
bool m_needs_update
 
btVector3 localScaling
 
btGImpactBoxSet m_box_set
 

Detailed Description

Base class for gimpact shapes.

Definition at line 73 of file btGImpactShape.h.

Constructor & Destructor Documentation

◆ btGImpactShapeInterface()

btGImpactShapeInterface::btGImpactShapeInterface ( )
inline

Definition at line 100 of file btGImpactShape.h.

References GIMPACT_SHAPE_PROXYTYPE, localScaling, m_localAABB, and m_needs_update.

Member Function Documentation

◆ calcLocalAABB()

virtual void btGImpactShapeInterface::calcLocalAABB ( )
inlineprotectedvirtual

use this function for perfofm refit in bounding boxes use this function for perfofm refit in bounding boxes

Reimplemented in btGImpactMeshShape.

Definition at line 83 of file btGImpactShape.h.

References btGImpactQuantizedBvh::buildSet(), btGImpactQuantizedBvh::getGlobalBox(), btGImpactQuantizedBvh::getNodeCount(), lockChildShapes(), m_box_set, m_localAABB, unlockChildShapes(), and btGImpactQuantizedBvh::update().

Referenced by updateBound().

◆ childrenHasTransform()

virtual bool btGImpactShapeInterface::childrenHasTransform ( ) const
pure virtual

◆ getAabb()

void btGImpactShapeInterface::getAabb ( const btTransform t,
btVector3 aabbMin,
btVector3 aabbMax 
) const
inline

If the Bounding box is not updated, then this class attemps to calculate it.

Postcondition
Calls updateBound() for update the box set.

Definition at line 126 of file btGImpactShape.h.

References btAABB, m_localAABB, and t.

Referenced by btCreateCompoundFromGimpactShape(), btGImpactCollisionAlgorithm::gimpact_vs_concave(), and btGImpactCollisionAlgorithm::gimpacttrimeshpart_vs_plane_collision().

◆ getBoxSet()

SIMD_FORCE_INLINE const btGImpactBoxSet* btGImpactShapeInterface::getBoxSet ( ) const
inline

◆ getBulletTetrahedron()

virtual void btGImpactShapeInterface::getBulletTetrahedron ( int  prim_index,
btTetrahedronShapeEx tetrahedron 
) const
pure virtual

◆ getBulletTriangle()

virtual void btGImpactShapeInterface::getBulletTriangle ( int  prim_index,
btTriangleShapeEx triangle 
) const
pure virtual

◆ getChildAabb()

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

◆ getChildShape() [1/2]

virtual const btCollisionShape* btGImpactShapeInterface::getChildShape ( int  index) const
pure virtual

Gets the child.

Implemented in btGImpactMeshShape, btGImpactMeshShapePart, and btGImpactCompoundShape.

◆ getChildShape() [2/2]

virtual btCollisionShape* btGImpactShapeInterface::getChildShape ( int  index)
pure virtual

◆ getChildTransform()

virtual btTransform btGImpactShapeInterface::getChildTransform ( int  index) const
pure virtual

◆ getGImpactShapeType()

virtual eGIMPACT_SHAPE_TYPE btGImpactShapeInterface::getGImpactShapeType ( ) const
pure virtual

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

Subshape member functions

Implemented in btGImpactMeshShape, btGImpactMeshShapePart, and btGImpactCompoundShape.

Referenced by btGImpactCollisionAlgorithm::gimpact_vs_gimpact(), and btGImpactCollisionAlgorithm::gimpact_vs_shape().

◆ getLocalBox()

SIMD_FORCE_INLINE const btAABB& btGImpactShapeInterface::getLocalBox ( )
inline

Obtains the local box, which is the global calculated box of the total of subshapes.

Definition at line 141 of file btGImpactShape.h.

References m_localAABB.

Referenced by btGImpactMeshShape::calcLocalAABB().

◆ getLocalScaling()

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

Reimplemented in btGImpactMeshShapePart.

Definition at line 160 of file btGImpactShape.h.

References localScaling.

Referenced by MyInternalTriangleIndexCallback::internalProcessTriangleIndex().

◆ getNumChildShapes()

virtual int btGImpactShapeInterface::getNumChildShapes ( ) const
pure virtual

◆ getPrimitiveManager()

virtual const btPrimitiveManagerBase* btGImpactShapeInterface::getPrimitiveManager ( ) const
pure virtual

Obtains the primitive manager.

Implemented in btGImpactMeshShape, btGImpactMeshShapePart, and btGImpactCompoundShape.

Referenced by getChildAabb(), and getPrimitiveTriangle().

◆ getPrimitiveTriangle()

SIMD_FORCE_INLINE void btGImpactShapeInterface::getPrimitiveTriangle ( int  index,
btPrimitiveTriangle triangle 
) const
inline

◆ getShapeType()

virtual int btGImpactShapeInterface::getShapeType ( ) const
inlinevirtual

Definition at line 146 of file btGImpactShape.h.

References GIMPACT_SHAPE_PROXYTYPE.

◆ hasBoxSet()

SIMD_FORCE_INLINE bool btGImpactShapeInterface::hasBoxSet ( ) const
inline

Determines if this class has a hierarchy structure for sorting its primitives.

Definition at line 191 of file btGImpactShape.h.

References btGImpactQuantizedBvh::getNodeCount(), and m_box_set.

Referenced by btGImpactCollisionAlgorithm::gimpact_vs_gimpact_find_pairs(), and btGImpactCollisionAlgorithm::gimpact_vs_shape_find_pairs().

◆ lockChildShapes()

virtual void btGImpactShapeInterface::lockChildShapes ( ) const
inlinevirtual

◆ needsRetrieveTetrahedrons()

virtual bool btGImpactShapeInterface::needsRetrieveTetrahedrons ( ) const
pure virtual

Determines if this shape has tetrahedrons.

Implemented in btGImpactMeshShape, btGImpactMeshShapePart, and btGImpactCompoundShape.

Referenced by GIM_ShapeRetriever::GIM_ShapeRetriever().

◆ needsRetrieveTriangles()

virtual bool btGImpactShapeInterface::needsRetrieveTriangles ( ) const
pure virtual

Determines if this shape has triangles.

Implemented in btGImpactMeshShape, btGImpactMeshShapePart, and btGImpactCompoundShape.

Referenced by GIM_ShapeRetriever::GIM_ShapeRetriever().

◆ postUpdate()

virtual void btGImpactShapeInterface::postUpdate ( )
inlinevirtual

Tells to this object that is needed to refit the box set.

Reimplemented in btGImpactMeshShape.

Definition at line 135 of file btGImpactShape.h.

References m_needs_update.

Referenced by btGImpactMeshShape::postUpdate(), btGImpactCompoundShape::setChildTransform(), setLocalScaling(), btGImpactMeshShapePart::setLocalScaling(), and btGImpactMeshShapePart::setMargin().

◆ processAllTriangles()

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

Function for retrieve triangles.

It gives the triangles in local space

Reimplemented in btGImpactMeshShape, and btGImpactMeshShapePart.

Definition at line 272 of file btGImpactShape.h.

References callback, and void.

◆ processAllTrianglesRay()

virtual void btGImpactShapeInterface::processAllTrianglesRay ( btTriangleCallback ,
const btVector3 ,
const btVector3  
) const
inlinevirtual

Function for retrieve triangles.

It gives the triangles in local space

Reimplemented in btGImpactMeshShape, and btGImpactMeshShapePart.

Definition at line 283 of file btGImpactShape.h.

◆ rayTest()

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

virtual method for ray collision

Reimplemented in btGImpactMeshShape.

Definition at line 261 of file btGImpactShape.h.

References void.

◆ setChildTransform()

virtual void btGImpactShapeInterface::setChildTransform ( int  index,
const btTransform transform 
)
pure virtual

Sets the children transform.

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

Implemented in btGImpactMeshShape, btGImpactMeshShapePart, and btGImpactCompoundShape.

◆ setLocalScaling()

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

Reimplemented in btGImpactMeshShape, and btGImpactMeshShapePart.

Definition at line 154 of file btGImpactShape.h.

References localScaling, and postUpdate().

◆ setMargin()

virtual void btGImpactShapeInterface::setMargin ( btScalar  margin)
inlinevirtual

◆ unlockChildShapes()

virtual void btGImpactShapeInterface::unlockChildShapes ( ) const
inlinevirtual

◆ updateBound()

SIMD_FORCE_INLINE void btGImpactShapeInterface::updateBound ( )
inline

performs refit operation

Updates the entire Box set of this shape.

Precondition
postUpdate() must be called for attemps to calculating the box set, else this function will does nothing.
Postcondition
if m_needs_update == true, then it calls calcLocalAABB();

Definition at line 115 of file btGImpactShape.h.

References calcLocalAABB(), and m_needs_update.

Referenced by btCollisionWorldImporter::convertCollisionShape(), RB_shape_new_gimpact_mesh(), and RB_shape_trimesh_update().

Member Data Documentation

◆ localScaling

btVector3 btGImpactShapeInterface::localScaling
protected

◆ m_box_set

btGImpactBoxSet btGImpactShapeInterface::m_box_set
protected

◆ m_localAABB

btAABB btGImpactShapeInterface::m_localAABB
protected

◆ m_needs_update

bool btGImpactShapeInterface::m_needs_update
protected

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