Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

aabb.cpp File Reference

#include "aabb.h"

Include dependency graph for aabb.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define X   0
#define Y   1
#define Z   2
#define FINDMINMAX(x0, x1, x2, min, max)
#define AXISTEST_X01(a, b, fa, fb)
#define AXISTEST_X2(a, b, fa, fb)
#define AXISTEST_Y02(a, b, fa, fb)
#define AXISTEST_Y1(a, b, fa, fb)
#define AXISTEST_Z12(a, b, fa, fb)
#define AXISTEST_Z0(a, b, fa, fb)

Functions

bool aabb_intersects_plane (const gmVector3 &length, const gmVector3 &normal, double d)
bool aabb_intersects_triangle (const gmVector3 &aabbcenter, const gmVector3 &length, const gmVector3 &vv0, const gmVector3 &vv1, const gmVector3 &vv2)
bool aabb_intersects_aabb (const gmVector3 &center1, const gmVector3 &length1, const gmVector3 &center2, const gmVector3 &length2)
double aabb_distance_to_point (const gmVector3 &center, const gmVector3 &length, const gmVector3 &p, gmVector3 *where)


Define Documentation

#define AXISTEST_X01 a,
b,
fa,
fb   ) 
 

Value:

p0 = a*v0[Y] - b*v0[Z];                            \
        p2 = a*v2[Y] - b*v2[Z];                            \
        if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} \
        rad = fa * length[Y] + fb * length[Z];   \
        if(min>rad || max<-rad) return false;

Definition at line 53 of file aabb.cpp.

Referenced by aabb_intersects_triangle().

#define AXISTEST_X2 a,
b,
fa,
fb   ) 
 

Value:

p0 = a*v0[Y] - b*v0[Z];                            \
        p1 = a*v1[Y] - b*v1[Z];                            \
        if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} \
        rad = fa * length[Y] + fb * length[Z];   \
        if(min>rad || max<-rad) return false;

Definition at line 60 of file aabb.cpp.

Referenced by aabb_intersects_triangle().

#define AXISTEST_Y02 a,
b,
fa,
fb   ) 
 

Value:

p0 = -a*v0[X] + b*v0[Z];                           \
        p2 = -a*v2[X] + b*v2[Z];                           \
        if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} \
        rad = fa * length[X] + fb * length[Z];   \
        if(min>rad || max<-rad) return false;

Definition at line 68 of file aabb.cpp.

Referenced by aabb_intersects_triangle().

#define AXISTEST_Y1 a,
b,
fa,
fb   ) 
 

Value:

p0 = -a*v0[X] + b*v0[Z];                           \
        p1 = -a*v1[X] + b*v1[Z];                           \
        if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} \
        rad = fa * length[X] + fb * length[Z];   \
        if(min>rad || max<-rad) return false;

Definition at line 75 of file aabb.cpp.

Referenced by aabb_intersects_triangle().

#define AXISTEST_Z0 a,
b,
fa,
fb   ) 
 

Value:

p0 = a*v0[X] - b*v0[Y];                            \
        p1 = a*v1[X] - b*v1[Y];                            \
        if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} \
        rad = fa * length[X] + fb * length[Y];   \
        if(min>rad || max<-rad) return false;

Definition at line 91 of file aabb.cpp.

Referenced by aabb_intersects_triangle().

#define AXISTEST_Z12 a,
b,
fa,
fb   ) 
 

Value:

p1 = a*v1[X] - b*v1[Y];                            \
        p2 = a*v2[X] - b*v2[Y];                            \
        if(p2<p1) {min=p2; max=p1;} else {min=p1; max=p2;} \
        rad = fa * length[X] + fb * length[Y];   \
        if(min>rad || max<-rad) return false;

Definition at line 84 of file aabb.cpp.

Referenced by aabb_intersects_triangle().

#define FINDMINMAX x0,
x1,
x2,
min,
max   ) 
 

Value:

min = max = x0;   \
  if(x1<min) min=x1;\
  if(x1>max) max=x1;\
  if(x2<min) min=x2;\
  if(x2>max) max=x2;

Definition at line 17 of file aabb.cpp.

Referenced by aabb_intersects_triangle().

#define X   0
 

Definition at line 13 of file aabb.cpp.

Referenced by aabb_intersects_plane(), aabb_intersects_triangle(), Newton::FindZeros(), Newton::FindZerosDivide(), Newton::GaussSeidelRow(), Newton::INewton(), Newton::NewtonBreak(), Newton::NewtonDriver(), NewtonDegenerate::NewtonEquation(), NewtonCritical::NewtonEquation(), Newton::NewtonOutput(), SearchDegenerate::NewtonPostProcess(), SearchCritical::NewtonPostProcess(), Newton::NewtonPostProcess(), NewtonDegenerate::NewtonSubdivisionBreak(), NewtonCritical::NewtonSubdivisionBreak(), and Newton::SolveSeidel().

#define Y   1
 

Definition at line 14 of file aabb.cpp.

Referenced by aabb_intersects_triangle().

#define Z   2
 

Definition at line 15 of file aabb.cpp.

Referenced by aabb_intersects_plane(), aabb_intersects_triangle(), and Jacobi::solve().


Function Documentation

double aabb_distance_to_point const gmVector3 &  center,
const gmVector3 &  length,
const gmVector3 &  p,
gmVector3 *  where
 

Definition at line 210 of file aabb.cpp.

bool aabb_intersects_aabb const gmVector3 &  center1,
const gmVector3 &  length1,
const gmVector3 &  center2,
const gmVector3 &  length2
 

Definition at line 181 of file aabb.cpp.

bool aabb_intersects_plane const gmVector3 &  length,
const gmVector3 &  normal,
double  d
 

Definition at line 25 of file aabb.cpp.

References dot(), X, and Z.

Referenced by aabb_intersects_triangle().

bool aabb_intersects_triangle const gmVector3 &  aabbcenter,
const gmVector3 &  length,
const gmVector3 &  vv0,
const gmVector3 &  vv1,
const gmVector3 &  vv2
 

Definition at line 98 of file aabb.cpp.

References aabb_intersects_plane(), AXISTEST_X01, AXISTEST_X2, AXISTEST_Y02, AXISTEST_Y1, AXISTEST_Z0, AXISTEST_Z12, dot(), FINDMINMAX, X, Y, and Z.


Generated on Mon Jun 28 14:58:23 2004 for Advanced Surface Library by doxygen 1.3.4