Fix volume formula for capsules

This commit is contained in:
Atlante45 2015-04-23 19:14:07 +02:00
parent 83490051d9
commit b340cd06bf

View file

@ -114,7 +114,7 @@ float ShapeInfo::computeVolume() const {
}
case SHAPE_TYPE_CAPSULE_Y: {
float radius = _halfExtents.x;
volume = PI * radius * radius * (2.0f * _halfExtents.y + 4.0f * radius / 3.0f);
volume = PI * radius * radius * (2.0f * (_halfExtents.y - _halfExtents.x) + 4.0f * radius / 3.0f);
break;
}
default: