Geometry/Body problems

Topics: User Forum
Oct 3, 2008 at 2:51 AM
Edited Oct 3, 2008 at 2:51 AM
I'm having trouble making a collision geometry for a rectangle

Example:

Body

benchBody = BodyFactory.Instance.CreateRectangleBody(physicsSimulator, 782, 10, 6);

 

Geom

benchGeom = GeomFactory.Instance.CreateRectangleGeom(physicsSimulator, benchBody, 782, 10);

 

 


benchBody.Position = new Vector2(0, 604);

It makes the 0,604 the center of the Body, instead of the beginning. Is this always the case? Or am I doing something wrong?

 

Coordinator
Oct 3, 2008 at 2:54 AM
XNA normally uses the upper left corner as the relative point. Farseer Physics uses the center of objects as the relative point, so it's perfectly normal. Have a look at the samples included in Farseer, they are really good for learning Farseer Physics.
Oct 3, 2008 at 3:07 AM
Alright, that explains alot. Thanks