[ODE] Spaceship movement.

Geoff Carlton gcarlton at iinet.net.au
Tue Jun 20 01:12:27 MST 2006


This has come up before.  The main approaches are to use AMotors for the 
control loop, or applying the forces manually (essentially having a 
control loop in the app code rather than in the ODE motor code).  I'd 
recommend the second approach - correcting forces should really come 
from engines etc which may want to generate particles etc depending how 
much force they emit.  Also AMotors are harder to understand.

Instead of applying the velocity directly, compare the desired velocity 
to the current one and apply a suitable force.  For a spaceship, I'd 
expect this to be one force along the ship's axis representing thrust, 
and torque forces for stability and turning.  I'd recommend playing 
around with some dot/cross products, and get some code that injects a 
certain force and torque each frame.  A good interface is to take inputs 
as the expected control scheme (forward, left turn, automatic 
stabilisation etc).  AI can then resolve itself to injecting those 
inputs, rather than deal with the physics directly.

Good luck!
Geoff

Christian Flodihn wrote:
> I am trying to make a combat space simulator similar to
> "Tiefighter" (released by Lucas Arts around 93-95).
>  Now I got my tiefighter, a few empy containers and a
> freighter in empy space.
>
> I searched the net and read the ode user guide but I found no
> examples mirroring what I want to accomplish.
>
> For now I just set the linear velocity on the bodies, but I read
> in the user guide that is wrong. I tried to use motors but I can
> not figure out how to make them move the body like a spaceship.
>
> Since you are the experts, you probably could give me some
> advice how to do it.
>
> //Christian Flodihn
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>   
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.9.1/369 - Release Date: 19/06/2006
>   


More information about the ODE mailing list