22 template <
typename Real>
96 template <
typename Real>
104 template <
typename Real>
113 template <
typename Real>
inline 120 template <
typename Real>
inline 126 template <
typename Real>
inline 132 template <
typename Real>
138 template <
typename Real>
146 Real
x0 = test[0] - vec0[0];
147 Real
y0 = test[1] - vec0[1];
148 Real z0 = test[2] - vec0[2];
149 Real
x1 = vec1[0] - vec0[0];
150 Real
y1 = vec1[1] - vec0[1];
151 Real z1 = vec1[2] - vec0[2];
152 Real
x2 = vec2[0] - vec0[0];
153 Real
y2 = vec2[1] - vec0[1];
154 Real z2 = vec2[2] - vec0[2];
161 Real c0 = y1z2 - y2z1;
162 Real c1 = y2z0 - y0z2;
163 Real c2 = y0z1 - y1z0;
167 Real term = x0c0 + x1c1;
168 Real det = term + x2c2;
171 return (det > zero ? +1 : (det < zero ? -1 : 0));
174 template <
typename Real>
181 template <
typename Real>
183 int v1,
int v2,
int v3)
const 185 int sign0 =
ToPlane(test, v1, v2, v3);
191 int sign1 =
ToPlane(test, v0, v2, v3);
197 int sign2 =
ToPlane(test, v0, v1, v3);
203 int sign3 =
ToPlane(test, v0, v1, v2);
209 return ((sign0 && sign1 && sign2 && sign3) ? -1 : 0);
212 template <
typename Real>
219 template <
typename Real>
221 int v1,
int v2,
int v3)
const 228 Real
x0 = vec0[0] - test[0];
229 Real
y0 = vec0[1] - test[1];
230 Real z0 = vec0[2] - test[2];
231 Real s00 = vec0[0] + test[0];
232 Real s01 = vec0[1] + test[1];
233 Real s02 = vec0[2] + test[2];
237 Real t00pt01 = t00 + t01;
238 Real w0 = t00pt01 + t02;
240 Real
x1 = vec1[0] - test[0];
241 Real
y1 = vec1[1] - test[1];
242 Real z1 = vec1[2] - test[2];
243 Real s10 = vec1[0] + test[0];
244 Real s11 = vec1[1] + test[1];
245 Real s12 = vec1[2] + test[2];
249 Real t10pt11 = t10 + t11;
250 Real
w1 = t10pt11 + t12;
252 Real
x2 = vec2[0] - test[0];
253 Real
y2 = vec2[1] - test[1];
254 Real z2 = vec2[2] - test[2];
255 Real s20 = vec2[0] + test[0];
256 Real s21 = vec2[1] + test[1];
257 Real s22 = vec2[2] + test[2];
261 Real t20pt21 = t20 + t21;
262 Real
w2 = t20pt21 + t22;
264 Real x3 = vec3[0] - test[0];
265 Real y3 = vec3[1] - test[1];
266 Real z3 = vec3[2] - test[2];
267 Real s30 = vec3[0] + test[0];
268 Real s31 = vec3[1] + test[1];
269 Real s32 = vec3[2] + test[2];
273 Real t30pt31 = t30 + t31;
274 Real w3 = t30pt31 + t32;
288 Real a0 = x0y1 - x1y0;
289 Real a1 = x0y2 - x2y0;
290 Real a2 = x0y3 - x3y0;
291 Real a3 = x1y2 - x2y1;
292 Real a4 = x1y3 - x3y1;
293 Real a5 = x2y3 - x3y2;
307 Real b0 = z0w1 - z1w0;
308 Real b1 = z0w2 - z2w0;
309 Real b2 = z0w3 - z3w0;
310 Real b3 = z1w2 - z2w1;
311 Real b4 = z1w3 - z3w1;
312 Real b5 = z2w3 - z3w2;
319 Real term0 = a0b5 - a1b4;
320 Real term1 = term0 + a2b3;
321 Real term2 = term1 + a3b2;
322 Real term3 = term2 - a4b1;
323 Real det = term3 + a5b0;
326 return (det > zero ? 1 : (det < zero ? -1 : 0));
int ToPlane(int i, int v0, int v1, int v2) const
int ToCircumsphere(int i, int v0, int v1, int v2, int v3) const
GLfixed GLfixed GLfixed y2
int GetNumVertices() const
int ToTetrahedron(int i, int v0, int v1, int v2, int v3) const
Vector3< Real > const * GetVertices() const
Vector3< Real > const * mVertices
GLfloat GLfloat GLfloat GLfloat v3
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble GLdouble w2
void Set(int numVertices, Vector3< Real > const *vertices)
GLuint GLfloat GLfloat GLfloat x1
GLfloat GLfloat GLfloat v2
GLuint GLfloat GLfloat y0
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble w1