Jump to content
  • Advertisement
Sign in to follow this  
Uthman

impulse

This topic is 4642 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

just about all of the static collision response ive seen work like this 9more or less) 1. get orthagonal component of objects velocity to intersecting plane 2. add the -orth velocity to the objects velocity, in effect causing the velocity along the normal of impact =0 3. find out how far the object 'accidentially' intersected the plane 4. move the object out of the plane onto its correct position 'onto' it. i want to model collision response based on forces, but im having a major issue. according to my understanding, when a mass impacts the ground, a normal force / impulse acts upon it keeping it from falling through the floor polygon. this impulse force is calculated by taking the time derivative of momentum which is added to the force of the object; this way the impulse force pushing back up on the object is equal to the force the object exerts on the ground. in my engine i have impulse = dP/dt. because of this force, the object stop's moving. now, my problem is this: to calculate dP/dt, i need to know how mdV. the velocity, however, wont change until there is an impact. but in order to cause an impact, i need the velocity to change? how can i exert a normal/impulse force on the object to change its velocity if that force requires the velocity has changed to evne exist?

Share this post


Link to post
Share on other sites
Advertisement
haha, thanks again.

i fully got impulse only based collision detection and response working in both my game and my friends game. =) productive afternoon. the site's description was very straight forward. in case anyone else wanted to also do it, here is the excerpt i followed:

Per Timestep
1. Get all forces acting on the bodies.
2. Integrate velocity using the forces. Use the new velocities integrate positions.
3. Detect collisions & calculate impulses (ideally a swept test from old positions to new ones...
4. Restore positions and velocity to their original values.
------

From there, I just added the impulse force to the all the other forces acting upon the bodies and did the integration over. it works great! This guy, however, goes on a little more complex route to be able to stack objects, etc.

5. Process all collisions and constraints using impulses, iterating a few times over the list. These impulses update the velocities, but not the positions, of course.
6. Integrate the velocities (again) using the forces.
7. Process all collisions and constraints using impulses again, except now treat all collisions as inelastic, iterating a few times over the list.
8. Do a "shock" step - This allows objects to stack up even when the number of iterations in the previous steps is small.
9. Integrate the positions using the new velocities.




its very methodological so its not bad at all to do.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!