Oval ball physics??
Or any odd shaped object, what is the best way to go around solving the problem of an odd shaped object bouncing/changing angles and then coming to a stop by either rolling or by gentle rocking. Any help/advice/examples would be greatly appreciated.
You can implement collision detection for such an object with the ground relatively easily, as with a simple matrix transform it''s a sphere, and sphere-plane collision detection is easy.
As for collision response, in general collision detection will give you a direction of impact not in line with the centre, and this will tend to both translate and rotate it. The translating effect will throw it back from the surface while the rotating effect will cause it to spin. These are both strightforward to calculate from standard formulae.
To get it to rock and roll you just need to do the above calculations often enough. E.g. if you drop such an object on the ground and after initially bouncing it slows down so it is just rolling/rocking the same calculations will still work as you can treat the rolling/rocking motion as a series of tiny pushes that together with gravity keep it moving. Done like this it never stops so you need to include a test for when it has slowed down enough to be stopped.
As for collision response, in general collision detection will give you a direction of impact not in line with the centre, and this will tend to both translate and rotate it. The translating effect will throw it back from the surface while the rotating effect will cause it to spin. These are both strightforward to calculate from standard formulae.
To get it to rock and roll you just need to do the above calculations often enough. E.g. if you drop such an object on the ground and after initially bouncing it slows down so it is just rolling/rocking the same calculations will still work as you can treat the rolling/rocking motion as a series of tiny pushes that together with gravity keep it moving. Done like this it never stops so you need to include a test for when it has slowed down enough to be stopped.
John BlackburneProgrammer, The Pitbull Syndicate
A good reference for spherical ball collisions might give some ideas:
http://www.gamasutra.com/features/20020118/vandenhuevel_01.htm
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
http://www.gamasutra.com/features/20020118/vandenhuevel_01.htm
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement