VisualPinball.Engine
VisualPinball.Engine copied to clipboard
Rewrite bumpers
Fixes #482
Bumpers now have two colliders:
- An outer non-rigid collider to detect balls near the bumper
- An inner rigid collider so balls cannot pass through the bumper if the coil is not triggered by the switch
These balls are pushed away in IApiCoil.OnCoil. BallCollider.Collide3DWall is also called there to make sure the velocity of the ball towards the bumper is removed regardless of how weak the push force of the bumper is. I'm not sure if it's appropriate to do that outside the physics loop, but without it, the pushes of two bumpers (e.g. in a bumper cluster) would cancel each other out like this:
This is the same test scenario with collision:
A simpler solution would to simply zero out the ball's velocity, but that would lead to strange interactions when the ball grazes the bumper from the side.