Avoiding implicit type casts in normal calculation routine.

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@270 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Mike Kremer
2010-02-08 16:13:17 +00:00
parent 88ca0c9b60
commit fac109fa4b

View File

@@ -127,7 +127,7 @@ calc_face_normal(const Point& _p0,
// The expression ((n *= (1.0/norm)),n) is used because the OpenSG // The expression ((n *= (1.0/norm)),n) is used because the OpenSG
// vector class does not return self after component-wise // vector class does not return self after component-wise
// self-multiplication with a scalar!!! // self-multiplication with a scalar!!!
return (norm != Scalar(0)) ? ((n *= (Scalar(1)/norm)),n) : Normal(0,0,0); return (norm != typename Normal::value_type(0)) ? ((n *= (typename Normal::value_type(1)/norm)),n) : Normal(0,0,0);
#else #else
Point p1p0 = _p0; p1p0 -= _p1; Point p1p0 = _p0; p1p0 -= _p1;
Point p1p2 = _p2; p1p2 -= _p1; Point p1p2 = _p2; p1p2 -= _p1;