Skip to content

Commit 79c5295

Browse files
committed
fix gamma calculation
1 parent 8b825af commit 79c5295

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rewrite/src/exe/coll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static s32 _COLL_BarycentricTest(TestVertex* t, const CollVertex* v1, const Coll
9494
if (deltaTri[0].y == 0) { return BARYCENTRIC_TEST_INVALID; }
9595
beta = FP_DIV(deltaT.y, deltaTri[0].y);
9696
if (deltaTri[1].x == 0) { return BARYCENTRIC_TEST_INVALID; }
97-
gamma = (deltaT.y * FP_ONE) - (beta * deltaTri[1].y);
97+
gamma = ((deltaT.y * FP_ONE) - (beta * deltaTri[1].y)) / deltaTri[1].x;
9898
}
9999
if (beta == FP(-1) || gamma == FP(-1)) { return BARYCENTRIC_TEST_INVALID; }
100100

0 commit comments

Comments
 (0)