From 3183ac536401611e5b3b70572edc1fd38c07e06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= <moebius@cs.rwth-aachen.de> Date: Mon, 24 Oct 2016 16:34:05 +0200 Subject: [PATCH] Warning fixed --- src/OpenMesh/Core/Mesh/PolyMeshT.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT.cc b/src/OpenMesh/Core/Mesh/PolyMeshT.cc index 3c66808e..e77c0ba8 100644 --- a/src/OpenMesh/Core/Mesh/PolyMeshT.cc +++ b/src/OpenMesh/Core/Mesh/PolyMeshT.cc @@ -136,9 +136,12 @@ PolyMeshT<Kernel>::calc_face_normal_impl(FaceHandle _fh, PointIs3DTag) const const Point a = this->point(*fv_it) - this->point(*fv_itn); const Point b = this->point(*fv_it) + this->point(*fv_itn); - n[0] += a[1] * b[2]; - n[1] += a[2] * b[0]; - n[2] += a[0] * b[1]; + + // Due to traits, the value types of normals and points can be different. + // Therefore we cast them here. + n[0] += static_cast<typename Normal::value_type>(a[1] * b[2]); + n[1] += static_cast<typename Normal::value_type>(a[2] * b[0]); + n[2] += static_cast<typename Normal::value_type>(a[0] * b[1]); } const typename vector_traits<Normal>::value_type norm = n.length(); -- GitLab