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/LinearMath/btMatrix3x3.h')
-rw-r--r--extern/bullet2/src/LinearMath/btMatrix3x3.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/extern/bullet2/src/LinearMath/btMatrix3x3.h b/extern/bullet2/src/LinearMath/btMatrix3x3.h
index 14fe704f81a..41dea694835 100644
--- a/extern/bullet2/src/LinearMath/btMatrix3x3.h
+++ b/extern/bullet2/src/LinearMath/btMatrix3x3.h
@@ -610,6 +610,27 @@ public:
/**@brief Return the inverse of the matrix */
btMatrix3x3 inverse() const;
+ /// Solve A * x = b, where b is a column vector. This is more efficient
+ /// than computing the inverse in one-shot cases.
+ ///Solve33 is from Box2d, thanks to Erin Catto,
+ btVector3 solve33(const btVector3& b) const
+ {
+ btVector3 col1 = getColumn(0);
+ btVector3 col2 = getColumn(1);
+ btVector3 col3 = getColumn(2);
+
+ btScalar det = btDot(col1, btCross(col2, col3));
+ if (btFabs(det)>SIMD_EPSILON)
+ {
+ det = 1.0f / det;
+ }
+ btVector3 x;
+ x[0] = det * btDot(b, btCross(col2, col3));
+ x[1] = det * btDot(col1, btCross(b, col3));
+ x[2] = det * btDot(col1, btCross(col2, b));
+ return x;
+ }
+
btMatrix3x3 transposeTimes(const btMatrix3x3& m) const;
btMatrix3x3 timesTranspose(const btMatrix3x3& m) const;