89static Vector3 _box_normal[3][2] =
134 if ((t < 0.0f) || (t > 1.0f)) {
141 if (t < result->Fraction) {
170 if ((t < 0.0f) || (t > 1.0f)) {
177 if (t < result->Fraction) {
218 if ((t < 0.0f) || (t > 1.0f)) {
234 if (t < res->Fraction) {
260 if (frac<0.0f)
return false;
261 if (frac < res->Fraction) {
384 float candidateplane[3];
396 for (i=0; i<3; i++) {
399 candidateplane[i] =
test->Min[i];
401 }
else if (
test->P0[i] >
test->Max[i]) {
403 candidateplane[i] =
test->Max[i];
414 test->Fraction = 0.0f;
422 for (i=0; i<3; i++) {
424 maxt[i] = (candidateplane[i] -
test->P0[i]) /
test->DP[i];
433 int intersection_plane = 0;
435 for (i=1; i<3; i++) {
436 if (maxt[i] > maxt[intersection_plane]) {
437 intersection_plane = i;
444 if (maxt[intersection_plane] < 0.0f) {
453 for (i=0; i<3; i++) {
455 if (intersection_plane != i) {
457 coord[i] =
test->P0[i] + maxt[intersection_plane] *
test->DP[i];
459 if ((coord[i] <
test->Min[i]) || (coord[i] >
test->Max[i])) {
467 coord[i] = candidateplane[i];
475 test->Fraction = maxt[intersection_plane];
476 test->Inside =
false;
477 test->Axis = intersection_plane;
478 test->Side = quadrant[intersection_plane];
static bool Collide(const LineSegClass &line, const AAPlaneClass &plane, CastResultStruct *result)
const Vector3 & Get_Dir() const
const Vector3 & Get_DP() const
const Vector3 & Get_P0() const
WWINLINE Matrix3x3 Transpose(void) const
bool Contains_Point(const Vector3 &ipoint) const
static WWINLINE float Dot_Product(const Vector3 &a, const Vector3 &b)
WWINLINE float Length2(void) const
WWINLINE void Set(float x, float y, float z)
static float Sqrt(float val)
#define TRACK_COLLISION_RAY_TRI_HIT
#define TRACK_COLLISION_RAY_TRI
bool Test_Aligned_Box(BoxTestStruct *test)