RigidBody3D acceleration calculation

Godot Version

4.2.1

Question

Hi, through trial and error, I’ve discovered that both Godot physics and Jolt plugin calculate the inertial force on a RigidBody3D as (pos - pos_last)/delta^2 * mass. My question is why? This doesn’t seem like a proper way to approximate a second derivative of position. Is this the norm in physics engines? Shouldn’t it be documented somewhere?


Isn’t it a normal way to calculate force?
Or does the problem lies in calculation approximating acceleration by just using double delta?
(I am not that knowledgeable on physics engines myself)

Thanks for replying. Yeah, the acceeration formula seems weird. Full disclosure my math is terrible.

1 Like

Actually, dont we already have velocity in PhysicsBodies? It would be easier to use delta velocity instead of delta position. I wish i would be better at reading source code to see how its implemented

There is a velocity in a PhysicsBody and I’m using it. I ran into this trying to calculate a force that would counter bodys current inertia, thus keeping it in place ( tire grip ). The velocity property on a PhysicsBody roughly corresponds to (global_position - global_position_last)/delta ( I need to figure out how that is done in engine ), however, the PhysicsBody is only kept in place by a force of -linear_velocity/delta * mass (as I say in the original post ).