DT with physics

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

DT with physics

Post by Coder567 »

Hi I have a simple question.

When using functions such as Body:applyForce do I need to multiply the x & y with dt? As in love.update(dt). Or is it automatically applied?

thanks!
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

Re: DT with physics

Post by pgimeno »

Automatically applied.
Coder567
Prole
Posts: 42
Joined: Sun Apr 07, 2019 12:32 pm

Re: DT with physics

Post by Coder567 »

thanks ! :)
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: DT with physics

Post by ivan »

If you are using a fixed time step it might work - since you are applying the force at equal intervals. In all other cases you are bound to get inconsistent results.
Force is "mass*acceleration" where acceleration is "change in velocity/time" so time definitely plays a role with forces...

As opposed to forces, impulses don't need to use "delta".
Time is irrelevant for impulses because the impulse is strictly a "change in velocity*mass".

Impulses are used to change the velocity at specific points in time as opposed to forces which are used continuously over time.
Post Reply

Who is online

Users browsing this forum: No registered users and 163 guests