16 template <
typename Real>
22 template <
typename Real>
26 template <
typename Real>
31 template <
typename Real>
41 template <
typename Real>
50 template <
typename Real>
53 Real epsilon = (Real)0);
58 template <
typename Real>
102 template <
typename Real>
108 template <
typename Real>
116 template <
typename Real>
122 template <
typename Real>
128 return Orthonormalize<2, Real>(2,
v, robust);
134 template <
typename Real>
142 Real det =
DotPerp(diff[0], diff[1]);
143 if (det < -epsilon || det > epsilon)
145 Real invDet = ((Real)1) / det;
146 bary[0] =
DotPerp(diff[2], diff[1])*invDet;
147 bary[1] =
DotPerp(diff[0], diff[2])*invDet;
148 bary[2] = (Real)1 - bary[0] - bary[1];
152 for (
int i = 0; i < 3; ++i)
159 template <
typename Real>
166 origin({ (Real)0, (Real)0 }),
177 if (numVectors > 0 &&
v &&
epsilon >= (Real)0)
181 int j, indexMin[2], indexMax[2];
182 for (j = 0; j < 2; ++j)
191 for (i = 1; i < numVectors; ++i)
193 for (j = 0; j < 2; ++j)
195 if (
v[i][j] <
min[j])
200 else if (
v[i][j] >
max[j])
228 for (j = 0; j < 2; ++j)
230 extreme[j + 1] = extreme[0];
243 Real maxDistance = (Real)0;
244 Real maxSign = (Real)0;
245 extreme[2] = extreme[0];
246 for (i = 0; i < numVectors; ++i)
250 Real sign = (distance >(Real)0 ? (Real)1 :
251 (distance < (Real)0 ? (Real)-1 : (Real)0));
252 distance = fabs(distance);
253 if (distance > maxDistance)
265 extreme[2] = extreme[1];
Vector2< Real > UnitPerp(Vector2< Real > const &v, bool robust=false)
GLsizei GLsizei GLfloat distance
Real DotPerp(Vector2< Real > const &v0, Vector2< Real > const &v1)
DualQuaternion< Real > Dot(DualQuaternion< Real > const &d0, DualQuaternion< Real > const &d1)
Real Normalize(GVector< Real > &v, bool robust=false)
Vector2< Real > Perp(Vector2< Real > const &v)
bool ComputeBarycentrics(Vector2< Real > const &p, Vector2< Real > const &v0, Vector2< Real > const &v1, Vector2< Real > const &v2, Real bary[3], Real epsilon=(Real) 0)
GLfloat GLfloat GLfloat v2
Real ComputeOrthogonalComplement(int numInputs, Vector2< Real > *v, bool robust=false)
IntrinsicsVector2(int numVectors, Vector2< Real > const *v, Real inEpsilon)
Vector2< Real > direction[2]