Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
16 #ifndef BT_CAPSULE_SHAPE_H
17 #define BT_CAPSULE_SHAPE_H
46 virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(
const btVector3* vectors,
btVector3* supportVerticesOut,
int numVectors)
const;
51 (void)collisionMargin;
56 btVector3 halfExtents(getRadius(), getRadius(), getRadius());
57 halfExtents[m_upAxis] = getRadius() + getHalfHeight();
60 btVector3 extent = halfExtents.
dot3(abs_b[0], abs_b[1], abs_b[2]);
62 aabbMin = center - extent;
63 aabbMax = center + extent;
68 return "CapsuleShape";
78 int radiusAxis = (m_upAxis + 2) % 3;
79 return m_implicitShapeDimensions[radiusAxis];
84 return m_implicitShapeDimensions[m_upAxis];
89 btVector3 unScaledImplicitShapeDimensions = m_implicitShapeDimensions / m_localScaling;
91 m_implicitShapeDimensions = (unScaledImplicitShapeDimensions * scaling);
93 int radiusAxis = (m_upAxis + 2) % 3;
94 m_collisionMargin = m_implicitShapeDimensions[radiusAxis];
100 aniDir[getUpAxis()] = 1;
104 virtual int calculateSerializeBufferSize()
const;
107 virtual const char* serialize(
void* dataBuffer,
btSerializer* serializer)
const;
170 return "btCapsuleShapeData";
182 #endif //BT_CAPSULE_SHAPE_H
virtual const char * getName() const
btScalar m_collisionMargin
btVector3 dot3(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2) const
The btConvexInternalShape is an internal base class, shared by most convex shape implementations.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btCapsuleShape()
only used for btCapsuleShapeZ and btCapsuleShapeX subclasses.
btCapsuleShapeX(btScalar radius, btScalar height)
virtual int calculateSerializeBufferSize() const
btScalar getHalfHeight() const
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btVector3FloatData m_localScaling
btCapsuleShapeX represents a capsule around the Z axis the total height is height+2*radius,...
virtual void setLocalScaling(const btVector3 &scaling)
virtual void setMargin(btScalar collisionMargin)
btVector3 m_implicitShapeDimensions
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
virtual void setLocalScaling(const btVector3 &scaling)
#define BT_DECLARE_ALIGNED_ALLOCATOR()
The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned ...
btVector3 can be used to represent 3D points and vectors.
virtual const char * getName() const
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
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...
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
#define ATTRIBUTE_ALIGNED16(a)
#define SIMD_FORCE_INLINE
btCapsuleShapeZ(btScalar radius, btScalar height)
btConvexInternalShapeData m_convexInternalShapeData
void deSerializeFloat(struct btCapsuleShapeData *dataBuffer)
btMatrix3x3 absolute() const
Return the matrix with all values non negative.
void deSerializeFloat(const struct btVector3FloatData &dataIn)
virtual btVector3 getAnisotropicRollingFrictionDirection() const
the getAnisotropicRollingFrictionDirection can be used in combination with setAnisotropicFriction See...
virtual const char * getName() const
btCapsuleShapeZ represents a capsule around the Z axis the total height is height+2*radius,...
btVector3FloatData m_implicitShapeDimensions
btScalar getRadius() const
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)