what happened to Transform#[]( coords#[] )

Monkey Forums/Monkey Programming/what happened to Transform#[]( coords#[] )

dmaz(Posted 2012) [#1]
somewhere along the lines Transform#[]( coords#[] ) disappeared from mojo.graphics. I guess I should now do GetMatrix and do the multiplication myself?

speaking of which, can we have an overloaded GetMatrix so that it doesn't have to allocate a new array each time? i.e. GetMatrix( m#[] )?


NoOdle(Posted 2012) [#2]
I just checked mojo.graphics and Transform, Translate, Scale, Rotate, InvTransform, GetMatrix and SetMatrix are all there on my computer V63...


dmaz(Posted 2012) [#3]
actually for Transform and GetMatrix 63b only has

Transform( m#[] )
Transform( ix#,iy#,jx#,jy#,tx#,ty# )
GetMatrix#[]()

graphics.monkey used to have

Transform#[]( coords#[] )
as well, but I no longer need it.

I'd like to see

GetMatrix( m#[] )
added...


NoOdle(Posted 2012) [#4]
you could for now just add this to the bottom of mojo.graphics
[monkeycode]
Function GetMatrix : Void( m : Float[] )
m[ 0 ] = context.ix
m[ 1 ] = context.iy
m[ 2 ] = context.jx
m[ 3 ] = context.jy
m[ 4 ] = context.tx
m[ 5 ] = context.ty
End Function
[/monkeycode]


dmaz(Posted 2012) [#5]
yes, that's what I've been doing since the beginning... it's a valuable performance tweak I believe should just be in there especially since we have separate update and render functions.