technique
26-01-2012 23:37:23
Hi guys, at present i am working on a small pinball-like game. Have a look at the little mockup - hope it make things clear.

Uploaded with ImageShack.us
The goal is to smash the boxes above the rockers (is that the right english word für the small red objects?) using the ball and natural physics. The input devices are sensor-nodes which gives me a rotation vector amongst other things. I want to use those information to control the rockers. so what i need is a 1 to 1 mapping of the input rotation information (absolute angle) to the ogrenewt::body (a convexhull) representing a rocker. the rocker itself has to react with the ball.
my first approach was the setPositionOrientation which doesnt work for me (the ball fall through the rocker). If im using setTorque inside a callback-function i never get a good response (the rotation was waaaay to fast or waaay to slow). didnt get how to compute reasonable values for the add or setTorque function. So i tried to use Joints for the first time (the hinge) but it seems that this joint react only for a few second if the ball stays in contact with the body of the rocker (using setTorque again and i tried the setDesiredAngle too).
I think my problem is not that complicated but i am doing something basically wrong. i didnt get how to achieve a mapping from the input information to the rocker body (without loosing proper physic behaviour). any ideas?
Uploaded with ImageShack.us
The goal is to smash the boxes above the rockers (is that the right english word für the small red objects?) using the ball and natural physics. The input devices are sensor-nodes which gives me a rotation vector amongst other things. I want to use those information to control the rockers. so what i need is a 1 to 1 mapping of the input rotation information (absolute angle) to the ogrenewt::body (a convexhull) representing a rocker. the rocker itself has to react with the ball.
my first approach was the setPositionOrientation which doesnt work for me (the ball fall through the rocker). If im using setTorque inside a callback-function i never get a good response (the rotation was waaaay to fast or waaay to slow). didnt get how to compute reasonable values for the add or setTorque function. So i tried to use Joints for the first time (the hinge) but it seems that this joint react only for a few second if the ball stays in contact with the body of the rocker (using setTorque again and i tried the setDesiredAngle too).
I think my problem is not that complicated but i am doing something basically wrong. i didnt get how to achieve a mapping from the input information to the rocker body (without loosing proper physic behaviour). any ideas?