From 88003c37d7bcbf25f79154dc88e06140d34cce16 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 10 Jun 2019 16:44:17 -0700 Subject: [PATCH] fix physics assert --- libraries/physics/src/PhysicsEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/physics/src/PhysicsEngine.cpp b/libraries/physics/src/PhysicsEngine.cpp index 976c547c5e..655edd4e13 100644 --- a/libraries/physics/src/PhysicsEngine.cpp +++ b/libraries/physics/src/PhysicsEngine.cpp @@ -35,7 +35,7 @@ static bool flipNormalsMyAvatarVsBackfacingTriangles(btManifoldPoint& cp, const btVector3* v = triShape->m_vertices1; btVector3 faceNormal = colObj1Wrap->getWorldTransform().getBasis() * btCross(v[1] - v[0], v[2] - v[0]); float nDotF = btDot(faceNormal, cp.m_normalWorldOnB); - if (nDotF <= 0.0f) { + if (nDotF <= 0.0f && faceNormal.length2() > EPSILON) { faceNormal.normalize(); // flip the contact normal to be aligned with the face normal cp.m_normalWorldOnB += -2.0f * nDotF * faceNormal;