X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmath%2FSGLineSegment.hxx;h=c3121c62bba979c796910840dd86f9665447c63f;hb=3cd4c5566f8c418bc9bbb6026072eb0192027993;hp=0e509621856a2c238373aada3b6f59ca26be9523;hpb=d11954e80c9e62f87da087b29f6bfb7a6d7e84b5;p=simgear.git diff --git a/simgear/math/SGLineSegment.hxx b/simgear/math/SGLineSegment.hxx index 0e509621..c3121c62 100644 --- a/simgear/math/SGLineSegment.hxx +++ b/simgear/math/SGLineSegment.hxx @@ -48,6 +48,14 @@ public: SGVec3 getCenter() const { return _start + T(0.5)*_direction; } + SGLineSegment transform(const SGMatrix& matrix) const + { + SGLineSegment lineSegment; + lineSegment._start = matrix.xformPt(_start); + lineSegment._direction = matrix.xformVec(_direction); + return lineSegment; + } + private: SGVec3 _start; SGVec3 _direction;