mirror of
https://github.com/open-goal/jak-project
synced 2026-07-25 22:31:06 -04:00
[game] prevent NaNs when there's a zero area triangle in edgegrab (#1404)
This commit is contained in:
@@ -104,6 +104,12 @@ u64 execute(void* ctxt) {
|
||||
c->vmadd_bc(DEST::w, BC::z, vf9, vf0, vf9); // vmaddz.w vf9, vf0, vf9
|
||||
// nop // sll r0, r0, 0
|
||||
c->vrsqrt(vf0, BC::w, vf9, BC::w); // vrsqrt Q, vf0.w, vf9.w
|
||||
if (c->vfs[vf9].f[3] == 0.f) {
|
||||
// hack to prevent NaNs from getting in the collide data if we have a zero-area triangle
|
||||
// this value doesn't matter - the normal is zeros anyway and the triangle will be rejected
|
||||
// by every other step.
|
||||
c->Q = 0.f;
|
||||
}
|
||||
// nop // sll r0, r0, 0
|
||||
c->dsll32(t5, t5, 12); // dsll32 t5, t5, 12
|
||||
c->dsrl32(t5, t5, 26); // dsrl32 t5, t5, 26
|
||||
|
||||
Reference in New Issue
Block a user