From 9163d261f774462e0cf4e8343ec435fe3f06c08f Mon Sep 17 00:00:00 2001 From: dibenedetto Date: Mon, 26 Sep 2005 19:49:30 +0000 Subject: [PATCH] Method Set(off, dir) now correctly normalizes direction and offset if template parameter NORM is set. --- vcg/space/plane3.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/vcg/space/plane3.h b/vcg/space/plane3.h index 6b6c0e0d..b3a789f5 100644 --- a/vcg/space/plane3.h +++ b/vcg/space/plane3.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.7 2005/03/18 16:34:42 fiorin +minor changes to comply gcc compiler + Revision 1.6 2004/10/09 13:48:02 ponchio Fixed bug in init. @@ -109,8 +112,15 @@ public: } /// sets origin and direction. void Set( const ScalarType & off, const PointType & dir ) { - SetOffset(off); - SetDirection(dir); + if (NORM) { + const ScalarType normFactor = dir.Norm(); + this->_dir = dir / normFactor; + this->_offset = off / normFactor; + } + else { + this->_offset = off; + this->_dir = dir; + } } void Set( const PointType & dir, const ScalarType & off) {Set(off,dir);}