From TDN
This page is a Work In Progress.
Bouncing Ball Physics
Original Question:
Just curious, but is there a way to have the physics system do the vector reflection for a bounce collision response so I don't have to create all this sub-system stuff to get the unrealistic response I need? :)
It bounces objects off the WorldLimits, so can we also use that to override other collision responses? Would it handle the arbitrary angles of collision polys?
Response:
The physics system is extremely powerful but with that power comes responsibility. :)
Understanding how the physics works is key to configuring it into a "dumb" mode.
Try the following:
- Ensure that you've got no friction so set that to 0.
- You want almost perfect bounces to set the restitution to 1.
- You don't want energy to bleed-off so set the damping to 0.
- Keep the forces within reasonable bounds by adjusting the density of your object. Density is very sensitive so
tweak with small fractional increases although the default is good.
- You want all the energy to be dissipated into the bouncing object so set the other object to be immovable
(density 0) - helper func setImmovable().
- You don't want your objects to rotate so set you max-angular velocity to 0 although you get more accurate results from an object that spins.
Follow these rules, most of which can be defined in a collision-material datablock and you will be okay.
|