Help with translation from b2d --> xna

Topics: User Forum
Oct 5, 2010 at 4:03 PM

 Hi,

Im trying to duplicate two lines of code from a function made with box2d/flash, and i cant find the equivalent/translation in farseer 3.0

Can anyone help me with this?

The code is:

var sidewaysAxis = targetBody.GetXForm().R.col2.Copy();
sidewaysAxis.Multiply(b2Math.b2Dot(velocity,sidewaysAxis));

(velocity is targetbody.GetLinearVelocityFromLocalPoint(vector2.zero);)

Thanks for your help!

Coordinator
Oct 5, 2010 at 4:39 PM

I'm not sure about the Copy(), you will have to look at the Box2D flash source for that.

The GetXForm() method is named GetTransform(out transform) in FPE 3.0

b2Math.b2Dot()'s equivalent is Vector2.Dot().

Oct 7, 2010 at 2:13 PM

Thanks! Got it working now.