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];}