[ODE] Controls
Arturo Colorado Garín
acolorado at telefonica.net
Wed Sep 6 14:55:36 MST 2006
> i'm implementing a camera, which is represented by a body in my scene. i
> want to move the camera to left/right and bottom/up inside the scene.
> i want to make it using forces that act on the center of mass of the body.
It is not a good idea to attach a body to your camera, it's going to give
you more troubles than benefits. Maybe you could to achieve a very specific
behavior or effect, but not for a typical third-person camera like yours.
Instead, calculate yourself the camera position and orientation based on
whatever you want, for example: always stand 2 meters behind the player and
looking at it. Additionally you can (1) attach a geom with no body to it to
detect collisions with other objects in the scene, and/or (2) shoot a ray
from the camera to the player to see if there is obstacles in-between, in
which case you would put the camera closer to the player.
Search the ODE wiki and/or manual, I think there was something there about
this.
Hope this helps,
--Arturo.
More information about the ODE
mailing list