I m在Farseer物理学发动机(使用XNA)中,有点麻烦地轮流使用一种纤维。 基本,即有固定装置,即:
private void setUpPhysics(World gWorld, Vector2 position)
{
body = new Body(gWorld);
body.BodyType = BodyType.Dynamic;
carFixture = FixtureFactory.AttachRectangle(ConvertUnits.ToSimUnits(21f), ConvertUnits.ToSimUnits(35f), 5f, ConvertUnits.ToSimUnits(position), body);
carFixture.Restitution = 4f;
carFixture.Friction = 5f;
carFixture.Body.AngularDamping = 1f;
carFixture.Body.LinearDamping = 1f;
}
Which i then rotate using the code
carFixture.Body.Rotation -= 0.01f;
Which works fine. The problem is, it always rotates around the top left corner of the rectangle, and i need it to rotate round the center. How would i go about rotating the fixture around it s center? (I apologize for my stupidity - i m new to Farseer / Box2D and i have no doubt it is the major cause of this problem, but i ve been searching the internet for a good few hours now and have found nothing.)