16#ifndef BT_COMPOUND_SHAPE_H
17#define BT_COMPOUND_SHAPE_H
44 return (c1.m_transform == c2.m_transform &&
45 c1.m_childShape == c2.m_childShape &&
46 c1.m_childShapeType == c2.m_childShapeType &&
47 c1.m_childMargin == c2.m_childMargin);
75 explicit btCompoundShape(
bool enableDynamicAabbTree =
true,
const int initialChildCapacity = 0);
88 return int(m_children.
size());
93 return m_children[index].m_childShape;
97 return m_children[index].m_childShape;
102 return m_children[index].m_transform;
106 return m_children[index].m_transform;
114 return &m_children[0];
int m_updateRevision
internal update revision number. It will be increased when the object changes. This allows some subsy...
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
virtual void setLocalScaling(const btVector3 &scaling)
btCompoundShapeChild * getChildList()
BT_DECLARE_ALIGNED_ALLOCATOR()
btCompoundShape(bool enableDynamicAabbTree=true, const int initialChildCapacity=0)
virtual btScalar getMargin() const
int getNumChildShapes() const
btTransform & getChildTransform(int index)
virtual int calculateSerializeBufferSize() const
virtual void setMargin(btScalar margin)
int getUpdateRevision() const
void calculatePrincipalAxisTransform(const btScalar *masses, btTransform &principal, btVector3 &inertia) const
virtual const char * getName() const
btCollisionShape * m_childShape
void createAabbTreeFromChildren()
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
CollisionShape Interface.
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)
virtual ~btCompoundShape()
virtual void removeChildShape(btCollisionShape *shape)
Remove all children shapes that contain the specified shape.
struct btDbvtNode * m_node
void removeChildShapeByIndex(int childShapeindex)
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 dedicat...
btScalar m_collisionMargin
virtual const btVector3 & getLocalScaling() const
btDbvt * m_dynamicAabbTree
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
virtual void recalculateLocalAabb()
const btDbvt * getDynamicAabbTree() const
SIMD_FORCE_INLINE bool operator==(const btCompoundShapeChild &c1, const btCompoundShapeChild &c2)
void addChildShape(const btTransform &localTransform, btCollisionShape *shape)
btConvexShape * getChildShape()
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
#define SIMD_FORCE_INLINE
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTransformFloatData m_transform
btCollisionShapeData * m_childShape
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btCompoundShapeChildData * m_childShapePtr
btCollisionShapeData m_collisionShapeData