From 26c20f12f3bd48ebbf185f6608d438a61aff6340 Mon Sep 17 00:00:00 2001 From: Mike Kremer Date: Mon, 21 Jun 2010 13:45:45 +0000 Subject: [PATCH] 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 --- src/OpenMesh/Core/Mesh/PolyMeshT.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT.cc b/src/OpenMesh/Core/Mesh/PolyMeshT.cc index bfb39721..313ecf55 100644 --- a/src/OpenMesh/Core/Mesh/PolyMeshT.cc +++ b/src/OpenMesh/Core/Mesh/PolyMeshT.cc @@ -109,14 +109,14 @@ calc_face_normal(FaceHandle _fh) const for(; fv_it; ++fv_it) { p2 = point(fv_it); - n += vector_cast((p2-p1)%(p0-p1)); + n += vector_cast(calc_face_normal(p0, p1, p2)); p0 = p1; p1 = p2; } //two additional steps since we started at vertex 2, not 0 - n += vector_cast((p0i-p1)%(p0-p1)); - n += vector_cast((p1i-p0i)%(p1-p0i)); + n += vector_cast(calc_face_normal(p0i, p0, p1)); + n += vector_cast(calc_face_normal(p1i, p0i, p1)); typename Normal::value_type norm = n.length();