[ODE] Camera should be a body with zero mass?

James Arthur teamonkey at gmail.com
Thu Jun 24 16:22:27 MST 2004


On Thu, 24 Jun 2004 10:36:26 -0400, andresch at cox.net <andresch at cox.net> wrote:
> 
> The camera in my simulation is implemented as a body/geom in ode. I want my camera to follow my character as it moves and rotates (third person), so I attach them to each other with a slider, and all is well except...
> the camera's mass affects the characters movement.  I want the camera affected by the guy, but not the guy affected by the camera, in other words the camera should be a body with zero mass.  If I set it's mass to zero, bad things happen so I'm thinking you're not supposed to do that. How can I have a body/geom that reacts to the things it's joined to but does not affect them?

Is there any reason why you need the camera to be modelled as a
physical body? If there isn't then it's probably best not to.

The trick is to work out where the camera wants to be and where it
wants to be pointing. For a third person game this will be a little
bit behind the player, looking straight at the player. Then you have
to work out how to get the camera there. Use linear interpolation for
the position and SLERP for the direction of the camera (google).

Cheers

James


More information about the ODE mailing list