Avoid %-operator in normal calculation such that gcc does not throw a compiler error when using vector types of dimension other than three.

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@327 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Mike Kremer
2010-06-21 13:45:45 +00:00
parent 36877c3d20
commit 26c20f12f3

View File

@@ -109,14 +109,14 @@ calc_face_normal(FaceHandle _fh) const
for(; fv_it; ++fv_it) for(; fv_it; ++fv_it)
{ {
p2 = point(fv_it); p2 = point(fv_it);
n += vector_cast<Normal>((p2-p1)%(p0-p1)); n += vector_cast<Normal>(calc_face_normal(p0, p1, p2));
p0 = p1; p0 = p1;
p1 = p2; p1 = p2;
} }
//two additional steps since we started at vertex 2, not 0 //two additional steps since we started at vertex 2, not 0
n += vector_cast<Normal>((p0i-p1)%(p0-p1)); n += vector_cast<Normal>(calc_face_normal(p0i, p0, p1));
n += vector_cast<Normal>((p1i-p0i)%(p1-p0i)); n += vector_cast<Normal>(calc_face_normal(p1i, p0i, p1));
typename Normal::value_type norm = n.length(); typename Normal::value_type norm = n.length();