From b240c21f7c4e0635d765719c6170efa85b15f86c Mon Sep 17 00:00:00 2001 From: Hans-Christian Ebke Date: Mon, 19 Mar 2012 08:25:50 +0000 Subject: [PATCH] Added normalized() to VectorT. git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@557 fdac6126-5c0c-442c-9429-916003d36597 --- src/OpenMesh/Core/Geometry/VectorT_inc.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/OpenMesh/Core/Geometry/VectorT_inc.hh b/src/OpenMesh/Core/Geometry/VectorT_inc.hh index 9aa538a9..928ccbf9 100644 --- a/src/OpenMesh/Core/Geometry/VectorT_inc.hh +++ b/src/OpenMesh/Core/Geometry/VectorT_inc.hh @@ -426,6 +426,14 @@ public: return *this; } + /** return normalized vector + */ + + inline const vector_type normalized() const + { + return *this / norm(); + } + /** normalize vector, return normalized vector and avoids div by zero */ inline vector_type& normalize_cond()