]> git.mxchange.org Git - simgear.git/blobdiff - simgear/math/SGTriangle.hxx
cmake: add option to disable building tests
[simgear.git] / simgear / math / SGTriangle.hxx
index bc395ab9cfdce4b41b0e6d4134ecf5789f505d70..af6f32f14b8404145465e5bc58e53a34f8aac333 100644 (file)
@@ -71,6 +71,16 @@ public:
     _d[0] = _d[1];
     _d[1] = tmp;
   }
+
+  SGTriangle<T> transform(const SGMatrix<T>& matrix) const
+  {
+    SGTriangle<T> 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