Parcourir la source

Added Mat3 * Rect.

Mark Sibly il y a 7 ans
Parent
commit
bef3c66047
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      modules/std/geom/affinemat3.monkey2

+ 6 - 0
modules/std/geom/affinemat3.monkey2

@@ -72,6 +72,12 @@ Struct AffineMat3<T>
 		Return New Vec2<T>( i.x*v.x + j.x*v.y + t.x , i.y*v.x + j.y*v.y + t.y )
 		Return New Vec2<T>( i.x*v.x + j.x*v.y + t.x , i.y*v.x + j.y*v.y + t.y )
 	End
 	End
 	
 	
+	#rem monkeydoc Multiplies a rect by the matrix.
+	#end
+	Operator*:Rect<T>( r:Rect<T> )
+		Return New Rect<T>( Self * r.min,Self * r.max )
+	End
+	
 	#rem monkeydoc Multiplies the matrix by another matrix.
 	#rem monkeydoc Multiplies the matrix by another matrix.
 	#end
 	#end
 	Operator*:AffineMat3( m:AffineMat3 )
 	Operator*:AffineMat3( m:AffineMat3 )