Attempts to improve performance. Not much gain yet, but good to experiment what has effect and what hasn't.
Added 'DO_BENCHMARK_PYRAMID' to CcdPhysicsDemo.
This commit is contained in:
@@ -49,10 +49,9 @@ void btBoxShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
|
||||
btScalar ly=btScalar(2.)*(halfExtents.y());
|
||||
btScalar lz=btScalar(2.)*(halfExtents.z());
|
||||
|
||||
inertia[0] = mass/(btScalar(12.0)) * (ly*ly + lz*lz);
|
||||
inertia[1] = mass/(btScalar(12.0)) * (lx*lx + lz*lz);
|
||||
inertia[2] = mass/(btScalar(12.0)) * (lx*lx + ly*ly);
|
||||
|
||||
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));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ void btSphereShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& a
|
||||
void btSphereShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
|
||||
{
|
||||
btScalar elem = btScalar(0.4) * mass * getMargin()*getMargin();
|
||||
inertia[0] = inertia[1] = inertia[2] = elem;
|
||||
inertia.setValue(elem,elem,elem);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user