1 #ifndef SimTK_SIMMATH_GEO_TRIANGLE_H_
2 #define SimTK_SIMMATH_GEO_TRIANGLE_H_
68 {
setVertices(*vertexPointers[0], *vertexPointers[1], *vertexPointers[2]); }
72 { assert(0<=i && i<3); v[i] = p;
return *
this; }
75 { v[0]=v0; v[1]=v1; v[2]=v2;
return *
this; }
79 { v[0]=vertices[0]; v[1]=vertices[1]; v[2]=vertices[2];
return *
this; }
107 {
return uv[0]*v[0] + uv[1]*v[1] + (1-uv[0]-uv[1])*v[2]; }
112 {
return (v[0]+v[1]+v[2]) / RealP(3); }
117 {
return UnitVec3P((v[1]-v[0]) % (v[2]-v[0])); }
127 {
return ((v[1]-v[0]) % (v[2]-v[0])).norm() / 2; }
131 {
return ((v[1]-v[0]) % (v[2]-v[0])).normSqr() / 4; }
138 "Geo::Triangle_::findNearestPoint(): Not implemented yet.");
144 RealP& distance,
Vec2P& uv)
const
146 "Geo::Triangle_::intersectsRay(): Not implemented yet.");
return false;}
158 bool& isCoplanar)
const;
173 #endif // SimTK_SIMMATH_GEO_TRIANGLE_H_