Skip to content
Snippets Groups Projects
Commit 51094d78 authored by Andrew Wilson's avatar Andrew Wilson :elephant:
Browse files

BUG: Fix sphere & capsule contact data on vertex resolution

parent 726c90d5
No related branches found
No related tags found
No related merge requests found
......@@ -139,15 +139,15 @@ SurfaceMeshToSphereCD::computeCollisionDataAB(
const double penetrationDepth = sphereRadius - dist;
contactNormal /= dist;
// Point contact
// Point contact
PointIndexDirectionElement elemA;
elemA.ptIndex = pointContact;
elemA.dir = -contactNormal; // Direction to resolve point
elemA.ptIndex = pointContact; // Point on triangle
elemA.dir = -contactNormal; // Direction to resolve point on triangle
elemA.penetrationDepth = penetrationDepth;
PointDirectionElement elemB;
elemB.pt = triangleContactPt; // Point on sphere
elemB.dir = contactNormal; // Direction to resolve point
elemB.pt = spherePos - sphereRadius * contactNormal; // Contact point on sphere
elemB.dir = contactNormal; // Direction to resolve point on sphere
elemB.penetrationDepth = penetrationDepth;
lock.lock();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment