Blender V4.5
btCollisionShape.h File Reference

Go to the source code of this file.

Classes

struct  btCollisionShapeData
 do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 More...

Functions

 BT_DECLARE_ALIGNED_ALLOCATOR ()
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.
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.
virtual btScalar getContactBreakingThreshold (btScalar defaultContactThresholdFactor) const
void calculateTemporalAabb (const btTransform &curTrans, const btVector3 &linvel, const btVector3 &angvel, btScalar timeStep, btVector3 &temporalAabbMin, btVector3 &temporalAabbMax) const
SIMD_FORCE_INLINE bool isPolyhedral () const
SIMD_FORCE_INLINE bool isConvex2d () const
SIMD_FORCE_INLINE bool isConvex () const
SIMD_FORCE_INLINE bool isNonMoving () const
SIMD_FORCE_INLINE bool isConcave () const
SIMD_FORCE_INLINE bool isCompound () const
SIMD_FORCE_INLINE bool isSoftBody () const
SIMD_FORCE_INLINE bool isInfinite () const
 isInfinite is used to catch simulation error (aabb check)
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
virtual void setMargin (btScalar margin)=0
virtual btScalar getMargin () const =0
void setUserPointer (void *userPtr)
 optional user data pointer
void * getUserPointer () const
void setUserIndex (int index)
int getUserIndex () 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)
virtual void serializeSingleShape (btSerializer *serializer) const

Variables

 btCollisionShape
 The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
void * m_userPointer
int m_userIndex

Function Documentation

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ calculateLocalInertia()

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

Definition at line 54 of file btConeShape.h.

◆ calculateSerializeBufferSize()

virtual int calculateSerializeBufferSize ( ) const
virtual

◆ calculateTemporalAabb()

void btCollisionShape::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

Todo
: simd would have a vector max/min operation, instead of per-element access

Definition at line 57 of file btCollisionShape.cpp.

References btTransform, btVector3, getAabb(), and getAngularMotionDisc().

◆ getAabb()

virtual void getAabb ( const btTransform & t,
btVector3 & aabbMin,
btVector3 & aabbMax ) const
pure virtual

getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.

Definition at line 54 of file btCapsuleShape.h.

◆ getAngularMotionDisc()

btScalar btCollisionShape::getAngularMotionDisc ( ) const
virtual

getAngularMotionDisc returns the maximum radius needed for Conservative Advancement to handle time-of-impact with rotations.

Todo
cache this value, to improve performance

Definition at line 47 of file btCollisionShape.cpp.

References btVector3, getBoundingSphere(), and length().

Referenced by btConvexConvexAlgorithm::btConvexConvexAlgorithm(), calculateTemporalAabb(), and getContactBreakingThreshold().

◆ getAnisotropicRollingFrictionDirection()

virtual btVector3 getAnisotropicRollingFrictionDirection ( ) const
virtual

the getAnisotropicRollingFrictionDirection can be used in combination with setAnisotropicFriction See Bullet/Demos/RollingFrictionDemo for an example

Definition at line 113 of file btCollisionShape.h.

References btVector3.

◆ getBoundingSphere()

void btCollisionShape::getBoundingSphere ( btVector3 & center,
btScalar & radius ) const
virtual

Definition at line 30 of file btCollisionShape.cpp.

References btTransform, btVector3, getAabb(), and length().

Referenced by getAngularMotionDisc().

◆ getContactBreakingThreshold()

btScalar btCollisionShape::getContactBreakingThreshold ( btScalar defaultContactThresholdFactor) const
virtual

Definition at line 42 of file btCollisionShape.cpp.

References getAngularMotionDisc().

◆ getLocalScaling()

virtual const btVector3 & getLocalScaling ( ) const
pure virtual

Definition at line 126 of file btCompoundShape.h.

References btVector3, and m_localScaling.

Referenced by setOptimizedBvh().

◆ getMargin()

◆ getName()

virtual const char * getName ( ) const
pure virtual

◆ getShapeType()

