Jul 16, 2010 at 6:35 PM
Edited Jul 17, 2010 at 5:46 PM
I am part of a team at Dare to be Digital.
We are using Farseer Physics 2.1.3 in a game for the Windows Phone 7.
Everything is going well, but we seem to have run into a problem with applying Torque to an object.
What we are doing is creating a rotating windmill. The body and geometry are created from vertices, generated from a texture. Here is the code for it:
body = BodyFactory.Instance.CreatePolygonBody(vertices, 1f); // vertices generate from texture
body.Position = this.position;
origin = vertices.GetCentroid();
geom = GeomFactory.Instance.CreatePolygonGeom(body, vertices, 0);
JointFactory.Instance.CreateFixedRevoluteJoint(simulator, body, body.Position + origin);
Here is what we have in the update:
We have tried this with different combinations of torque and RotationalDragCoefficient but that doesn't seem to affect it at all, even if we apply no torque. We also tried directly changing the body.Rotation value, that didn't work either.
The only thing that does happen is that it turns ~180 degrees CW and then CCW and doesn't stop or change pace. It's been a problem that has been baffling us for a while.
Thanks in advance for any suggestions.