35 return Dist > epsilon ? 1 : Dist < -epsilon ? -1 : 0;
45 Point Tmp = mVerts[1];
46 mVerts[1] = mVerts[2];
58 const Point& p0 = mVerts[0];
59 const Point& p1 = mVerts[1];
60 const Point& p2 = mVerts[2];
61 return ((p0 - p1)^(p0 - p2)).Magnitude() * 0.5f;
72 const Point& p0 = mVerts[0];
73 const Point& p1 = mVerts[1];
74 const Point& p2 = mVerts[2];
75 return p0.Distance(p1)
88 float P = Perimeter();
89 if(P==0.0
f)
return 0.0f;
90 return (4.0
f*
PI*Area()/(P*P));
101 const Point& p0 = mVerts[0];
102 const Point& p1 = mVerts[1];
103 const Point& p2 = mVerts[2];
104 normal = ((p0 - p1)^(p0 - p2)).Normalize();
115 const Point& p0 = mVerts[0];
116 const Point& p1 = mVerts[1];
117 const Point& p2 = mVerts[2];
118 normal = ((p0 - p1)^(p0 - p2));
129 const Point& p0 = mVerts[0];
130 const Point& p1 = mVerts[1];
131 const Point& p2 = mVerts[2];
132 center = (p0 + p1 + p2)*
INV3;
137 bool Pos =
false, Neg =
false;
145 if (Side < 0) Neg =
true;
146 else if (Side > 0)
Pos =
true;
216 float Length01 = mVerts[0].Distance(mVerts[1]);
217 float Length02 = mVerts[0].Distance(mVerts[2]);
218 float Length12 = mVerts[1].Distance(mVerts[2]);
219 if(Length01 < Min) Min = Length01;
220 if(Length02 < Min) Min = Length02;
221 if(Length12 < Min) Min = Length12;
234 float Length01 = mVerts[0].Distance(mVerts[1]);
235 float Length02 = mVerts[0].Distance(mVerts[2]);
236 float Length12 = mVerts[1].Distance(mVerts[2]);
237 if(Length01 > Max) Max = Length01;
238 if(Length02 > Max) Max = Length02;
239 if(Length12 > Max) Max = Length12;
254 pt = (1.0f - u - v)*mVerts[0] + u*mVerts[1] + v*mVerts[2];
260 Point d(mVerts[0].SquareDistance(pt),
261 mVerts[1].SquareDistance(pt),
262 mVerts[2].SquareDistance(pt));
265 *nearvtx = d.SmallestAxis();
272 Point TriangleCenter;
273 Center(TriangleCenter);
280 Point v = mVerts[
i] - TriangleCenter;
282 if(constant_border) v.Normalize();
284 mVerts[
i] += v * fat_coeff;