2
0
ShiroSmith 6 жил өмнө
parent
commit
85980a02c0
2 өөрчлөгдсөн 11 нэмэгдсэн , 0 устгасан
  1. 7 0
      h3d/Matrix.hx
  2. 4 0
      h3d/col/Point.hx

+ 7 - 0
h3d/Matrix.hx

@@ -45,6 +45,13 @@ class Matrix {
 	inline function set_ty(v) return _42 = v;
 	inline function set_tz(v) return _43 = v;
 
+	public function equal( other : Matrix ) {
+		return	_11 == other._11 && _12 == other._12 && _13 == other._13 && _14 == other._14
+			&& 	_21 == other._21 && _22 == other._22 && _23 == other._23 && _24 == other._24
+			&& 	_31 == other._31 && _32 == other._32 && _33 == other._33 && _34 == other._34
+			&& 	_41 == other._41 && _42 == other._42 && _43 == other._43 && _44 == other._44;
+	}
+
 	public function zero() {
 		_11 = 0.0; _12 = 0.0; _13 = 0.0; _14 = 0.0;
 		_21 = 0.0; _22 = 0.0; _23 = 0.0; _24 = 0.0;

+ 4 - 0
h3d/col/Point.hx

@@ -29,6 +29,10 @@ class Point {
 		this.z = z;
 	}
 
+	public inline function multiply( f : Float ) {
+		return new Point(x * f, y * f, z * f);
+	}
+
 	public inline function sub( p : Point ) {
 		return new Point(x - p.x, y - p.y, z - p.z);
 	}