forgot to flip a normal

This commit is contained in:
Diren D Bharwani 2022-12-31 01:40:28 +08:00
parent 987a1fa515
commit 6451ca5e95
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -2.24715948, y: 6.47200441, z: 0}
Translate: {x: -1.98839664, y: 7.7662077, z: 0}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true

View File

@ -102,7 +102,7 @@ namespace SHADE
// Check if center is inside polyhedron (below the face)
if (bestDistance < SHMath::EPSILON)
{
manifold.normal = CONVEX.GetNormal(closestFaceIndex);
manifold.normal = -CONVEX.GetNormal(closestFaceIndex);
SHContact newContact;
newContact.penetration = PENETRATION;
@ -179,7 +179,7 @@ namespace SHADE
if (projection >= 0.0f)
{
// Sphere Within region
manifold.normal = CP_TO_CENTER;
manifold.normal = -CP_TO_CENTER;
SHContact newContact;
newContact.penetration = RADIUS - projection;