| 434 | } |
| 435 | |
| 436 | static U32 ClipPlane(F32 denom, F32 numer, F32* t_in, F32* t_out) |
| 437 | { |
| 438 | if (denom > 0.0f) |
| 439 | { |
| 440 | if (numer > denom * (*t_out)) |
| 441 | { |
| 442 | return 0; |
| 443 | } |
| 444 | |
| 445 | if (numer > denom * (*t_in)) |
| 446 | { |
| 447 | *t_in = numer / denom; |
| 448 | } |
| 449 | |
| 450 | return 1; |
| 451 | } |
| 452 | else if (denom < 0.0f) |
| 453 | { |
| 454 | if (numer > denom * (*t_in)) |
| 455 | { |
| 456 | return 0; |
| 457 | } |
| 458 | |
| 459 | if (numer > denom * (*t_out)) |
| 460 | { |
| 461 | *t_out = numer / denom; |
| 462 | } |
| 463 | |
| 464 | return 1; |
| 465 | } |
| 466 | |
| 467 | return (numer <= 0.0f); |
| 468 | } |
| 469 | |
| 470 | static U32 ClipBox(const xVec3* r3, const xVec3* r4, const xVec3* r5, F32* t_in, F32* t_out) |
| 471 | { |