Don't fallback to getAabbSlow in btCapsuleShape
This commit is contained in:
@@ -45,6 +45,18 @@ public:
|
|||||||
|
|
||||||
virtual int getShapeType() const { return CAPSULE_SHAPE_PROXYTYPE; }
|
virtual int getShapeType() const { return CAPSULE_SHAPE_PROXYTYPE; }
|
||||||
|
|
||||||
|
virtual void getAabb (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
|
||||||
|
{
|
||||||
|
btVector3 halfExtents(getRadius(),getRadius(),getRadius());
|
||||||
|
halfExtents[m_upAxis] = getRadius()*btScalar(2.0) + btScalar(0.5)*getHalfHeight();
|
||||||
|
btMatrix3x3 abs_b = t.getBasis().absolute();
|
||||||
|
btPoint3 center = t.getOrigin();
|
||||||
|
btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
|
||||||
|
extent += btVector3(getMargin(),getMargin(),getMargin());
|
||||||
|
aabbMin = center - extent;
|
||||||
|
aabbMax = center + extent;
|
||||||
|
}
|
||||||
|
|
||||||
virtual const char* getName()const
|
virtual const char* getName()const
|
||||||
{
|
{
|
||||||
return "CapsuleShape";
|
return "CapsuleShape";
|
||||||
|
|||||||
Reference in New Issue
Block a user