X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmath%2FSGTriangle.hxx;h=af6f32f14b8404145465e5bc58e53a34f8aac333;hb=914d3e6a2b323cf9f186cbef2aef7865ea07b309;hp=bc395ab9cfdce4b41b0e6d4134ecf5789f505d70;hpb=19bc1e6313e889f89e44ee8d9429c84224f41e4f;p=simgear.git diff --git a/simgear/math/SGTriangle.hxx b/simgear/math/SGTriangle.hxx index bc395ab9..af6f32f1 100644 --- a/simgear/math/SGTriangle.hxx +++ b/simgear/math/SGTriangle.hxx @@ -71,6 +71,16 @@ public: _d[0] = _d[1]; _d[1] = tmp; } + + SGTriangle transform(const SGMatrix& matrix) const + { + SGTriangle triangle; + triangle._v0 = matrix.xformPt(_v0); + triangle._d[0] = matrix.xformVec(_d[0]); + triangle._d[1] = matrix.xformVec(_d[1]); + return triangle; + } + private: /// Store one vertex directly, _d is the offset of the other two /// vertices wrt the base vertex