From 7740162ad85d112510812bab7df01a4cf951e648 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 22 Dec 2018 16:38:40 -0800 Subject: [PATCH] apply gimpact versus rotated plane issue,thanks to @cameronwhite see https://github.com/cameronwhite/bullet3/commit/bd8bd11929097fabeda14657967fc96376099e62 Fixes Issue 69 --- .../Gimpact/btGImpactCollisionAlgorithm.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp b/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp index 4a1835d0d..d42644b81 100644 --- a/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp +++ b/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp @@ -50,10 +50,11 @@ public: void get_plane_equation_transformed(const btTransform& trans, btVector4& equation) const { - equation[0] = trans.getBasis().getRow(0).dot(m_planeNormal); - equation[1] = trans.getBasis().getRow(1).dot(m_planeNormal); - equation[2] = trans.getBasis().getRow(2).dot(m_planeNormal); - equation[3] = trans.getOrigin().dot(m_planeNormal) + m_planeConstant; + const btVector3 normal = trans.getBasis() * m_planeNormal; + equation[0] = normal[0]; + equation[1] = normal[1]; + equation[2] = normal[2]; + equation[3] = normal.dot(trans * (m_planeConstant * m_planeNormal)); } };