MatrixF changes
by Brian Ramage · in Torque Game Engine Advanced · 06/30/2004 (5:34 pm) · 1 replies
With Marcelo's fix for the notorius "pink screen" bug for users of machines that do not have SSE support, some changes have occured to MatrixF that you guys should be aware of.
MatrixF::mul will assert if you attempt to call it with parameter that includes the "source" matrix. Ie. this is invalid:
OK, fine, but now you might want to know how the @#$* you are supposed to perform a pre-matrix multiply without explictly allocating a new matrix. The answer is we now offer operator overloads for * and *= with matrices. So now you can do:
or
or
But note that
is faster than:
On the other hand
is the same speed as:
MatrixF::mul will assert if you attempt to call it with parameter that includes the "source" matrix. Ie. this is invalid:
MatrixF foo, bar; foo.mul( bar, foo );The reason is that it will attempt to multiply bar by foo while it's overwriting foo. Rather than handle this case internally in the function, we assert (to keep MatrixF::mul speedy).
OK, fine, but now you might want to know how the @#$* you are supposed to perform a pre-matrix multiply without explictly allocating a new matrix. The answer is we now offer operator overloads for * and *= with matrices. So now you can do:
foo = bar * foo;
or
foo *= bar;
or
foo = bar * foo * bar;
But note that
A.mul( B, C );
is faster than:
A = B * C;
On the other hand
A.mul( B );
is the same speed as:
A *= B;
About the author
I have over 16 years of professional game development experience at both AAA studios like Dynamix, to indie studios like GarageGames and my own Black Jacket Games. I worked for 5 years at GarageGames as the lead developer on TGEA (precursor to T3D).
Torque Owner Westy