properly implement sphere collision shape support

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11694 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2012-10-16 22:45:44 +00:00
parent 2538646b6b
commit 19d0c04774

View File

@ -122,7 +122,12 @@ void ThreeDAnimation::createPhysicsBody(const std::string &shape)
{
m_collision_shape = new btCylinderShapeZ(0.5f*extend);
}
else if(shape=="sphere")
{
float radius = std::max(extend.getX(), extend.getY());
radius = 0.5f*std::max(radius, extend.getZ());
m_collision_shape = new btSphereShape(radius);
}
else if(shape=="exact")
{
TriangleMesh* triangle_mesh = new TriangleMesh();