diff options
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h')
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h b/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h index ab763abf808..7578bb258df 100644 --- a/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h +++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h @@ -23,7 +23,7 @@ subject to the following restrictions: ///The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned around the X axis and btCapsuleShapeZ around the Z axis. ///The total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps. ///The btCapsuleShape is a convex hull of two spheres. The btMultiSphereShape is a more general collision shape that takes the convex hull of multiple sphere, so it can also represent a capsule when just using two spheres. -class btCapsuleShape : public btConvexInternalShape +ATTRIBUTE_ALIGNED16(class) btCapsuleShape : public btConvexInternalShape { protected: int m_upAxis; @@ -33,6 +33,9 @@ protected: btCapsuleShape() : btConvexInternalShape() {m_shapeType = CAPSULE_SHAPE_PROXYTYPE;}; public: + + BT_DECLARE_ALIGNED_ALLOCATOR(); + btCapsuleShape(btScalar radius,btScalar height); ///CollisionShape Interface @@ -62,8 +65,8 @@ public: halfExtents += btVector3(getMargin(),getMargin(),getMargin()); btMatrix3x3 abs_b = t.getBasis().absolute(); btVector3 center = t.getOrigin(); - btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents)); - + btVector3 extent = halfExtents.dot3(abs_b[0], abs_b[1], abs_b[2]); + aabbMin = center - extent; aabbMax = center + extent; } @@ -101,6 +104,14 @@ public: } + virtual btVector3 getAnisotropicRollingFrictionDirection() const + { + btVector3 aniDir(0,0,0); + aniDir[getUpAxis()]=1; + return aniDir; + } + + virtual int calculateSerializeBufferSize() const; ///fills the dataBuffer and returns the struct name (and 0 on failure) |