Skip to content

Commit

Permalink
Tinytweak; shouldn't reject things that were incorrectly rejected bef…
Browse files Browse the repository at this point in the history
…ore.
  • Loading branch information
RossNordby committed Dec 14, 2023
1 parent 0c20dea commit 79f982d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions BepuPhysics/Collidables/ConvexHullHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static void FindExtremeFace(
// }
// }
//}
var coplanar = Vector.LessThanOrEqual(Vector.Abs(dot), planeEpsilon);
var coplanar = Vector.GreaterThan(dot, -planeEpsilon);
if (Vector.LessThanAny(coplanar, Vector<int>.Zero))
{
var bundleBaseIndex = i << BundleIndexing.VectorShift;
Expand Down Expand Up @@ -318,8 +318,7 @@ static int FindNextIndexForFaceHull2(Vector2 start, Vector2 previousEdgeDirectio
if (alongNormal > planeEpsilon && !ignoreSlot)
Console.WriteLine("It looks like we've found a point significantly beyond the bounding plane we just identified; how's that possible?");

//TODO: Here and in the 3d variant: should you really be using the abs? That rejects anything that is numerically too far outside the face, which... should be rare, but we shouldn't let that point just corrupt things later.
if (float.Abs(alongNormal) <= planeEpsilon)
if (alongNormal > -planeEpsilon)
{
var alongEdge = Vector2.Dot(toCandidate, edgeDirection);
var rawDistance = float.Sqrt(alongEdge * alongEdge + alongNormal * alongNormal);
Expand Down

0 comments on commit 79f982d

Please sign in to comment.