add support for X,Z axis aligned capsules

This commit is contained in:
ejcoumans
2008-02-08 01:11:05 +00:00
parent 71b58309cf
commit 618263163c
2 changed files with 25 additions and 43 deletions

View File

@@ -21,6 +21,7 @@ subject to the following restrictions:
btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height)
{
m_upAxis = 1;
m_implicitShapeDimensions.setValue(radius,0.5f*height,radius);
}
@@ -147,20 +148,22 @@ void btCapsuleShape::calculateLocalInertia(btScalar mass,btVector3& inertia) con
}
btCapsuleShapeX::btCapsuleShapeX(btScalar radius,btScalar height)
{
m_implicitShapeDimensions.setValue(0.5f*height, radius,radius);
}
btCapsuleShapeX::btCapsuleShapeX(btScalar radius,btScalar height)
{
m_upAxis = 0;
m_implicitShapeDimensions.setValue(0.5f*height, radius,radius);
}
btCapsuleShapeZ::btCapsuleShapeZ(btScalar radius,btScalar height)
{
m_implicitShapeDimensions.setValue(radius,radius,0.5f*height);
}
btCapsuleShapeZ::btCapsuleShapeZ(btScalar radius,btScalar height)
{
m_upAxis = 2;
m_implicitShapeDimensions.setValue(radius,radius,0.5f*height);
}