Blender V4.3
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
 CollisionShape Interface.
 
virtual const char * getName () const =0
 getName is for debugging
 
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

CollisionShape Interface.

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 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.

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 getBoundingSphere(), and length().

Referenced by 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, 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 m_localScaling.

Referenced by setOptimizedBvh().

◆ getMargin()

◆ getName()

virtual const char * getName ( ) const
pure virtual

getName is for debugging

Definition at line 301 of file btBox2dShape.h.

Referenced by MeshImporter::create_mesh_object(), and DocumentImporter::write_node().

◆ getShapeType()

int getShapeType ( ) const

◆ 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().

◆ isConcave()

SIMD_FORCE_INLINE bool isConcave ( ) const

Definition at line 77 of file btCollisionShape.h.

References getShapeType().

Referenced by isNonMoving().

◆ isConvex()

SIMD_FORCE_INLINE bool isConvex ( ) const

◆ isConvex2d()

SIMD_FORCE_INLINE bool isConvex2d ( ) const

Definition at line 64 of file btCollisionShape.h.

References getShapeType().

◆ 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().

◆ isNonMoving()

SIMD_FORCE_INLINE bool isNonMoving ( ) const

Definition at line 73 of file btCollisionShape.h.

References getShapeType().

◆ isPolyhedral()

SIMD_FORCE_INLINE bool isPolyhedral ( ) const

Definition at line 59 of file btCollisionShape.h.

References getShapeType().

◆ isSoftBody()

SIMD_FORCE_INLINE bool isSoftBody ( ) const

Definition at line 86 of file btCollisionShape.h.

References getShapeType().

◆ 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.

◆ 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

◆ m_userIndex

int m_userIndex

Definition at line 32 of file btCollisionShape.h.

Referenced by getUserIndex(), and setUserIndex().

◆ m_userPointer