Implemented a custom physics engine #316

Merged
direnbharwani merged 95 commits from SHPhysics into main 2023-01-23 15:55:45 +08:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 6451ca5e95 - Show all commits

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;