Hi,
i am making a small game for IPhone with a lot of balls bouncing from each other and from walls. It is actually a 2d game so i don’t need spheres i can also use circles. So I wonder what i better to use for performance around my circles to bounce from each other, sphere collider or capsule collider?
Spheres will perform better than capsules, generally speaking. (They’re both easy shapes to work with as far as collision detection goes, but intersection tests involving capsules are more involved than those involving spheres.)
Thank you for your response and info. I already decided to use spheres because after some tests I got some weird behavior with bouncing capsules. Now I am just glad to have confirmation that performance is also better.
To be completely accurate, it can really only be said that it could be better To know for sure you’d to have to examine the PhysX source code and/or confirm via performance tests.
However, it’s a pretty safe bet. Bullet uses GJK for general intersection tests between convex objects, but drops to special-case code for tests involving simple shape pairs such as sphere-sphere and sphere-box (at least according to the manual).
I don’t know for sure of course, but it seems likely that PhysX would handle such shapes in a similar manner. At any rate, spheres will almost certainly not perform any worse than capsules, so using spheres should be a safe bet either way.
I apologize - in addition to the things I mentioned, I should have added ‘or if the documentation states it explicitly’.
Sorry for the oversight.
Of course, the docs have been known to be wrong on occasion. I think performance testing would be the final word.
–Eric
Great, tnx both for info.
After 4 years of programming in .NET i hate being such a noob in something new, but since I am, I will trust docs for now :), witch in this case i did omit.