Discontinuous reflection angles for sphere-sphere collisions
Posted: Fri Jun 07, 2019 6:48 am
Hello, first-time poster here, be gentle.
For context, I'm working on a pachinko-style game in Unity using BulletSharp, a C# wrapper around libulletc. A sphere is launched from the top of the screen and bounces off other spheres placed throughout the level, all constrained to a 2D plane. I'm using the default collision configuration, DbvtBroadphase proxy, and I have not supplied a constraint solver. Settings are otherwise at their defaults, I believe.
The specific scenario I'm concerned with here deals with a moving rigid body with a sphere collision shape and a static (mass==0) rigid body also with a sphere collision shape.
I would expect a continuous relationship between the angle of incidence of the inbound sphere and the angle of reflection after the collision. For some angles this works as expected:
However, sometimes there is a discontinuity in the reflection. Here's an example with a single discontinuity:
Here's an example with two discontinuities:
These discontinuities are confusing to players and I'd like to get rid of them if at all possible. I'm hoping someone on these boards has a better eye for physical interactions and can point me towards a solution. I've tried reducing the timestep, but it seemed to add more, smaller discontinuities rather than get rid of the problem.
I realize the context makes remote debugging a bit tricky. Let me know if there's anything I can try on my end to add clarity to the situation.
Thanks!
Kurt
For context, I'm working on a pachinko-style game in Unity using BulletSharp, a C# wrapper around libulletc. A sphere is launched from the top of the screen and bounces off other spheres placed throughout the level, all constrained to a 2D plane. I'm using the default collision configuration, DbvtBroadphase proxy, and I have not supplied a constraint solver. Settings are otherwise at their defaults, I believe.
The specific scenario I'm concerned with here deals with a moving rigid body with a sphere collision shape and a static (mass==0) rigid body also with a sphere collision shape.
I would expect a continuous relationship between the angle of incidence of the inbound sphere and the angle of reflection after the collision. For some angles this works as expected:
However, sometimes there is a discontinuity in the reflection. Here's an example with a single discontinuity:
Here's an example with two discontinuities:
These discontinuities are confusing to players and I'd like to get rid of them if at all possible. I'm hoping someone on these boards has a better eye for physical interactions and can point me towards a solution. I've tried reducing the timestep, but it seemed to add more, smaller discontinuities rather than get rid of the problem.
I realize the context makes remote debugging a bit tricky. Let me know if there's anything I can try on my end to add clarity to the situation.
Thanks!
Kurt