Skip to content

Commit

Permalink
Fix nasty bug in TriangleEdgeCollisionFilter.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
notgiven688 committed Aug 19, 2024
1 parent b6935fa commit 0dfeac7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ public bool Filter(RigidBodyShape shapeA, RigidBodyShape shapeB,

if (c2) tnormal.Negate();

if (JVector.Dot(normal, tnormal) < -cosAT) normal.Negate();

tshape.GetWorldVertices(out JVector a, out JVector b, out JVector c);

JVector n, pma;
Expand Down Expand Up @@ -162,7 +160,6 @@ public bool Filter(RigidBodyShape shapeA, RigidBodyShape shapeB,
}

penetration *= f5;
normal = nnormal;
}
else
{
Expand All @@ -176,7 +173,6 @@ public bool Filter(RigidBodyShape shapeA, RigidBodyShape shapeB,
}

penetration *= f6;
normal = tnormal;
}

return true;
Expand Down
10 changes: 9 additions & 1 deletion src/JitterDemo/Playground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public void ShootPrimitive()
sb.Position = Conversion.ToJitterVector(pos);
sb.Velocity = Conversion.ToJitterVector(dir * primitiveVelocity);

var ss = new BoxShape(1);

var ss = new SphereShape(0.5f);
sb.AddShape(ss);
}

Expand Down Expand Up @@ -226,6 +227,13 @@ void DrawShape(Shape shape, in Matrix4 mat, in Vector3 color)

if (!GuiRenderer.WantsCaptureKeyboard && Keyboard.KeyPressBegin(Keyboard.Key.Space))
{
/*
Camera.Position = new(-28.477571f, 6.2047358f, -6.972821f);
Camera.Direction = new(-0.51022285f, -0.36347938f, 0.7794584f);
Console.WriteLine(this.Camera.Position);
Console.WriteLine(this.Camera.Direction);
*/

ShootPrimitive();
}

Expand Down

0 comments on commit 0dfeac7

Please sign in to comment.