Help w Xna translation of one line

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:
Code:
var sidewaysAxis = targetBody.GetXForm().R.col2.Copy();
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;


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!
What do you mean by 'don't really work'? Are you getting a compiler error?

I just took a quick look at the XNA docs, and I didn't see an overload for Multiply() that takes a single scalar (since the method is static, I'm not sure what such an overload would accomplish anyway).

It looks to me like you probably want something like this:

Code:
sidewaysAxis = Vector2.Multiply(sidewaysAxis, Vector2.Dot(velocity, sidewaysAxis));

Or, if the XNA math library includes overloaded operators:

Code:
sidewaysAxis *= Vector2.Dot(velocity, sidewaysAxis);

Original thread: https://box2d.org/forum/viewtopic.php?t=5675