summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Bennice <mbennice@google.com>2022-08-11 11:46:39 -0700
committerMatt Bennice <mbennice@google.com>2022-08-11 11:46:39 -0700
commit82b7fa6df0ce50589cfa872d4971c14d799e8c7b (patch)
treed164957d5505f03ba06d6ee5612d80d51dbacea6
parentc7a67d509e8dea017493f7579aa6b8b6e71dee6b (diff)
downloadbullet3-82b7fa6df0ce50589cfa872d4971c14d799e8c7b.tar.gz
Update parameters to be const.
-rw-r--r--src/BulletSoftBody/btSoftBody.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/BulletSoftBody/btSoftBody.cpp b/src/BulletSoftBody/btSoftBody.cpp
index 5d5073549..9c438088a 100644
--- a/src/BulletSoftBody/btSoftBody.cpp
+++ b/src/BulletSoftBody/btSoftBody.cpp
@@ -2807,7 +2807,7 @@ bool btSoftBody::checkDeformableContact(const btCollisionObjectWrapper* colObjWr
//
// Compute barycentric coordinates (u, v, w) for
// point p with respect to triangle (a, b, c)
-static void getBarycentric(const btVector3& p, btVector3& a, btVector3& b, btVector3& c, btVector3& bary)
+static void getBarycentric(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c, btVector3& bary)
{
btVector3 v0 = b - a, v1 = c - a, v2 = p - a;
btScalar d00 = v0.dot(v0);
@@ -2816,6 +2816,7 @@ static void getBarycentric(const btVector3& p, btVector3& a, btVector3& b, btVec
btScalar d20 = v2.dot(v0);
btScalar d21 = v2.dot(v1);
btScalar denom = d00 * d11 - d01 * d01;
+ // In the case of a degenerate triangle, pick a vertex.
if (denom == btScalar(0.0))
{
bary.setY(btScalar(0.0));