1:1 movement correlation

Post Reply
render_dude
Posts: 1
Joined: Sun Jun 17, 2012 9:51 pm

1:1 movement correlation

Post by render_dude » Sun Jun 17, 2012 10:29 pm

I have a simple world with a few static objects and a dynamic camera (all rigid bodies). The camera is attached to a proxy sphere (I've used a cube with similar results) that is moved around the environment using setLinearVelocity.

The issue I have is that I have a "treadmill" that the user of the system is controlling, and I need to have 1:1 motion correspondance between distance and direction travelled on the treadmill with the avatar/camera in the virtual world. The correspondance will fail when the camera hits a wall, but once the user reorients the 1:1 motion should be in affect again.

It should be simple, I get from the treadmill the change in x and y, I divide that by the time step to get a velocity, call setLinearVelocity, call stepSimulation with the time step, rinse, lather, repeat. But, if the new direction is angled off the current direction, for example, if the user turns to the left for a couple of steps, and the over corrects to the right, the camera continues along the original left turn for several more steps before a gradual correction to the right. I need it to instantly correct to the right.

Any help is appreciated.

Mark

Post Reply