Browse Source

added getInverse()

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

+ 6 - 0
h3d/Matrix.hx

@@ -347,6 +347,12 @@ class Matrix {
 		initInverse(this);
 		initInverse(this);
 	}
 	}
 
 
+	public function getInverse( ?m : h3d.Matrix ) {
+		if( m == null ) m = new h3d.Matrix();
+		m.initInverse(this);
+		return m;
+	}
+
 	public inline function getDeterminant() {
 	public inline function getDeterminant() {
 		return _11 * (_22*_33 - _23*_32) + _12 * (_23*_31 - _21*_33) + _13 * (_21*_32 - _22*_31);
 		return _11 * (_22*_33 - _23*_32) + _12 * (_23*_31 - _21*_33) + _13 * (_21*_32 - _22*_31);
 	}
 	}