Browse Source

added toMatrix2D

Nicolas Cannasse 4 years ago
parent
commit
5131e477fa
1 changed files with 11 additions and 0 deletions
  1. 11 0
      h3d/Matrix.hx

+ 11 - 0
h3d/Matrix.hx

@@ -738,6 +738,17 @@ class Matrix {
 		if( col.gain != null ) colorGain(col.gain.color, col.gain.alpha);
 	}
 
+	public inline function toMatrix2D( ?m : h2d.col.Matrix ) {
+		if( m == null ) m = new h2d.col.Matrix();
+		m.a = _11;
+		m.b = _12;
+		m.c = _21;
+		m.d = _22;
+		m.x = tx;
+		m.y = ty;
+		return m;
+	}
+
 	// STATICS
 
 	public static function I() {