Blender V2.61 - r43446
|
The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects. More...
#include <btCollisionShape.h>
Public Member Functions | |
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 ¢er, btScalar &radius) const |
virtual btScalar | getAngularMotionDisc () const |
getAngularMotionDisc returns the maximus 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 btVector3 & | getLocalScaling () const =0 |
virtual void | calculateLocalInertia (btScalar mass, btVector3 &inertia) const =0 |
virtual const char * | getName () const =0 |
int | getShapeType () const |
virtual void | setMargin (btScalar margin)=0 |
virtual btScalar | getMargin () const =0 |
void | setUserPointer (void *userPtr) |
optional user data pointer | |
void * | getUserPointer () 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 |
The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
Definition at line 27 of file btCollisionShape.h.
btCollisionShape::btCollisionShape | ( | ) | [inline] |
Definition at line 35 of file btCollisionShape.h.
virtual btCollisionShape::~btCollisionShape | ( | ) | [inline, virtual] |
Definition at line 39 of file btCollisionShape.h.
virtual void btCollisionShape::calculateLocalInertia | ( | btScalar | mass, |
btVector3 & | inertia | ||
) | const [pure virtual] |
Implemented in btEmptyShape, btHeightfieldTerrainShape, btTriangleMeshShape, btGImpactCompoundShape, btGImpactMeshShapePart, btGImpactMeshShape, and btSoftBodyCollisionShape.
Referenced by CcdPhysicsController::CcdPhysicsController(), plCreateRigidBody(), CcdPhysicsController::PostProcessReplica(), CcdPhysicsController::setScaling(), and CcdPhysicsEnvironment::updateCcdPhysicsController().
SIMD_FORCE_INLINE int btCollisionShape::calculateSerializeBufferSize | ( | ) | const [virtual] |
Reimplemented in btGImpactMeshShape.
Definition at line 142 of file btCollisionShape.h.
Referenced by serializeSingleShape().
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 60 of file btCollisionShape.cpp.
References getAabb(), and getAngularMotionDisc().
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 btEmptyShape, btHeightfieldTerrainShape, btTriangleMeshShape, btGImpactShapeInterface, and btSoftBodyCollisionShape.
Referenced by calculateTemporalAabb(), btGImpactCompoundShape::CompoundPrimitiveManager::get_primitive_box(), btRigidBody::getAabb(), getBoundingSphere(), btGImpactCollisionAlgorithm::gimpact_vs_shape_find_pairs(), btCompoundLeafCallback::ProcessChildShape(), btCompoundCollisionAlgorithm::processCollision(), and btConvexTriangleCallback::setTimeStepAndCounters().
btScalar btCollisionShape::getAngularMotionDisc | ( | ) | const [virtual] |
getAngularMotionDisc returns the maximus radius needed for Conservative Advancement to handle time-of-impact with rotations.
Definition at line 50 of file btCollisionShape.cpp.
References getBoundingSphere(), and length().
Referenced by calculateTemporalAabb(), and getContactBreakingThreshold().
void btCollisionShape::getBoundingSphere | ( | btVector3 & | center, |
btScalar & | radius | ||
) | const [virtual] |
Definition at line 32 of file btCollisionShape.cpp.
References getAabb(), length(), and btTransform::setIdentity().
Referenced by getAngularMotionDisc().
btScalar btCollisionShape::getContactBreakingThreshold | ( | btScalar | defaultContactThresholdFactor | ) | const [virtual] |
Definition at line 45 of file btCollisionShape.cpp.
References getAngularMotionDisc().
virtual const btVector3& btCollisionShape::getLocalScaling | ( | ) | const [pure virtual] |
Implemented in btEmptyShape, btHeightfieldTerrainShape, btTriangleMeshShape, btGImpactShapeInterface, btGImpactMeshShapePart, and btSoftBodyCollisionShape.
Referenced by GetHitTriangle().
virtual btScalar btCollisionShape::getMargin | ( | ) | const [pure virtual] |
Implemented in btConcaveShape, and btGImpactMeshShapePart.
Referenced by CcdPhysicsController::GetMargin().
virtual const char* btCollisionShape::getName | ( | ) | const [pure virtual] |
int btCollisionShape::getShapeType | ( | ) | const [inline] |
Reimplemented in btGImpactShapeInterface.
Definition at line 109 of file btCollisionShape.h.
References m_shapeType.
Referenced by CcdPhysicsController::CreateSoftbody(), btCollisionWorld::debugDrawObject(), DeleteBulletShape(), GetHitTriangle(), CcdPhysicsController::GetReplica(), btGImpactCollisionAlgorithm::gimpact_vs_shape(), isCompound(), isConcave(), isConvex(), isConvex2d(), isInfinite(), isNonMoving(), isPolyhedral(), isSoftBody(), btCollisionWorld::objectQuerySingle(), plAddChildShape(), plAddVertex(), btCollisionWorld::rayTestSingle(), and CcdPhysicsController::SetRadius().
void* btCollisionShape::getUserPointer | ( | ) | const [inline] |
Definition at line 120 of file btCollisionShape.h.
References m_userPointer.
SIMD_FORCE_INLINE bool btCollisionShape::isCompound | ( | ) | const [inline] |
Definition at line 82 of file btCollisionShape.h.
References getShapeType().
Referenced by CcdPhysicsController::DeleteControllerShape(), btGImpactCollisionAlgorithm::gimpact_vs_shape(), btCollisionWorld::objectQuerySingle(), CcdPhysicsEnvironment::rayTest(), and btCollisionWorld::rayTestSingle().
SIMD_FORCE_INLINE bool btCollisionShape::isConcave | ( | ) | const [inline] |
Definition at line 78 of file btCollisionShape.h.
References getShapeType().
Referenced by btCollisionWorld::debugDrawObject(), btGImpactCollisionAlgorithm::gimpact_vs_shape(), btCollisionWorld::objectQuerySingle(), and btCollisionWorld::rayTestSingle().
SIMD_FORCE_INLINE bool btCollisionShape::isConvex | ( | ) | const [inline] |
Definition at line 70 of file btCollisionShape.h.
References getShapeType().
Referenced by btGImpactCompoundShape::addChildShape(), btSparseSdf< 3 >::DistanceToShape(), btDiscreteDynamicsWorld::integrateTransforms(), btCollisionWorld::objectQuerySingle(), and btCollisionWorld::rayTestSingle().
SIMD_FORCE_INLINE bool btCollisionShape::isConvex2d | ( | ) | const [inline] |
Definition at line 65 of file btCollisionShape.h.
References getShapeType().
SIMD_FORCE_INLINE bool btCollisionShape::isInfinite | ( | ) | const [inline] |
isInfinite is used to catch simulation error (aabb check)
Definition at line 93 of file btCollisionShape.h.
References getShapeType().
SIMD_FORCE_INLINE bool btCollisionShape::isNonMoving | ( | ) | const [inline] |
Definition at line 74 of file btCollisionShape.h.
References getShapeType().
SIMD_FORCE_INLINE bool btCollisionShape::isPolyhedral | ( | ) | const [inline] |
Definition at line 60 of file btCollisionShape.h.
References getShapeType().
Referenced by btCollisionWorld::debugDrawObject().
SIMD_FORCE_INLINE bool btCollisionShape::isSoftBody | ( | ) | const [inline] |
Definition at line 87 of file btCollisionShape.h.
References getShapeType().
Referenced by CcdPhysicsEnvironment::rayTest(), and btSoftRigidDynamicsWorld::rayTestSingle().
const char * btCollisionShape::serialize | ( | void * | dataBuffer, |
btSerializer * | serializer | ||
) | const [virtual] |
fills the dataBuffer and returns the struct name (and 0 on failure)
Reimplemented in btGImpactMeshShape.
Definition at line 99 of file btCollisionShape.cpp.
References btSerializer::findNameForPointer(), btSerializer::getUniquePointer(), btCollisionShapeData::m_name, btCollisionShapeData::m_shapeType, m_shapeType, and btSerializer::serializeName().
Referenced by serializeSingleShape().
void btCollisionShape::serializeSingleShape | ( | btSerializer * | serializer | ) | const [virtual] |
Definition at line 113 of file btCollisionShape.cpp.
References btSerializer::allocate(), BT_SHAPE_CODE, calculateSerializeBufferSize(), btSerializer::finalizeChunk(), len(), btChunk::m_oldPtr, and serialize().
Referenced by btCollisionWorld::serializeCollisionObjects().
virtual void btCollisionShape::setLocalScaling | ( | const btVector3 & | scaling | ) | [pure virtual] |
Implemented in btEmptyShape, btHeightfieldTerrainShape, btTriangleMeshShape, btGImpactShapeInterface, btGImpactMeshShapePart, btGImpactMeshShape, and btSoftBodyCollisionShape.
Referenced by CcdPhysicsController::CcdPhysicsController(), CcdShapeConstructionInfo::CreateBulletShape(), plSetScaling(), CcdPhysicsController::PostProcessReplica(), and CcdPhysicsController::SynchronizeMotionStates().
virtual void btCollisionShape::setMargin | ( | btScalar | margin | ) | [pure virtual] |
Implemented in btConcaveShape, btGImpactShapeInterface, btGImpactMeshShapePart, and btGImpactMeshShape.
Referenced by CcdShapeConstructionInfo::CreateBulletShape(), btGImpactShapeInterface::setMargin(), and CcdPhysicsController::SetMargin().
void btCollisionShape::setUserPointer | ( | void * | userPtr | ) | [inline] |
optional user data pointer
Definition at line 115 of file btCollisionShape.h.
References m_userPointer.
Referenced by btSoftBodyTriangleCallback::processTriangle().
int btCollisionShape::m_shapeType [protected] |
Definition at line 30 of file btCollisionShape.h.
Referenced by btEmptyShape::btEmptyShape(), btGImpactShapeInterface::btGImpactShapeInterface(), btSoftBodyCollisionShape::btSoftBodyCollisionShape(), btTriangleMeshShape::btTriangleMeshShape(), getShapeType(), and serialize().
void* btCollisionShape::m_userPointer [protected] |
Definition at line 31 of file btCollisionShape.h.
Referenced by getUserPointer(), and setUserPointer().