我是Farseer库的新手,我尝试使用Farseer制作C#表单应用程序。我创建了一个表单,在表单上放置了一个地板,然后从表单顶部向下拖放一个矩形。该块似乎下降,但它不会因重力而加速。我相信这是我没有设置的东西,但是对于我的生活,我无法弄清楚,希望有人可能指引我走向正确的方向。重力加速有助于重力?
在此先感谢您的帮助,
杰夫
==============================重要的代码=================================
World world = new World(new Vector2(0.0f, 0.1f));
//Floor
Body floor = BodyFactory.CreateRectangle(world, 10000.0f, 30.0f, 100, new Vector2(0.0f, Height));
floor.BodyType = BodyType.Static;
// Block
Body Block1 = BodyFactory.CreateRectangle(world, 100.0f, 10.0f, 100, new Vector2(Width/2, 0));
Block1.BodyType = BodyType.Dynamic;
//(The step here is called when I timer goes off every .01/second)
//Step the world a 10th of a second.
world.Step((float).01f);
//(I draw the object this way)
gr.TranslateTransform(body.Position.X, body.Position.Y);
gr.RotateTransform((float)((body.Rotation *360)/(2*Math.PI)));
gr.FillRectangle(SystemBrushes.ButtonFace, -size.Width/2.0f, -size.Height/2.0f, size.Width, size.Height);
gr.ResetTransform();