diff --git a/Source/CollisionDetection/CollisionDetection/imstkSurfaceMeshToSphereCD.cpp b/Source/CollisionDetection/CollisionDetection/imstkSurfaceMeshToSphereCD.cpp index f3abbebb95c5a949199f578e72b3ef3003f0bf50..2b02988b44808aa3b4a6c24a523c1ed7ffb9e161 100644 --- a/Source/CollisionDetection/CollisionDetection/imstkSurfaceMeshToSphereCD.cpp +++ b/Source/CollisionDetection/CollisionDetection/imstkSurfaceMeshToSphereCD.cpp @@ -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();