summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/BulletCollision/CollisionShapes/btBox2dShape.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/bullet/BulletCollision/CollisionShapes/btBox2dShape.cpp')
-rw-r--r--thirdparty/bullet/BulletCollision/CollisionShapes/btBox2dShape.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/thirdparty/bullet/BulletCollision/CollisionShapes/btBox2dShape.cpp b/thirdparty/bullet/BulletCollision/CollisionShapes/btBox2dShape.cpp
index ecce028c2e..a3d8075daf 100644
--- a/thirdparty/bullet/BulletCollision/CollisionShapes/btBox2dShape.cpp
+++ b/thirdparty/bullet/BulletCollision/CollisionShapes/btBox2dShape.cpp
@@ -15,28 +15,23 @@ subject to the following restrictions:
#include "btBox2dShape.h"
+//{
-//{
-
-
-void btBox2dShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+void btBox2dShape::getAabb(const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
{
- btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
+ btTransformAabb(getHalfExtentsWithoutMargin(), getMargin(), t, aabbMin, aabbMax);
}
-
-void btBox2dShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+void btBox2dShape::calculateLocalInertia(btScalar mass, btVector3& inertia) const
{
//btScalar margin = btScalar(0.);
btVector3 halfExtents = getHalfExtentsWithMargin();
- btScalar lx=btScalar(2.)*(halfExtents.x());
- btScalar ly=btScalar(2.)*(halfExtents.y());
- btScalar lz=btScalar(2.)*(halfExtents.z());
-
- inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
- mass/(btScalar(12.0)) * (lx*lx + lz*lz),
- mass/(btScalar(12.0)) * (lx*lx + ly*ly));
+ btScalar lx = btScalar(2.) * (halfExtents.x());
+ btScalar ly = btScalar(2.) * (halfExtents.y());
+ btScalar lz = btScalar(2.) * (halfExtents.z());
+ inertia.setValue(mass / (btScalar(12.0)) * (ly * ly + lz * lz),
+ mass / (btScalar(12.0)) * (lx * lx + lz * lz),
+ mass / (btScalar(12.0)) * (lx * lx + ly * ly));
}
-