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

Forces and time

Started by yarniso Apr 27, 2004 at 3:24 AM 4 replies 1.2k views
Original Post
yarniso
yarniso
Hi all, I am trying to implement a rigid body dynamics simulator. While implementing a simple canon I was wondering about this: Say that I apply a force Fblast to the projectile for 25ms, but I use a timestep of 100ms. If I don''t do anything about this time difference, I will calculate the path of the projectile given a force Fblast for 100ms. But I have a feeling that I can''t just say that Fblast for 25ms = Fblast/4 for 100ms. How can you solve this. Decreasing the timestep is a solution, but are there any other solutions? Kind regards, Bart
oliii
oliii
what you are describing is a change in momentum, or an impulse. A force applied over time.

the change in momentum is

m * dV = Impulse = Force * dt

m : mass
dV : change in velocity
dt : delta time (25 ms)
Force : force applied other delta time

so, the change in velocity after the impulse is applied becomes

dV = (Force * dt) / m

the velocity after the force is applied is then simply

V = V + dV

Everything is better with Metal.
yarniso
yarniso
Ah, very clear. Thank you
shadow12345
shadow12345
How to you know what the applied force is when you have two objects with arbitrary velocities and masses and they collide? For instance, I'm shooting a ball, it bounces around the world and then collides with the player. I've decomposed the velocities into components normal to the collision plane, I've got coefficients for restitution(it's just perfectly elastic for ease of implementation right now), equations for impulse, but I have no clue what the applied impulse should be. Is it just the mass * velocity of one of the objects?

EDIT:
ack, I'm realizing this is more involved than I thought. i've got the equations, and to be honest you've told me enough, I'm just trying to figure out why the equations work and get a feel for what they really mean.

[edited by - shadow12345 on April 27, 2004 1:15:25 PM]
Why don't alcoholics make good calculus teachers?Because they don't know their limits!Oh come on, Newton wasn't THAT smart...
shadow12345
shadow12345
and how do you know acceleration? That's just the problem with this scenario:

you don't know the impulse 'force' and the new velocity at the same time, so you can't solve for the new position. You've got to solve for the impulse force using the coefficient of restitution equations, then calculate the new velocity (the 'acceleration') and then calculate the new position.

and what I asked earlier was this:
is the impulse equation the limit of the force equation as deltat approaches zero?

force = ma

impulse = mass * (v+ - v-)

acceleration = (vfinal - finitial) / deltaT

v+ = velocity after collision (unknown)
v- = velocity before collision

impulse force is also unknown when two arbitrary objects collide with an arbitrary velocity

[edited by - shadow12345 on April 29, 2004 8:11:06 PM]
Why don't alcoholics make good calculus teachers?Because they don't know their limits!Oh come on, Newton wasn't THAT smart...

Topic Locked

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

Sign in to reply to this topic.