Sign in to follow this  
kirenemook12

Impulse direction at a collision

Recommended Posts

Hello everyone,

I am trying to make a good collision response for a game. I found at this site([url="http://www.euclideanspace.com/physics/dynamics/collision/threed/index.htm"]http://www.euclideanspace.com/physics/dynamics/collision/threed/index.htm[/url]) a little something to get me on my way.
however, I need a normal vector n, which is the direction of the impulse. I don't know how to calculate that.

so my question is: how do I calculate the direction of a impulse at a collision?

they said that it is dependent of the friction of the objects.
my game is 3D, and rotation can occur.
I have some basic knowledge of vector algebra and matrix algebra, but not that much.

Share this post


Link to post
Share on other sites
I think Wikipedia provides sufficient ways to find impulse:

[url="http://en.wikipedia.org/wiki/Impulse_(physics)"]http://en.wikipedia....pulse_(physics)[/url]

As it mentions, Impulse is the the net change in Momentum over time (if you don't know Calculus, it's the one that uses F inside the integral symbol). You can substitute the definition of Force and using calculus reduce it to the change in momentum (dp/dt means change in momentum with respect to time). Using substitution again, you can get impulse by multiplying your change in velocity by mass, provided the mass of your object does not change over time.

If you know what a vector is, then you can easily find it's unit vector. Basically, a unit vector is a vector with magnitude of 1 unit and can be found by taking the vector and dividing it by sqrt( v1^2 + v2^2 ). The resulting vector has a length of 1 and points in the same direction as the original

EDIT: Fixed net change in Force over time to net change in momentum over time. Edited by boogyman19946

Share this post


Link to post
Share on other sites
I need to know in what direction that impulse will be, and if it has a angular velocity and collides in to something, it will get a impulse too.
this site says that that direction of impulse is not only dependent of (angular) velocity, but also of friction, and maybe the orientation of the plane of contact . I need to know how to calculate that normal vector.

i only know how everything is before the collision. how it is after the collision needs to be calculated.

Share this post


Link to post
Share on other sites
Oops, sorry about that, I misread "normal vector" as unit vector XD That is entirely my fault.

Hmm, this probably isn't a topic that I can explain well. I guess you'll have to wait for someone who knows more than I do.

However, if you know what the plane of contact is, you can get two vectors that are coplanar and use the cross-product to get a vector that's orthogonal to both and it's going to be the normal vector of that plane. Be careful, however, about the order in which you cross the two vectors as the operation is not commutative (that is A x B != B x A). While the normal vectors will be on the same line, they will point in the opposite directions of each other. Edited by boogyman19946

Share this post


Link to post
Share on other sites
There are multiple ways to approach this.

You could go for continuous collision detection (what Bullet is doing) and prevent objects from interpenetrating from the get go. Collision Response is pretty easy then by just using basic Newtonian physics.

Or you could use hacks like extruding objects and having discrete time steps or even use binary search over the time interval if you need objects with angular momentum. Collision response could just be pushing the object back out and reversing the velocity's direction in this case.

Share this post


Link to post
Share on other sites
I want to go for the first option( prevention of interpenetrating), but i don't know how to do that. I have continuous collision detection, i know how deep they penetrate, but i don't know how to calculate a correct impulse from that.

Share this post


Link to post
Share on other sites
The impulse direction is always the same direction as the normal.

If you have friction, that impulse is always in the plane tangential to the normal.

Compute them separately. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this