Page 1 of 1

Physics and dt

Posted: Sat Apr 10, 2021 2:15 pm
by togFox
I will be using the physics engine in my next project and thought I'd check:

Code: Select all

Person[i].body:applyForce(intendedxforce,intendedyforce)
The applyForce method - should that be scaled by dt?

Code: Select all

Person[i].body:applyForce(intendedxforce * dt ,intendedyforce * dt)
?

I mean, is applyForce the force at any given time, meaning dt is irrelevant, or is applyForce the force per second in which case, dt becomes important?

Re: Physics and dt

Posted: Sat Apr 10, 2021 3:15 pm
by pgimeno
The force applied by applyForce should not be multiplied by dt in principle. It lasts the duration of dt that you pass to world:update(); if you want it to be applied for longer, you have to apply it multiple times.