Collision Force?
by Jason Cahill · in Torque Game Builder · 05/06/2006 (6:05 pm) · 3 replies
I don't know if there's already a way to do this or not... I am trying to figure out the force of a collision. I can get the collision normal, but it's a normalized unit vector. When I ask the source object for it's velocity and it tells me the rate it would like to move at as opposed to the speed it's really moving at.
Here's the scenario: I'm driving a tank up to a wall at full speed. It hits the wall. The collision force should be tremendous. How do I get that? Case #2: I park a tank in front of a wall, then step on the gas and drive into the wall at very low speed. The collision force should be much lower. How do I get that?
Thanks for any insights you can provide!
Here's the scenario: I'm driving a tank up to a wall at full speed. It hits the wall. The collision force should be tremendous. How do I get that? Case #2: I park a tank in front of a wall, then step on the gas and drive into the wall at very low speed. The collision force should be much lower. How do I get that?
Thanks for any insights you can provide!
About the author
#2
05/07/2006 (11:58 pm)
Thanks Marc. That helps. I can certainly compute this myself, but it really seems like something that should be available as a parameter in onCollision. For example, the collision normal should be both magnitude and direction... To get what we have today, you'd simply normalize the collision normal. However, if you wanted collision force, you could take the vector length. Just a suggestion to Melv and crew.
#3
But it would sure not be bad if there was a value for impact impulse or something similar.
05/08/2006 (12:04 am)
Reason for the collision normal is that you need it to compute the "reflected direction" (for example BOUNCE), as you need to project the current direction onto the normal and calculate that way the reflected direction. Don't know if it would be a usefull thing letting it return something non-normalized as it might be used internally as well.But it would sure not be bad if there was a value for impact impulse or something similar.
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
If the tank is fully stoped at the wall, the whole impulse must be transfered to the wall ... so if it is destructable, it will break and fly away at least partially.