From 7537b209332d36b4f1a33689db3599c199877a32 Mon Sep 17 00:00:00 2001 From: cignoni Date: Sat, 5 May 2012 14:54:45 +0000 Subject: [PATCH] Added a NormalizedDirection method --- vcg/space/segment3.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vcg/space/segment3.h b/vcg/space/segment3.h index d22c6e78..57f258a0 100644 --- a/vcg/space/segment3.h +++ b/vcg/space/segment3.h @@ -112,10 +112,12 @@ public: { return _p0 + (_p1 - _p0) * t; } /// return the middle point inline PointType MidPoint( ) const - { return ( _p0 + _p1) / ScalarType(2.0) ; } - inline PointType Direction( ) const - { return ( _p1 - _p0) ; } - /// return the bounding box + { return ( _p0 + _p1) / ScalarType(2.0) ; } + inline PointType Direction( ) const + { return ( _p1 - _p0) ; } + inline PointType NormalizedDirection( ) const + { return ( _p1 - _p0).Normalize() ; } + /// return the bounding box inline Box3 BBox( ) const { Box3 t; if (_p0[0]<_p1[0]) { t.min[0]=_p0[0];t.max[0]=_p1[0];} else { t.min[0]=_p1[0];t.max[0]=_p0[0];}