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];
bool operator==(const AssetWeakReference &a, const AssetWeakReference &b)
virtual void setLocalScaling(const btVector3 &scaling)
virtual const char * getName() const
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
virtual void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
virtual void setMargin(btScalar collisionMargin)
int m_updateRevision
internal update revision number. It will be increased when the object changes. This allows some subsy...
virtual const btVector3 & getLocalScaling() const =0
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
virtual btScalar getMargin() const =0
btCompoundShapeChild * getChildList()
btCompoundShape(bool enableDynamicAabbTree=true, const int initialChildCapacity=0)
int getNumChildShapes() const
btTransform & getChildTransform(int index)
int getUpdateRevision() const
void calculatePrincipalAxisTransform(const btScalar *masses, btTransform &principal, btVector3 &inertia) const
btCollisionShape * m_childShape
void createAabbTreeFromChildren()
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 void removeChildShape(btCollisionShape *shape)
Remove all children shapes that contain the specified shape.
btCollisionShape * getChildShape(int index)
struct btDbvtNode * m_node
void removeChildShapeByIndex(int childShapeindex)
btScalar m_collisionMargin
btDbvt * m_dynamicAabbTree
virtual void recalculateLocalAabb()
const btDbvt * getDynamicAabbTree() const
void addChildShape(const btTransform &localTransform, btCollisionShape *shape)
unsigned calculateSerializeBufferSize() const
virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const
Data buffer MUST be 16 byte aligned.
#define BT_DECLARE_ALIGNED_ALLOCATOR()
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