Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Farseer Physics move body

Started by byrandomby Aug 26, 2012 at 6:22 AM 0 replies 1.9k views
Original Post
byrandomby
byrandomby
[source lang="vb"]Imports FarseerPhysics.Dynamics
Imports FarseerPhysics.Factories
Imports Microsoft.Xna.Framework

Module Module1
Dim world As World
Dim body As Body
Dim WithEvents timer As New Timers.Timer(100)

Sub Main()
world = New World(Vector2.Zero)
body = BodyFactory.CreateRectangle(world, 1, 1, 1)
With body
.BodyType = BodyType.Dynamic
.LinearVelocity = New Vector2(10, 10)
End With
timer.Start()
Console.ReadLine()
End Sub

Private Sub timertick() Handles timer.Elapsed
world.Step(10)
Console.WriteLine(body.Position.ToString)
End Sub
End Module[/source]

The maximum speed of the body is 2 pixels per step, regardless of the velocity / step value.
Why is this so?
Opt7ons
Opt7ons
Perhaps you have pixels mixed up with meters? Farseer uses Meters/Kilos/Seconds.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.