views:

63

answers:

1

Hello guys, currently I'm developing a simple game which uses physics engine (Farseer for XNA).

I would like to ask how can I make the character so that he can walking on the ground, jumping on platform without rotating itself.

Because I need to update the body position and rotation, because it is a physics object so it will response like the usual which will rotate itself.

Anyone know how can I fix it?

+2  A: 

For Farseer 2.1 you can set:

body.MomentOfInertia = float.PositiveInfinity;

Farseer 3.0 appears to have a flag for fixed rotation, which appears to do the same thing internally:

body.FixedRotation = true;

Although I also set rotation to zero after the physics update, just to be sure:

body.Rotation = 0;

Don't be afraid to go in, after your physics update runs, and change any physics values you "don't like". Most games fake and fudge things quite a lot.

Andrew Russell