Pinball/half pipe physics question (perfect surfaces):

I'm just wondering how to go about this in box2d. (I'm considering porting a pinball engine I have in AS3 to box2d).

The question/problem:
I want to create a scenario where a floor preserves all velocity but simply affects the direction of a ball travelling along it.
(no bounce, no friction, no gravity).

Imagine a perfect half-pipe (half-circle) with a ball on the top-left side. (on the edge). I want to give the ball a velocity of (0,10) (that is, 10 in the y axis).
The ball should then travel along the curve of the half-pipe and leave the top-right side with a velocity of (0,-10). The -10 would occur because of the ball following the half pipes curve, but the total velocity in the system has not changed, only the direction.

Is it possible to do this? How?

Cheers! 🙂
Hi, look in the Testbed with topic collision detection or sth like that, there is such a half pipe 😉

greetz
In the fully general sense, a (super-)perfect surface like that is not possible in the engine. But reading the speed before collision, and setting it after the collision, should suffice when you don't have objects colliding with each other and the surface simultaneously.

Set restitution to 0 to have no bounce.

Original thread: https://box2d.org/forum/viewtopic.php?t=3599