22 template <
typename Real>
76 int ToLine(
int i,
int v0,
int v1,
int&
order)
const;
152 template <
typename Real>
160 template <
typename Real>
169 template <
typename Real>
inline 176 template <
typename Real>
inline 182 template <
typename Real>
inline 188 template <
typename Real>
194 template <
typename Real>
200 Real
x0 = test[0] - vec0[0];
201 Real
y0 = test[1] - vec0[1];
202 Real
x1 = vec1[0] - vec0[0];
203 Real
y1 = vec1[1] - vec0[1];
206 Real det = x0y1 - x1y0;
209 return (det > zero ? +1 : (det < zero ? -1 : 0));
212 template <
typename Real>
218 template <
typename Real>
224 Real
x0 = test[0] - vec0[0];
225 Real
y0 = test[1] - vec0[1];
226 Real
x1 = vec1[0] - vec0[0];
227 Real
y1 = vec1[1] - vec0[1];
230 Real det = x0y1 - x1y0;
247 Real dot = x0x1 + y0y1;
260 Real sqrLength = x0x0 + y0y0;
261 if (dot == sqrLength)
265 else if (dot > sqrLength)
278 template <
typename Real>
284 template <
typename Real>
287 int sign0 =
ToLine(test, v1, v2);
293 int sign1 =
ToLine(test, v0, v2);
299 int sign2 =
ToLine(test, v0, v1);
305 return ((sign0 && sign1 && sign2) ? -1 : 0);
308 template <
typename Real>
314 template <
typename Real>
321 Real
x0 = vec0[0] - test[0];
322 Real
y0 = vec0[1] - test[1];
323 Real s00 = vec0[0] + test[0];
324 Real s01 = vec0[1] + test[1];
329 Real
x1 = vec1[0] - test[0];
330 Real
y1 = vec1[1] - test[1];
331 Real s10 = vec1[0] + test[0];
332 Real s11 = vec1[1] + test[1];
337 Real
x2 = vec2[0] - test[0];
338 Real
y2 = vec2[1] - test[1];
339 Real s20 = vec2[0] + test[0];
340 Real s21 = vec2[1] + test[1];
351 Real c0 = y1z2 - y2z1;
352 Real c1 = y2z0 - y0z2;
353 Real c2 = y0z1 - y1z0;
357 Real term = x0c0 + x1c1;
358 Real det = term + x2c2;
361 return (det < zero ? 1 : (det > zero ? -1 : 0));
364 template <
typename Real>
370 Real
x0 = Q1[0] - Q0[0];
371 Real
y0 = Q1[1] - Q0[1];
372 if (x0 == zero && y0 == zero)
377 Real
x1 = P[0] - Q0[0];
378 Real
y1 = P[1] - Q0[1];
379 if (x1 == zero && y1 == zero)
384 Real
x2 = P[0] - Q1[0];
385 Real
y2 = P[1] - Q1[1];
386 if (x2 == zero && y2 == zero)
395 Real det = x0y1 - x1y0;
415 Real dot = x0x1 + y0y1;
424 Real sqrLength = x0x0 + y0y0;
Vector2< Real > const * mVertices
int GetNumVertices() const
GLfixed GLfixed GLint GLint order
OrderType ToLineExtended(Vector2< Real > const &P, Vector2< Real > const &Q0, Vector2< Real > const &Q1) const
void Set(int numVertices, Vector2< Real > const *vertices)
GLfixed GLfixed GLfixed y2
int ToLine(int i, int v0, int v1) const
Vector2< Real > const * GetVertices() const
int ToCircumcircle(int i, int v0, int v1, int v2) const
int ToTriangle(int i, int v0, int v1, int v2) const
GLuint GLfloat GLfloat GLfloat x1
GLfloat GLfloat GLfloat v2
GLuint GLfloat GLfloat y0