Bullet Collision Detection & Physics Library: btCollisionShape Class Reference

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes | List of all members
btCollisionShape Class Referenceabstract

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

`#include <btCollisionShape.h>`

Inheritance diagram for btCollisionShape:
[legend]

## Public Member Functions
| 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.
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
| calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep) result is conservative
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)
virtual void | setLocalScaling (const btVector3 &scaling)=0
virtual const btVector3 & | getLocalScaling () 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
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
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)
virtual void | serializeSingleShape (btSerializer *serializer) const

## Protected Attributes
int | m_shapeType
void * | m_userPointer
int | m_userIndex
int | m_userIndex2

## Detailed Description

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

Definition at line 26 of file btCollisionShape.h.

## Constructor & Destructor Documentation

## ◆ btCollisionShape()

btCollisionShape::btCollisionShape | ( |  | ) |
| inline

Definition at line 38 of file btCollisionShape.h.

## ◆ ~btCollisionShape()

virtual btCollisionShape::~btCollisionShape | ( |  | ) |
| inlinevirtual

Definition at line 42 of file btCollisionShape.h.

## Member Function Documentation

## ◆ BT_DECLARE_ALIGNED_ALLOCATOR()

btCollisionShape::BT_DECLARE_ALIGNED_ALLOCATOR | ( |  | ) |

## ◆ calculateLocalInertia()

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

Implemented in btBox2dShape, btBoxShape, btCapsuleShape, btCompoundShape, btConeShape, btConvex2dShape, btCylinderShape, btEmptyShape, btHeightfieldTerrainShape, btMinkowskiSumShape, btMultiSphereShape, btPolyhedralConvexShape, btScaledBvhTriangleMeshShape, btSdfCollisionShape, btSphereShape, btStaticPlaneShape, btTriangleMeshShape, btTriangleShape, btUniformScalingShape, btGImpactCompoundShape, btGImpactMeshShapePart, btGImpactMeshShape, btSoftClusterCollisionShape, and btSoftBodyCollisionShape.

## ◆ calculateSerializeBufferSize()

int btCollisionShape::calculateSerializeBufferSize | ( |  | ) | const
| inlinevirtual

Reimplemented in btBvhTriangleMeshShape, btCapsuleShape, btCompoundShape, btConeShape, btConvexHullShape, btConvexInternalShape, btCylinderShape, btMultiSphereShape, btScaledBvhTriangleMeshShape, btStaticPlaneShape, and btGImpactMeshShape.

Definition at line 169 of file btCollisionShape.h.

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

Definition at line 57 of file btCollisionShape.cpp.

## ◆ getAabb()

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

Implemented in btBox2dShape, btBoxShape, btCapsuleShape, btCompoundShape, btConvex2dShape, btConvexInternalShape, btConvexInternalAabbCachingShape, btCylinderShape, btEmptyShape, btHeightfieldTerrainShape, btPolyhedralConvexAabbCachingShape, btScaledBvhTriangleMeshShape, btSdfCollisionShape, btSphereShape, btStaticPlaneShape, btBU_Simplex1to4, btTriangleMeshShape, btTriangleShape, btUniformScalingShape, btGImpactShapeInterface, btTriangleShapeEx, btSoftBodyCollisionShape, btSoftClusterCollisionShape, and btConvexShape.

## ◆ getAngularMotionDisc()

btScalar btCollisionShape::getAngularMotionDisc | ( |  | ) | const
| virtual

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

Definition at line 47 of file btCollisionShape.cpp.

## ◆ getAnisotropicRollingFrictionDirection()

virtual btVector3 btCollisionShape::getAnisotropicRollingFrictionDirection | ( |  | ) | const
| inlinevirtual

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

Reimplemented in btCapsuleShape, btConeShape, btConeShapeX, btConeShapeZ, and btCylinderShape.

Definition at line 114 of file btCollisionShape.h.

## ◆ getBoundingSphere()

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

Definition at line 30 of file btCollisionShape.cpp.

## ◆ getContactBreakingThreshold()

btScalar btCollisionShape::getContactBreakingThreshold | ( | btScalar | defaultContactThresholdFactor | ) | const
| virtual

Definition at line 42 of file btCollisionShape.cpp.

## ◆ getLocalScaling()

virtual const btVector3 & btCollisionShape::getLocalScaling | ( |  | ) | const
| pure virtual

Implemented in btCompoundShape, btConvex2dShape, btConvexInternalShape, btConvexTriangleMeshShape, btEmptyShape, btHeightfieldTerrainShape, btScaledBvhTriangleMeshShape, btSdfCollisionShape, btStaticPlaneShape, btTriangleMeshShape, btUniformScalingShape, btGImpactShapeInterface, btGImpactMeshShapePart, btSoftBodyCollisionShape, and btConvexShape.

## ◆ getMargin()

virtual btScalar btCollisionShape::getMargin | ( |  | ) | const
| pure virtual

Implemented in btCompoundShape, btConcaveShape, btConvex2dShape, btConvexInternalShape, btMinkowskiSumShape, btSdfCollisionShape, btSphereShape, btUniformScalingShape, btGImpactMeshShapePart, btSoftClusterCollisionShape, and btConvexShape.

## ◆ getName()

virtual const char * btCollisionShape::getName | ( |  | ) | const
| pure virtual

