diff --git a/vcg/space/triangle3.h b/vcg/space/triangle3.h index cadcf161..7d585c18 100644 --- a/vcg/space/triangle3.h +++ b/vcg/space/triangle3.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.1 2004/03/08 01:13:31 cignoni +Initial commit + ****************************************************************************/ #ifndef __VCG_TRIANGLE3 @@ -228,35 +231,35 @@ P3ScalarType Quality( Point3 const &p0, Point3 const template Point3 Normal(const TriangleType &t) { - return (( t.P(1) - t.P(0)) ^ (t.P(2) - t.P(0))); + return (( t.P0(1) - t.P0(0)) ^ (t.P0(2) - t.P0(0))); } /// Like the above, it returns the normal to the plane passing through p0,p1,p2, but normalized. template Point3 NormalizedNormal(const TriangleType &t) { - return (( t.P(1) - t.P(0)) ^ (t.P(2) - t.P(0))).Normalize(); + return (( t.P0(1) - t.P0(0)) ^ (t.P0(2) - t.P0(0))).Normalize(); } /// Return the area of the triangle template typename TriangleType::ScalarType Area(const TriangleType &t) { - return Norm( (t.P(1) - t.P(0)) ^ (t.P(2) - t.P(0)) ); + return Norm( (t.P0(1) - t.P0(0)) ^ (t.P0(2) - t.P0(0)) ); } template Point3 Barycenter(const TriangleType &t) { - return (t.P(0)+t.P(1)+t.P(2))/ScalarType(3.0); + return ((t.P0(0)+t.P0(1)+t.P0(2))/(typename TriangleType::ScalarType) 3.0); } template typename TriangleType::ScalarType Perimeter(const TriangleType &t) { - return Distance(t.P(0),t.P(1))+ - Distance(t.P(1),t.P(2))+ - Distance(t.P(2),t.P(0)); + return Distance(t.P0(0),t.P0(1))+ + Distance(t.P0(1),t.P0(2))+ + Distance(t.P0(2),t.P0(0)); }