◆ getUserIndex()

int getUserIndex ( ) const

Definition at line 135 of file btCollisionShape.h.

References m_userIndex.

◆ getUserPointer()

void * getUserPointer ( ) const

Definition at line 126 of file btCollisionShape.h.

References m_userPointer.

◆ isCompound()

SIMD_FORCE_INLINE bool isCompound ( ) const

Definition at line 81 of file btCollisionShape.h.

References getShapeType(), and SIMD_FORCE_INLINE.

◆ isConcave()

SIMD_FORCE_INLINE bool isConcave ( ) const

Definition at line 77 of file btCollisionShape.h.

References getShapeType(), and SIMD_FORCE_INLINE.

Referenced by isNonMoving().

◆ isConvex()

SIMD_FORCE_INLINE bool isConvex ( ) const

Definition at line 69 of file btCollisionShape.h.

References getShapeType(), and SIMD_FORCE_INLINE.

◆ isConvex2d()

SIMD_FORCE_INLINE bool isConvex2d ( ) const

Definition at line 64 of file btCollisionShape.h.

References getShapeType(), and SIMD_FORCE_INLINE.

◆ isInfinite()

SIMD_FORCE_INLINE bool isInfinite ( ) const

isInfinite is used to catch simulation error (aabb check)

Definition at line 92 of file btCollisionShape.h.

References getShapeType(), and SIMD_FORCE_INLINE.

◆ isNonMoving()

SIMD_FORCE_INLINE bool isNonMoving ( ) const

Definition at line 73 of file btCollisionShape.h.

References getShapeType(), and SIMD_FORCE_INLINE.

◆ isPolyhedral()

SIMD_FORCE_INLINE bool isPolyhedral ( ) const

Definition at line 59 of file btCollisionShape.h.

References getShapeType(), and SIMD_FORCE_INLINE.

◆ isSoftBody()

SIMD_FORCE_INLINE bool isSoftBody ( ) const

Definition at line 86 of file btCollisionShape.h.

References getShapeType(), and SIMD_FORCE_INLINE.

◆ serialize()

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

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

◆ serializeSingleShape()

void btCollisionShape::serializeSingleShape ( btSerializer * serializer) const
virtual

◆ setLocalScaling()

virtual void setLocalScaling ( const btVector3 & scaling)
pure virtual

Definition at line 120 of file btBox2dShape.h.

◆ setMargin()

virtual void setMargin ( btScalar margin)
pure virtual

Definition at line 110 of file btBox2dShape.h.

References btVector3, getMargin(), m_collisionMargin, and m_implicitShapeDimensions.

Referenced by setSafeMargin().

◆ setUserIndex()

void setUserIndex ( int index)

Definition at line 130 of file btCollisionShape.h.

References m_userIndex.

◆ setUserPointer()

void setUserPointer ( void * userPtr)

optional user data pointer

Definition at line 121 of file btCollisionShape.h.

References m_userPointer.

◆ ~btCollisionShape()

virtual ~btCollisionShape ( )
virtual

Definition at line 41 of file btCollisionShape.h.

Variable Documentation

◆ btCollisionShape

