•      Sign In
• Create Account

# Impulse direction at a collision

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

9 replies to this topic

### #1kirenemook12  Members   -  Reputation: 103

Like
0Likes
Like

Posted 28 April 2012 - 07:41 AM

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.

Sponsor:

### #2boogyman19946  Members   -  Reputation: 625

Like
0Likes
Like

Posted 28 April 2012 - 08:48 AM

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.

Edited by boogyman19946, 28 April 2012 - 09:40 AM.

"If highly skilled generalists are rare, though, then highly skilled innovators are priceless." - ApochPiQ

My personal links
- Khan Academy - For all your math needs
- Java API Documentation - For all your Java info needs
- C++ Standard Library Reference - For some of your C++ needs ^.^

### #3kirenemook12  Members   -  Reputation: 103

Like
0Likes
Like

Posted 28 April 2012 - 09:00 AM

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.

### #4boogyman19946  Members   -  Reputation: 625

Like
0Likes
Like

Posted 28 April 2012 - 09:40 AM

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, 28 April 2012 - 09:51 AM.

"If highly skilled generalists are rare, though, then highly skilled innovators are priceless." - ApochPiQ

My personal links
- Khan Academy - For all your math needs
- Java API Documentation - For all your Java info needs
- C++ Standard Library Reference - For some of your C++ needs ^.^

### #5Mihai Moldovan  Members   -  Reputation: 127

Like
0Likes
Like

Posted 30 April 2012 - 06:21 PM

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.

### #6kirenemook12  Members   -  Reputation: 103

Like
0Likes
Like

Posted 01 May 2012 - 08:06 AM

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.

### #7wildbunny  Members   -  Reputation: 385

Like
0Likes
Like

Posted 01 May 2012 - 03:59 PM

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.

### #8kirenemook12  Members   -  Reputation: 103

Like
0Likes
Like

Posted 02 May 2012 - 06:41 AM

what normal do you mean?
how do you mean tangential to the normal?

Edited by kirenemook12, 02 May 2012 - 06:58 AM.

### #9wildbunny  Members   -  Reputation: 385

Like
0Likes
Like

Posted 07 May 2012 - 01:32 PM

The collision normal.

Friction acts in the plane tangential to the collision normal.

### #10kirenemook12  Members   -  Reputation: 103

Like
0Likes
Like

Posted 08 May 2012 - 06:20 AM

thanks, i got it now

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS