Bounce Response And Mass
by Scott Johnson · in Torque Game Builder · 08/20/2006 (5:21 pm) · 3 replies
Does the built in TGB BOUNCE response mode, take the mass of the object into consideration?
or would that need to be implemented via callback?
Thanks.
or would that need to be implemented via callback?
Thanks.
About the author
#2
Just thought I'd add that if you're a Pro-user then you might find that it's easier than you think to either modify the "bounce" response or add another custom response.
If you wanted to make a change to the "bounce" response then you would need to go to "t2dPhysics::resolveBounceCollision" in "t2dPhysics.cc".
You would simply need to change the responses for both the source and destination objects as per the lines...
Hope this helps,
- Melv.
08/22/2006 (3:43 am)
Scott,Just thought I'd add that if you're a Pro-user then you might find that it's easier than you think to either modify the "bounce" response or add another custom response.
If you wanted to make a change to the "bounce" response then you would need to go to "t2dPhysics::resolveBounceCollision" in "t2dPhysics.cc".
You would simply need to change the responses for both the source and destination objects as per the lines...
... pCollisionStatus->mpSrcPhysics->setGrossLinearVelocity( (linearVelocity-(collisionNormal*(2.0f*dotVelocityNormal))) * pCollisionStatus->mpSrcPhysics->getRestitution() ); ... ... pCollisionStatus->mpDstPhysics->setGrossLinearVelocity( (linearVelocity-(collisionNormal*(2.0f*dotVelocityNormal))) * pCollisionStatus->mpDstPhysics->getRestitution() ); ...
Hope this helps,
- Melv.
#3
However I think I'm running into some bugs.. If you could take a look at: My Project (just unzip to your games folder).
I think it might give you all something to help reproduce these issues with.. I eventually want to put this up as a basic tutorial, Once I get a good understanding of whats a bug and what is my lack of understanding.
Level 0: the first level is where I play with individual object properties , angular rotation etc.. not very useful.
Press the 1 key, and the "BOUNCE" demo level will load up, and it works pretty good, but occasionally, I will loose objects, or they will penetrate into my tiles..
Press the 2 key, and the "RIGID" demo level loads up, this is where I see the worst problems..
After a lot of playing around having any constant force applied (gravitic is worse) will cause more problems, it works better without any constant forces, but still exhibits problems..
other hot-keys:
b = debug banner toggle
p = pause
esc - safely exit game.
alt-enter toggles fullscreen, but with the scene paused after the toggle (press p to resume)
0,1,2 loads respective levels.
In general it should be easy to reproduce:
1) Lockup when moving the window by it's title bar.
2) Lockup by loosing gaining focus with another app
3) Objects penetrating "between" tiles along the collision boundaries.
4) Objects not colliding with each other, if they are already say resting on the "floor"...
I know these have all been reported (or relatively sure)... I just need you, or anyone else who wants to, to review what I've done so far, to see If I'm on the right track generally, or if I'm doing something totally wrong.. I have twiddled with a LOT of settings trying to come up with a combination that doesn't exhibit the above problems.
Thanks for any time you can give.
08/25/2006 (8:54 am)
Thanks Melv, you got me onto the RIGID response, and I've been having some fun with it..However I think I'm running into some bugs.. If you could take a look at: My Project (just unzip to your games folder).
I think it might give you all something to help reproduce these issues with.. I eventually want to put this up as a basic tutorial, Once I get a good understanding of whats a bug and what is my lack of understanding.
Level 0: the first level is where I play with individual object properties , angular rotation etc.. not very useful.
Press the 1 key, and the "BOUNCE" demo level will load up, and it works pretty good, but occasionally, I will loose objects, or they will penetrate into my tiles..
Press the 2 key, and the "RIGID" demo level loads up, this is where I see the worst problems..
After a lot of playing around having any constant force applied (gravitic is worse) will cause more problems, it works better without any constant forces, but still exhibits problems..
other hot-keys:
b = debug banner toggle
p = pause
esc - safely exit game.
alt-enter toggles fullscreen, but with the scene paused after the toggle (press p to resume)
0,1,2 loads respective levels.
In general it should be easy to reproduce:
1) Lockup when moving the window by it's title bar.
2) Lockup by loosing gaining focus with another app
3) Objects penetrating "between" tiles along the collision boundaries.
4) Objects not colliding with each other, if they are already say resting on the "floor"...
I know these have all been reported (or relatively sure)... I just need you, or anyone else who wants to, to review what I've done so far, to see If I'm on the right track generally, or if I'm doing something totally wrong.. I have twiddled with a LOT of settings trying to come up with a combination that doesn't exhibit the above problems.
Thanks for any time you can give.
Associate Melv May
- Melv.