Added a NormalizedDirection method
This commit is contained in:
parent
5dbe87d368
commit
7537b20933
|
@ -112,10 +112,12 @@ public:
|
||||||
{ return _p0 + (_p1 - _p0) * t; }
|
{ return _p0 + (_p1 - _p0) * t; }
|
||||||
/// return the middle point
|
/// return the middle point
|
||||||
inline PointType MidPoint( ) const
|
inline PointType MidPoint( ) const
|
||||||
{ return ( _p0 + _p1) / ScalarType(2.0) ; }
|
{ return ( _p0 + _p1) / ScalarType(2.0) ; }
|
||||||
inline PointType Direction( ) const
|
inline PointType Direction( ) const
|
||||||
{ return ( _p1 - _p0) ; }
|
{ return ( _p1 - _p0) ; }
|
||||||
/// return the bounding box
|
inline PointType NormalizedDirection( ) const
|
||||||
|
{ return ( _p1 - _p0).Normalize() ; }
|
||||||
|
/// return the bounding box
|
||||||
inline Box3<ScalarType> BBox( ) const
|
inline Box3<ScalarType> BBox( ) const
|
||||||
{ Box3<ScalarType> t;
|
{ 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];}
|
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];}
|
||||||
|
|
Loading…
Reference in New Issue