btCollisionShape
Initial value:
{
protected:
int m_shapeType

The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.

Definition at line 27 of file btCollisionShape.h.

Referenced by addChildShape(), btGImpactCompoundShape::addChildShape(), btGImpactCompoundShape::addChildShape(), btSoftBody::appendDeformableAnchor(), btSoftBody::appendDeformableAnchor(), btCollisionObjectWrapper::btCollisionObjectWrapper(), btCollisionObjectWrapper::btCollisionObjectWrapper(), btRigidBody::btRigidBody(), btRigidBody::btRigidBodyConstructionInfo::btRigidBodyConstructionInfo(), btTriIndex::btTriIndex(), btSoftBody::checkContact(), btSoftBody::checkDeformableContact(), btSoftBody::checkDeformableFaceContact(), btCollisionWorldImporter::convertAllObjects(), btCollisionWorldImporter::convertCollisionShape(), btGImpactCollisionAlgorithm::convex_vs_convex_collision(), btCollisionWorldImporter::createBoxShape(), btCollisionWorldImporter::createCapsuleShapeX(), btCollisionWorldImporter::createCapsuleShapeY(), btCollisionWorldImporter::createCapsuleShapeZ(), btCollisionWorldImporter::createCollisionObject(), btCollisionWorldImporter::createConeShapeX(), btCollisionWorldImporter::createConeShapeY(), btCollisionWorldImporter::createConeShapeZ(), btCollisionWorldImporter::createConvexTriangleMeshShape(), btCollisionWorldImporter::createCylinderShapeX(), btCollisionWorldImporter::createCylinderShapeY(), btCollisionWorldImporter::createCylinderShapeZ(), btCollisionWorldImporter::createPlaneShape(), btCollisionWorldImporter::createSphereShape(), btCollisionWorld::debugDrawObject(), btSparseSdf< CELLSIZE >::DistanceToShape(), btSparseSdf< CELLSIZE >::Evaluate(), btGImpactCompoundShape::CompoundPrimitiveManager::get_primitive_box(), btGImpactCompoundShape::getChildShape(), btGImpactCompoundShape::getChildShape(), btGImpactMeshShape::getChildShape(), btGImpactMeshShape::getChildShape(), btGImpactMeshShapePart::getChildShape(), btGImpactMeshShapePart::getChildShape(), btGImpactShapeInterface::getChildShape(), btGImpactShapeInterface::getChildShape(), getChildShape(), GIM_ShapeRetriever::ChildShapeRetriever::getChildShape(), GIM_ShapeRetriever::getChildShape(), GIM_ShapeRetriever::TetraShapeRetriever::getChildShape(), GIM_ShapeRetriever::TriangleShapeRetriever::getChildShape(), btCollisionObjectWrapper::getCollisionShape(), btRigidBody::getCollisionShape(), btRigidBody::getCollisionShape(), getCollisionShape(), btCollisionWorldImporter::getCollisionShapeByIndex(), btCollisionWorldImporter::getCollisionShapeByName(), btGImpactCollisionAlgorithm::gimpact_vs_compoundshape(), btGImpactCollisionAlgorithm::gimpact_vs_gimpact(), btGImpactCollisionAlgorithm::gimpact_vs_shape(), btGImpactCollisionAlgorithm::gimpact_vs_shape_find_pairs(), btSparseSdf< CELLSIZE >::Hash(), btDeformableMultiBodyDynamicsWorld::integrateTransforms(), btCollisionWorld::objectQuerySingle(), btCollisionWorld::objectQuerySingleInternal(), btCompoundCollisionAlgorithm::preallocateChildAlgorithms(), btCompoundCompoundLeafCallback::Process(), btCompoundLeafCallback::Process(), btCompoundLeafCallback::ProcessChildShape(), btCompoundCollisionAlgorithm::processCollision(), btCompoundCompoundCollisionAlgorithm::processCollision(), btSoftBodyTriangleCallback::processTriangle(), btCollisionWorld::rayTestSingle(), btDeformableMultiBodyDynamicsWorld::rayTestSingle(), btSoftMultiBodyDynamicsWorld::rayTestSingle(), btSoftRigidDynamicsWorld::rayTestSingle(), btCollisionWorld::rayTestSingleInternal(), RB_body_get_scale(), RB_body_set_mass(), RB_body_set_scale(), RB_world_convex_sweep_test(), removeChildShape(), btSparseSdf< CELLSIZE >::RemoveReferences(), btCollisionWorld::serializeCollisionObjects(), btSoftBody::setCollisionShape(), setCollisionShape(), btGImpactShapeInterface::setMargin(), and btGImpactCollisionAlgorithm::shape_vs_shape_collision().

◆ m_userIndex

int m_userIndex

Definition at line 32 of file btCollisionShape.h.

◆ m_userPointer