Implemented in btBox2dShape, btBoxShape, btBvhTriangleMeshShape, btCapsuleShape, btCapsuleShapeX, btCapsuleShapeZ, btCompoundShape, btConeShape, btConeShapeX, btConeShapeZ, btConvex2dShape, btConvexHullShape, btConvexPointCloudShape, btConvexTriangleMeshShape, btCylinderShape, btCylinderShapeX, btCylinderShapeZ, btEmptyShape, btHeightfieldTerrainShape, btMinkowskiSumShape, btMultimaterialTriangleMeshShape, btMultiSphereShape, btScaledBvhTriangleMeshShape, btSdfCollisionShape, btSphereShape, btStaticPlaneShape, btBU_Simplex1to4, btTriangleMeshShape, btTriangleShape, btUniformScalingShape, btGImpactCompoundShape, btGImpactMeshShapePart, btGImpactMeshShape, btSoftBodyCollisionShape, and btSoftClusterCollisionShape.

## ◆ getShapeType()

int btCollisionShape::getShapeType | ( |  | ) | const
| inline

Definition at line 107 of file btCollisionShape.h.

## ◆ getUserIndex()

int btCollisionShape::getUserIndex | ( |  | ) | const
| inline

Definition at line 136 of file btCollisionShape.h.

## ◆ getUserIndex2()

int btCollisionShape::getUserIndex2 | ( |  | ) | const
| inline

Definition at line 146 of file btCollisionShape.h.

## ◆ getUserPointer()

void * btCollisionShape::getUserPointer | ( |  | ) | const
| inline

Definition at line 127 of file btCollisionShape.h.

## ◆ isCompound()

bool btCollisionShape::isCompound | ( |  | ) | const
| inline

Definition at line 82 of file btCollisionShape.h.

## ◆ isConcave()

bool btCollisionShape::isConcave | ( |  | ) | const
| inline

Definition at line 78 of file btCollisionShape.h.

## ◆ isConvex()

bool btCollisionShape::isConvex | ( |  | ) | const
| inline

Definition at line 70 of file btCollisionShape.h.

## ◆ isConvex2d()

bool btCollisionShape::isConvex2d | ( |  | ) | const
| inline

Definition at line 65 of file btCollisionShape.h.

## ◆ isInfinite()

bool btCollisionShape::isInfinite | ( |  | ) | const
| inline

isInfinite is used to catch simulation error (aabb check)

Definition at line 93 of file btCollisionShape.h.

## ◆ isNonMoving()

bool btCollisionShape::isNonMoving | ( |  | ) | const
| inline

Definition at line 74 of file btCollisionShape.h.

## ◆ isPolyhedral()

bool btCollisionShape::isPolyhedral | ( |  | ) | const
| inline

Definition at line 60 of file btCollisionShape.h.

## ◆ isSoftBody()

bool btCollisionShape::isSoftBody | ( |  | ) | const
| inline

Definition at line 87 of file btCollisionShape.h.

## ◆ serialize()

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

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

Reimplemented in btBvhTriangleMeshShape, btCapsuleShape, btCompoundShape, btConeShape, btConvexHullShape, btConvexInternalShape, btCylinderShape, btMultiSphereShape, btScaledBvhTriangleMeshShape, btStaticPlaneShape, and btGImpactMeshShape.

Definition at line 96 of file btCollisionShape.cpp.

## ◆ serializeSingleShape()

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

Definition at line 113 of file btCollisionShape.cpp.

## ◆ setLocalScaling()

virtual void btCollisionShape::setLocalScaling | ( | const btVector3 & | scaling | ) |
| pure virtual

Implemented in btSoftBodyCollisionShape, btBox2dShape, btBoxShape, btBvhTriangleMeshShape, btCapsuleShape, btCompoundShape, btConeShape, btConvex2dShape, btConvexHullShape, btConvexInternalShape, btConvexInternalAabbCachingShape, btConvexPointCloudShape, btConvexTriangleMeshShape, btCylinderShape, btEmptyShape, btHeightfieldTerrainShape, btPolyhedralConvexAabbCachingShape, btScaledBvhTriangleMeshShape, btSdfCollisionShape, btStaticPlaneShape, btTriangleMeshShape, btUniformScalingShape, btGImpactShapeInterface, btGImpactMeshShapePart, btGImpactMeshShape, and btConvexShape.

## ◆ setMargin()

virtual void btCollisionShape::setMargin | ( | btScalar | margin | ) |
| pure virtual

Implemented in btBox2dShape, btBoxShape, btCapsuleShape, btConcaveShape, btCylinderShape, btCompoundShape, btConvex2dShape, btConvexInternalShape, btSdfCollisionShape, btSphereShape, btUniformScalingShape, btGImpactShapeInterface, btGImpactMeshShapePart, btGImpactMeshShape, btSoftClusterCollisionShape, and btConvexShape.

## ◆ setUserIndex()

void btCollisionShape::setUserIndex | ( | int | index | ) |
| inline

Definition at line 131 of file btCollisionShape.h.

## ◆ setUserIndex2()

void btCollisionShape::setUserIndex2 | ( | int | index | ) |
| inline

Definition at line 141 of file btCollisionShape.h.

## ◆ setUserPointer()

void btCollisionShape::setUserPointer | ( | void * | userPtr | ) |
| inline

optional user data pointer

Definition at line 122 of file btCollisionShape.h.

## Member Data Documentation

## ◆ m_shapeType

int btCollisionShape::m_shapeType
| protected

Definition at line 30 of file btCollisionShape.h.

## ◆ m_userIndex

int btCollisionShape::m_userIndex
| protected

Definition at line 32 of file btCollisionShape.h.

## ◆ m_userIndex2

int btCollisionShape::m_userIndex2
| protected

Definition at line 33 of file btCollisionShape.h.

## ◆ m_userPointer

void* btCollisionShape::m_userPointer
| protected

Definition at line 31 of file btCollisionShape.h.

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

- btCollisionShape.h
- btCollisionShape.cpp