From 948278ee43cf88a74b9ca56ff8ffc7ca40d7dd5b Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 14 Dec 2004 01:59:42 +0000 Subject: [PATCH] fix short-circuit of non-affine invert computation --- panda/src/linmath/lmatrix4_src.I | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/panda/src/linmath/lmatrix4_src.I b/panda/src/linmath/lmatrix4_src.I index d15aa36ddf..18fb32f716 100644 --- a/panda/src/linmath/lmatrix4_src.I +++ b/panda/src/linmath/lmatrix4_src.I @@ -1051,14 +1051,11 @@ transpose_in_place() { // successfully inverted, false if the was a // singularity. //////////////////////////////////////////////////////////////////// - -// bugbug: we could optimize this for rotation/scale/translation matrices -// (transpose upper 3x3 and take negative of translation component) INLINE_LINMATH bool FLOATNAME(LMatrix4):: invert_from(const FLOATNAME(LMatrix4) &other) { - if (IS_NEARLY_EQUAL(other._m.m._30, 0.0f) && - IS_NEARLY_EQUAL(other._m.m._31, 0.0f) && - IS_NEARLY_EQUAL(other._m.m._32, 0.0f) && + if (IS_NEARLY_EQUAL(other._m.m._03, 0.0f) && + IS_NEARLY_EQUAL(other._m.m._13, 0.0f) && + IS_NEARLY_EQUAL(other._m.m._23, 0.0f) && IS_NEARLY_EQUAL(other._m.m._33, 1.0f)) { return invert_affine_from(other); }