Hello everyone,
I am trying to make a good collision response for a game. I found at this site(http://www.euclideanspace.com/physics/dynamics/collision/threed/index.htm) 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.
Impulse direction at a collision
I think Wikipedia provides sufficient ways to find impulse:
http://en.wikipedia....pulse_(physics)
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.
http://en.wikipedia....pulse_(physics)
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.
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.
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.
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.
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.
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.
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.
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.
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.
If you have friction, that impulse is always in the plane tangential to the normal.
Compute them separately.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement