Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btBoxShape.cpp')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionShapes/btBoxShape.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btBoxShape.cpp b/extern/bullet2/src/BulletCollision/CollisionShapes/btBoxShape.cpp
index 3859138f18a..cb91d023e40 100644
--- a/extern/bullet2/src/BulletCollision/CollisionShapes/btBoxShape.cpp
+++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btBoxShape.cpp
@@ -14,38 +14,32 @@ subject to the following restrictions:
*/
#include "btBoxShape.h"
-btBoxShape::btBoxShape( const btVector3& boxHalfExtents)
-: btPolyhedralConvexShape()
+btBoxShape::btBoxShape(const btVector3& boxHalfExtents)
+ : btPolyhedralConvexShape()
{
m_shapeType = BOX_SHAPE_PROXYTYPE;
- setSafeMargin(boxHalfExtents);
-
- btVector3 margin(getMargin(),getMargin(),getMargin());
+ btVector3 margin(getMargin(), getMargin(), getMargin());
m_implicitShapeDimensions = (boxHalfExtents * m_localScaling) - margin;
-};
-
-
+ setSafeMargin(boxHalfExtents);
+};
-void btBoxShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+void btBoxShape::getAabb(const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
{
- btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
+ btTransformAabb(getHalfExtentsWithoutMargin(), getMargin(), t, aabbMin, aabbMax);
}
-
-void btBoxShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+void btBoxShape::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));
}
-