Added a NormalizedDirection method

This commit is contained in:
Paolo Cignoni 2012-05-05 14:54:45 +00:00
parent 5dbe87d368
commit 7537b20933
1 changed files with 6 additions and 4 deletions

View File

@ -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<ScalarType> BBox( ) const
{ Box3<ScalarType> 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];}