Browse Source

Added Box=AffineMat4*Box Operator*.

Mark Sibly 7 years ago
parent
commit
b65e95fe2d
1 changed files with 10 additions and 0 deletions
  1. 10 0
      modules/std/geom/affinemat4.monkey2

+ 10 - 0
modules/std/geom/affinemat4.monkey2

@@ -110,6 +110,16 @@ Struct AffineMat4<T>
 			m.i.y*v.x+m.j.y*v.y+m.k.y*v.z+t.y,
 			m.i.z*v.x+m.j.z*v.y+m.k.z*v.z+t.z )
 	End
+	
+	#rem monkeydoc Multiplies a box by the matrix.
+	#end
+	Operator*:Box<T>( box:Box<T> )
+		Local r:=Box<T>.EmptyBounds
+		For Local i:=0 Until 8
+			r|=Self * box.Corner( i )
+		Next
+		Return r	
+	End
 
 	#rem monkeydoc Applies a translation transformation to the matrix.
 	#end