vector math question

lringlet
Posts: 2
Joined: Tue Feb 09, 2010 9:29 am

vector math question

Post by lringlet »

Hi all
I come across a problem about vector math:
Matrix4 view,projection,viewprojection;
....
viewprojection = view*projection;

But the operator* of Matrix4 is optimized by sse,
only when the elem _14=_24=_34=0.0f and _44 =1.0 ,the multiply value is correct.
Does the Matrix4 support multiply method like this:

for(s32 i = 0 ; i < 4 ; i++)
{
for(s32 j = 0 ; j < 4 ; j++)
{
Out.m[j] =
m[0]*mat.m[0][j] +
m[1]*mat.m[1][j] +
m[2]*mat.m[2][j] +
m[3]*mat.m[3][j];
}
}
?
Thanks