Beta 1.1 Collision Bounce Bug
by Levin Beicht · in Torque Game Builder · 02/14/2006 (2:39 am) · 2 replies
Ok, i ran into this weird bug today.
For my asteroids I'm using setCollisionResponse(bounce);
This works fine if two objects are flying towards each other, they bounce off each other, exactly like they should. But if two objects are flying roughly in the same direction and the faster one catches up to the slower one, something weird happens...
As far as my knowledge in physics goes, the slower one should keep its direction and get faster and the faster one (depending on mass and restitution) should get slower or even change its direction.
(like in this applet, sry all text is german)
But the funny thing is, they both make a 180
For my asteroids I'm using setCollisionResponse(bounce);
This works fine if two objects are flying towards each other, they bounce off each other, exactly like they should. But if two objects are flying roughly in the same direction and the faster one catches up to the slower one, something weird happens...
As far as my knowledge in physics goes, the slower one should keep its direction and get faster and the faster one (depending on mass and restitution) should get slower or even change its direction.
(like in this applet, sry all text is german)
But the funny thing is, they both make a 180
#2
I tried around a little bit, and i saw that bounce mode is not dependent on any mass values, my bad.
but the collisions I get are different for different restitution-values. so the bounce-mode seems to use at least some of the material details, right?
that got me confused a little bit.
but the weird behavior as described above still seems to be a bug.
let me describe it a bit in detail.
lets say we have two objects. "object a" moving left with 10px per second. on the same height we got "object b", just right from object a and moving left with 20px per second. as you see, at some point "object b" will bounce into "object a", resulting in (and this is the weird part) "object b" moving right with about 20px per second and "object a" _also_ moving right with about 5px per second... so both object change their direction.
and this can not be the intended response...or am i expecting something wrong?
but you are right, i need to use rigid body physics for what i was expecting (to get a response also dependant on the mass of an object), but there is still this weird behavior in bounce mode...
Levin
02/14/2006 (6:59 am)
Hi Melv,I tried around a little bit, and i saw that bounce mode is not dependent on any mass values, my bad.
but the collisions I get are different for different restitution-values. so the bounce-mode seems to use at least some of the material details, right?
that got me confused a little bit.
but the weird behavior as described above still seems to be a bug.
let me describe it a bit in detail.
lets say we have two objects. "object a" moving left with 10px per second. on the same height we got "object b", just right from object a and moving left with 20px per second. as you see, at some point "object b" will bounce into "object a", resulting in (and this is the weird part) "object b" moving right with about 20px per second and "object a" _also_ moving right with about 5px per second... so both object change their direction.
and this can not be the intended response...or am i expecting something wrong?
but you are right, i need to use rigid body physics for what i was expecting (to get a response also dependant on the mass of an object), but there is still this weird behavior in bounce mode...
Levin
Associate Melv May
I've been through this before but all the other collision modes are not cut-down versions of rigid-body physics, which seems to be what you're describing. Only rigid-body takes all the collision material details into account. The others specifically only deal with velocity changes and don't impart energy. In other words, the "bounce" mode won't act like a pool ball or anything like that.
"Bounce" mode works well for things like a projectile bouncing off walls or a ball bouncing off a bat in a "breakout" clone etc.
No energy transfer takes place, each object simply mirrors its velocity along the collision normal. If you understand this and you're still not getting what I described above then it could be a bug.
Just to be clear, you won't get a rigid-body bounce from "bounce" mode. Use rigid-body for that.
Hope this helps,
- Melv.