Blender
V3.3
|
#include "btCollisionShape.h"
#include "LinearMath/btVector3.h"
#include "LinearMath/btTransform.h"
#include "LinearMath/btMatrix3x3.h"
#include "btCollisionMargin.h"
#include "LinearMath/btAlignedObjectArray.h"
Go to the source code of this file.
Classes | |
struct | btCompoundShapeChildData |
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 More... | |
struct | btCompoundShapeData |
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 More... | |
Functions | |
SIMD_FORCE_INLINE bool | operator== (const btCompoundShapeChild &c1, const btCompoundShapeChild &c2) |
BT_DECLARE_ALIGNED_ALLOCATOR () | |
btCompoundShape (bool enableDynamicAabbTree=true, const int initialChildCapacity=0) | |
virtual | ~btCompoundShape () |
void | addChildShape (const btTransform &localTransform, btCollisionShape *shape) |
virtual void | removeChildShape (btCollisionShape *shape) |
Remove all children shapes that contain the specified shape. More... | |
void | removeChildShapeByIndex (int childShapeindex) |
int | getNumChildShapes () const |
btCollisionShape * | getChildShape (int index) |
btTransform & | getChildTransform (int index) |
void | updateChildTransform (int childIndex, const btTransform &newChildTransform, bool shouldRecalculateLocalAabb=true) |
set a new transform for a child, and update internal data structures (local aabb and dynamic tree) More... | |
btCompoundShapeChild * | getChildList () |
virtual void | getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const |
getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version More... | |
virtual void | recalculateLocalAabb () |
virtual void | setLocalScaling (const btVector3 &scaling) |
virtual const btVector3 & | getLocalScaling () const |
virtual void | calculateLocalInertia (btScalar mass, btVector3 &inertia) const |
CollisionShape Interface. More... | |
virtual void | setMargin (btScalar margin) |
virtual btScalar | getMargin () const |
virtual const char * | getName () const |
const btDbvt * | getDynamicAabbTree () const |
void | createAabbTreeFromChildren () |
void | calculatePrincipalAxisTransform (const btScalar *masses, btTransform &principal, btVector3 &inertia) const |
int | getUpdateRevision () 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) More... | |
Variables | |
btCompoundShapeChild | |
btTransform | m_transform |
btCollisionShape * | m_childShape |
int | m_childShapeType |
btScalar | m_childMargin |
struct btDbvtNode * | m_node |
btCompoundShape | __pad0__ |
btVector3 | m_localAabbMin |
btVector3 | m_localAabbMax |
btDbvt * | m_dynamicAabbTree |
int | m_updateRevision |
increment m_updateRevision when adding/removing/replacing child shapes, so that some caches can be updated More... | |
btScalar | m_collisionMargin |
btVector3 | m_localScaling |
void addChildShape | ( | const btTransform & | localTransform, |
btCollisionShape * | shape | ||
) |
BT_DECLARE_ALIGNED_ALLOCATOR | ( | ) |
|
explicit |
Definition at line 21 of file btCompoundShape.cpp.
References btAlignedAlloc, btAssert, COMPOUND_SHAPE_PROXYTYPE, and m_dynamicAabbTree.
Referenced by btCompoundCollisionAlgorithm::btCompoundCollisionAlgorithm(), btCompoundCompoundCollisionAlgorithm::btCompoundCompoundCollisionAlgorithm(), btCreateCompoundFromGimpactShape(), btCompoundCollisionAlgorithm::calculateTimeOfImpact(), btCollisionWorldImporter::convertCollisionShape(), btCollisionWorldImporter::createCompoundShape(), btCollisionWorld::debugDrawObject(), btGImpactCollisionAlgorithm::gimpact_vs_shape(), btCollisionWorld::objectQuerySingleInternal(), btCompoundCollisionAlgorithm::preallocateChildAlgorithms(), btCompoundLeafCallback::Process(), btCompoundCompoundLeafCallback::Process(), btCompoundLeafCallback::ProcessChildShape(), btCompoundCollisionAlgorithm::processCollision(), btCompoundCompoundCollisionAlgorithm::processCollision(), btCollisionWorld::rayTestSingleInternal(), RB_compound_add_child_shape(), and RB_shape_new_compound().
CollisionShape Interface.
Definition at line 54 of file btConeShape.h.
void btCompoundShape::calculatePrincipalAxisTransform | ( | const btScalar * | masses, |
btTransform & | principal, | ||
btVector3 & | inertia | ||
) | const |
computes the exact moment of inertia and the transform from the coordinate system defined by the principal axes of the moment of inertia and the center of mass to the current coordinate system. "masses" points to an array of masses of the children. The resulting transform "principal" has to be applied inversely to all children transforms in order for the local coordinate system of the compound shape to be centered at the center of mass and to coincide with the principal axes. This also necessitates a correction of the world transform of the collision object by the principal transform.
Definition at line 202 of file btCompoundShape.cpp.
References btAssert, btMatrix3x3, btTransform, btVector3, center, and t.
|
virtual |
void btCompoundShape::createAabbTreeFromChildren | ( | ) |
Definition at line 279 of file btCompoundShape.cpp.
References bounds(), btAlignedAlloc, btAssert, btCompoundShapeChild, btVector3, btDbvtAabbMm::FromMM(), btDbvt::insert(), and m_dynamicAabbTree.
|
virtual |
getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
Definition at line 54 of file btCapsuleShape.h.
btCompoundShapeChild* getChildList | ( | ) |
Definition at line 112 of file btCompoundShape.h.
const btCollisionShape * getChildShape | ( | int | index | ) |
Definition at line 91 of file btCompoundShape.h.
Referenced by btAdjustInternalEdgeContacts().
const btTransform & getChildTransform | ( | int | index | ) |
Definition at line 100 of file btCompoundShape.h.
btDbvt * getDynamicAabbTree | ( | ) | const |
Definition at line 146 of file btCompoundShape.h.
References m_dynamicAabbTree.
|
virtual |
Definition at line 126 of file btCompoundShape.h.
|
virtual |
Definition at line 137 of file btCompoundShape.h.
|
virtual |
Definition at line 141 of file btCompoundShape.h.
int getNumChildShapes | ( | ) | const |
Definition at line 86 of file btCompoundShape.h.
References btAlignedObjectArray< T >::size().
Referenced by btCompoundCompoundLeafCallback::Process(), and btCompoundLeafCallback::ProcessChildShape().
int getUpdateRevision | ( | ) | const |
Definition at line 165 of file btCompoundShape.h.
References m_updateRevision.
SIMD_FORCE_INLINE bool operator== | ( | const btCompoundShapeChild & | c1, |
const btCompoundShapeChild & | c2 | ||
) |
Definition at line 42 of file btCompoundShape.h.
|
virtual |
Re-calculate the local Aabb. Is called at the end of removeChildShapes. Use this yourself if you modify the children or their transforms.
Definition at line 137 of file btCompoundShape.cpp.
References BT_LARGE_FLOAT, btVector3, m_localAabbMax, m_localAabbMin, and m_transform.
Referenced by addPoint(), removeChildShape(), and updateChildTransform().
|
virtual |
Remove all children shapes that contain the specified shape.
Definition at line 121 of file btCompoundShape.cpp.
References m_childShape, m_updateRevision, recalculateLocalAabb(), and removeChildShapeByIndex().
void btCompoundShape::removeChildShapeByIndex | ( | int | childShapeindex | ) |
Definition at line 107 of file btCompoundShape.cpp.
References btAssert, m_dynamicAabbTree, m_node, m_updateRevision, and btDbvt::remove().
Referenced by removeChildShape().
|
virtual |
fills the dataBuffer and returns the struct name (and 0 on failure)
Definition at line 120 of file btBox2dShape.h.
Definition at line 133 of file btCompoundShape.h.
References m_collisionMargin.
void btCompoundShape::updateChildTransform | ( | int | childIndex, |
const btTransform & | newChildTransform, | ||
bool | shouldRecalculateLocalAabb = true |
||
) |
set a new transform for a child, and update internal data structures (local aabb and dynamic tree)
update the dynamic aabb tree
Definition at line 86 of file btCompoundShape.cpp.
References ATTRIBUTE_ALIGNED16, bounds(), btVector3, btDbvtAabbMm::FromMM(), m_dynamicAabbTree, m_node, recalculateLocalAabb(), and btDbvt::update().
|
virtual |
Definition at line 41 of file btCompoundShape.cpp.
References btAlignedFree, m_dynamicAabbTree, and btDbvt::~btDbvt().
btCompoundShape __pad0__ |
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave collision objects. This is more general then the static concave btBvhTriangleMeshShape. It has an (optional) dynamic aabb tree to accelerate early rejection tests.
Definition at line 56 of file btCompoundShape.h.
btCompoundShapeChild |
Definition at line 31 of file btCompoundShape.h.
Referenced by createAabbTreeFromChildren().
btScalar m_childMargin |
Definition at line 38 of file btCompoundShape.h.
btCollisionShape* m_childShape |
Definition at line 36 of file btCompoundShape.h.
Referenced by removeChildShape().
int m_childShapeType |
Definition at line 37 of file btCompoundShape.h.
btScalar m_collisionMargin |
Definition at line 68 of file btCompoundShape.h.
Referenced by btCapsuleShape(), btCapsuleShapeX::btCapsuleShapeX(), btCapsuleShapeZ::btCapsuleShapeZ(), btSphereShape(), btTriangleShapeEx::getAabb(), getMargin(), btGImpactMeshShape::serialize(), setLocalScaling(), setMargin(), btGImpactShapeInterface::setMargin(), and btGImpactMeshShape::setMargin().
btDbvt* m_dynamicAabbTree |
Definition at line 63 of file btCompoundShape.h.
Referenced by btCompoundShape(), createAabbTreeFromChildren(), getDynamicAabbTree(), removeChildShapeByIndex(), updateChildTransform(), and ~btCompoundShape().
btVector3 m_localAabbMax |
Definition at line 61 of file btCompoundShape.h.
Referenced by btTriangleMeshShape(), buildOptimizedBvh(), btConvexInternalAabbCachingShape::getCachedLocalAabb(), btPolyhedralConvexAabbCachingShape::getCachedLocalAabb(), btConvexInternalAabbCachingShape::getNonvirtualAabb(), btPolyhedralConvexAabbCachingShape::getNonvirtualAabb(), partialRefitTree(), quantizeWithClamp(), recalculateLocalAabb(), btConvexInternalAabbCachingShape::setCachedLocalAabb(), and btPolyhedralConvexAabbCachingShape::setCachedLocalAabb().
btVector3 m_localAabbMin |
Definition at line 60 of file btCompoundShape.h.
Referenced by btTriangleMeshShape(), buildOptimizedBvh(), btConvexInternalAabbCachingShape::getCachedLocalAabb(), btPolyhedralConvexAabbCachingShape::getCachedLocalAabb(), getLocalAabbMin(), btConvexInternalAabbCachingShape::getNonvirtualAabb(), btPolyhedralConvexAabbCachingShape::getNonvirtualAabb(), partialRefitTree(), quantizeWithClamp(), recalculateLocalAabb(), btConvexInternalAabbCachingShape::setCachedLocalAabb(), and btPolyhedralConvexAabbCachingShape::setCachedLocalAabb().
btVector3 m_localScaling |
Definition at line 70 of file btCompoundShape.h.
Referenced by btBox2dShape(), btBoxShape(), btConvexPointCloudShape(), btCylinderShape(), btScaledTriangleCallback::btScaledTriangleCallback(), btSphereShape(), getLocalScaling(), getLocalScalingNV(), getRadius(), getScaledPoint(), btScaledTriangleCallback::processTriangle(), setLocalScaling(), and setPoints().
struct btDbvtNode* m_node |
Definition at line 39 of file btCompoundShape.h.
Referenced by btSoftBody::indicesToPointers(), btSoftBody::pointersToIndices(), removeChildShapeByIndex(), and updateChildTransform().
btTransform m_transform |
Definition at line 35 of file btCompoundShape.h.
Referenced by recalculateLocalAabb().
int m_updateRevision |
increment m_updateRevision when adding/removing/replacing child shapes, so that some caches can be updated
Definition at line 66 of file btCompoundShape.h.
Referenced by getUpdateRevision().