Hi,
Im trying to translate two lines of flash/box2d into c#/xna, but coming up short, is there anyone here who can help me?
The two lines im trying to translate are:
and the best i can come up with are:
so far so good, but the last line
dont really work.. can anyone here please help me with this last line... im tearing my hair out soon.
Thanks in advance!
Im trying to translate two lines of flash/box2d into c#/xna, but coming up short, is there anyone here who can help me?
The two lines im trying to translate are:
Code:
var sidewaysAxis = targetBody.GetXForm().R.col2.Copy();
sidewaysAxis.Multiply(b2Math.b2Dot(velocity,sidewaysAxis));
sidewaysAxis.Multiply(b2Math.b2Dot(velocity,sidewaysAxis));
and the best i can come up with are:
Code:
Transform tmp;
targetBody.GetTransform(out tmp);
sidewaysAxis = tmp.R.col2;
targetBody.GetTransform(out tmp);
sidewaysAxis = tmp.R.col2;
so far so good, but the last line
Code:
sidewaysAxis = Vector2.Multiply(Vector2.Dot(velocity, sidewaysAxis));
dont really work.. can anyone here please help me with this last line... im tearing my hair out soon.
Thanks in advance!