Improved performance of convex collision shapes, cache local AABB instead of recomputation. This fixes issue with very slow performance in larger .bsp levels.

Moved some asserts into 'btFullAssert', which is disabled by default (see btScalar.h to enable them). This is to speed-up debugging.
This commit is contained in:
ejcoumans
2007-02-26 04:59:05 +00:00
parent 559c4e85d8
commit b73900bc60
18 changed files with 102 additions and 21 deletions

View File

@@ -45,12 +45,12 @@ class btMatrix3x3 {
zx, zy, zz);
}
btVector3 getColumn(int i) const
SIMD_FORCE_INLINE btVector3 getColumn(int i) const
{
return btVector3(m_el[0][i],m_el[1][i],m_el[2][i]);
}
const btVector3& getRow(int i) const
SIMD_FORCE_INLINE const btVector3& getRow(int i) const
{
return m_el[i];
}
@@ -58,13 +58,13 @@ class btMatrix3x3 {
SIMD_FORCE_INLINE btVector3& operator[](int i)
{
assert(0 <= i && i < 3);
btFullAssert(0 <= i && i < 3);
return m_el[i];
}
const btVector3& operator[](int i) const
SIMD_FORCE_INLINE const btVector3& operator[](int i) const
{
assert(0 <= i && i < 3);
btFullAssert(0 <= i && i < 3);
return m_el[i];
}
@@ -102,7 +102,7 @@ class btMatrix3x3 {
void setRotation(const btQuaternion& q)
{
btScalar d = q.length2();
assert(d != btScalar(0.0));
btFullAssert(d != btScalar(0.0));
btScalar s = btScalar(2.0) / d;
btScalar xs = q[0] * s, ys = q[1] * s, zs = q[2] * s;
btScalar wx = q[3] * xs, wy = q[3] * ys, wz = q[3] * zs;
@@ -323,7 +323,7 @@ class btMatrix3x3 {
{
btVector3 co(cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1));
btScalar det = (*this)[0].dot(co);
assert(det != btScalar(0.0));
btFullAssert(det != btScalar(0.0));
btScalar s = btScalar(1.0) / det;
return btMatrix3x3(co[0] * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s,
co[1] * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s,