[ODE] Question about moving a Submarine.

Tyler Streeter tylerstreeter at gmail.com
Mon May 2 09:39:13 MST 2005


You can use a damped spring equation for linear and angular motion
(i.e. a PD controller).  You would then simply set the desired
position and orientation (and a few spring and damping constants) and
let the spring calculate the force required to the submarine into the
desired position/orientation.

Here's some source code that does this:

http://cvs.sourceforge.net/viewcvs.py/opal/opal/src/SpringMotor.cpp?view=markup

Tyler

On 5/2/05, Adam Templeton <dr.drago at gmail.com> wrote:
> Heya,
>          I'm working on a little simulation involving objects, underwater.
> at the moment I am just setting the linear velocity of the object each
> game loop.
> Yes I know this is a bad way of doing it, but I can't think of a better way.
> Another ways that I tested was to just add a force to the body.
> 
> Both these ways successfully moved the Sub, but broke the collisions,
> especially when it hits a wall or gound it can cause the object to
> move to non existant location.
> 
> So I am asking if anybody here knows of a way to move a body around in
> the world using joints, and motors, ie letting the phyics controll the
> body.
> 
> Thanks, Adam.
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>



More information about the ODE mailing list