Go to the documentation of this file.
82 double vx = (B[0] - C[0]);
83 double vy = (B[1] - C[1]);
84 double vz = (B[2] - C[2]);
86 double wx = (A[0] - B[0]);
87 double wy = (A[1] - B[1]);
88 double wz = (A[2] - B[2]);
90 double vw_x = vy * wz - vz * wy;
91 double vw_y = vz * wx - vx * wz;
92 double vw_z = vx * wy - vy * wx;
94 double mag = sqrt((vw_x * vw_x) + (vw_y * vw_y) + (vw_z * vw_z));
96 if ( mag < 0.000001f )
105 double x = vw_x * mag;
106 double y = vw_y * mag;
107 double z = vw_z * mag;
110 double D = 0.0f - ((x*A[0])+(y*A[1])+(z*A[2]));
124 Rect3d(
const double *bmin,
const double *bmax)
173 const double *midpoint)
205 const double *vertices,
207 const unsigned int *indices,
222 bmax[0] = sides[0]*0.5f;
223 bmax[1] = sides[1]*0.5f;
224 bmax[2] = sides[2]*0.5f;
231 double dx = sides[0];
232 double dy = sides[1];
233 double dz = sides[2];
238 unsigned int axis = 0;
246 if ( dz > dx && dz > dy )
256 p3[0] = p2[0] = p1[0] = bmin[0] + dx*0.5f;
257 p3[1] = p2[1] = p1[1] = bmin[1] + dy*0.5f;
258 p3[2] = p2[2] = p1[2] = bmin[2] + dz*0.5f;
void computeBestFitOBB(unsigned int vcount, const double *points, unsigned int pstride, double *sides, double *matrix)
bool computeSplitPlane(unsigned int vcount, const double *vertices, unsigned int tcount, const unsigned int *indices, ConvexDecompInterface *callback, double *plane)
static void computePlane(const double *A, const double *B, const double *C, double *plane)
void SetMin(double x, double y, double z)
void fm_transform(const double *matrix, const double *v, double *t)
Rect3d(const double *bmin, const double *bmax)
void SetMin(const double *bmin)
void SetMax(const double *bmax)
void splitRect(unsigned int axis, const Rect3d &source, Rect3d &b1, Rect3d &b2, const double *midpoint)
void SetMax(double x, double y, double z)