Help needed for ball rolling on user-controlled table

angelpopangel

02-07-2008 15:53:35

Hi,
i am coding a small game in which you have to control a ball on a moving table. You can control the table with the mouse, rotating it around x- and z-axis. Pivot is the center of the table.

I tried to make the table static (no body) and control it by ->pitch() and ->roll().
After tweaking billions of parameters in the worldsystem, the ball rolls satisfying on the table. I always had the prob, that the ball fell through the table when moving the mouse too fast.
But I managed it that the ball stays on top as long as it doesn't fall over the edge.
Now my problem: When the ball comes near the edge of the table and I make a medium to fast move upwards with the edge the ball goes up as if shot with a cannon.

Now my question: Did I go a wrong way from the start? Must I apply forces to the table instead of rotating node/geom for it?
And if yes, how can I make the table react to the forces but NOT bouncing back, when the ball lands on it after being midair and ignore gravity?

Sorry, in case I am a bit unclear. Must be the language and I just lost the Euro2008-Final ;-)

Thanks to anyone who is willing to help in advance.

Cheers, Angel

P.S.: The ball only bounces back that extreme, if "hit" with the table. If the ball rushes down from 2435kilometers high onto the table, the ball doesn't bounce

rewb0rn

02-07-2008 20:42:33

Well you could try to set a limit for the ball velocity. And yes, probably it would have been better to apply forces to the tabel instead of rotating it (so it would not rotate through the ball from time to time). There are possibilities to allow one way collision only, i have read a discussion on ode.org but I have not tried it.

angelpopangel

02-07-2008 22:42:14

thanks a lot... I will stick to the idea with the forces then and start further investigations...

I don't know anything about joints yet... but if I understood them correctly: am I able to connect the table (pivot) to a static object, that's not bound to the collision-system and make the table a body with high mass?

rewb0rn

03-07-2008 08:03:14

Yes, so the table would not move, but if I understood you correctly you also want to prevent the table from bouncing back right? Therefor you would need one way collision. You can do this somehow by simulating the table is a static object in the collision method but as stated above I haven't done it yet.

angelpopangel

03-07-2008 08:30:00

yes, you got it right... but as I wrote my least post I thought of the table being influenced slightly by the ball as well... don't want to be too friendly to the player ;)

many danke to you

rewb0rn

03-07-2008 16:18:38

okay then you can try to just set a very high angular damping to the table and probably give it a very high mass.

angelpopangel

03-07-2008 21:10:56

angular damping... that's a good idea... I can switch off damping when using the mouse... good point... thanks again