]> git.mxchange.org Git - simgear.git/blobdiff - simgear/math/SGTriangle.hxx
cppbind.Ghost: clean up a bit
[simgear.git] / simgear / math / SGTriangle.hxx
index bc395ab9cfdce4b41b0e6d4134ecf5789f505d70..777b378869e50e921aec0203eb4050f7dda2e4d3 100644 (file)
@@ -16,7 +16,7 @@
 //
 
 #ifndef SGTriangle_H
-#define SGTrianlge_H
+#define SGTriangle_H
 
 template<typename T>
 class SGTriangle {
@@ -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