1 Replies - 3106 Views - Last Post: 07 September 2012 - 10:34 PM

#1 byrandomby1  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 124
  • Joined: 08-March 11

Farseer Physics move body

Posted 25 August 2012 - 09:36 PM

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



The maximum speed of the body is 2 pixels per step, regardless of the velocity / step value.

Why is this so?

Is This A Good Question/Topic? 0
  • +

Replies To: Farseer Physics move body

#2 LiberLogic969  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 34
  • View blog
  • Posts: 85
  • Joined: 03-September 12

Re: Farseer Physics move body

Posted 07 September 2012 - 10:34 PM

Have you tried to use the body.ApplyForce() or body.ApplyLinearImpulse() methods instead of setting the LinearVelocity? Why are you passing the world.step 10?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1