[ODE] Beginner's questions

Jon Watte (ODE) hplus-ode at mindcontrol.org
Fri Aug 19 17:23:58 MST 2005


You can likely model the entire airplane as a single body. You can add 
more than one geom to a single body.

You're not saying WHAT doesn't work -- what do you expect should happen, 
and what does actually happen? Do you add the force for each step?

To do roll, you should add a small force at the center of each wing, one 
up, and one down, using something like dBodyAddRelForceAtRelPos() (if I 
remember the name correctly). This allows you to add a torque-inducing 
force. Do this each step; scale the force proportional to steering.

You also want to add wing lifting forces to the center of the body, and 
engine propelling forces to the engine force mount (propeller spot) or 
center of body. The lifting force is roughly proportional to windspeed 
squared.

Anyway, first make sure that your physics simulation framework is set up 
so that you can make a single box drop onto a plane, and see it bounce. 
Once that works, you can start experimenting with adding forces (and 
possibly multiple bodies/joints, if needed).

Cheers,

			/ h+


Petr wrote:
> Hi.
> 
> I'm new with ODE. In this time i create simple airplane game and for better
> physics i choose ODE.
> My first step is make roll of airplane, but i can't do it correct. I'm
> trying to do it this way :
> 
> - create airplane's skeleton body and two wing bodies
> - for both wings i use hinge joints (position 1,0,0 and -1,0,0 ... and axis
> 1,0,0 for both)
> 
> Before render i'm try to compute physics like :
> 
> dBodyID Skeleton = GetBodyType (ModelSkeleton);
> 
> dBodyID FrontLeftWing = GetBodyType (FrontLeftWing1);
> dBodyID FrontRightWing = GetBodyType (FrontRightWing1);
> 
> // for test roll to the left
> dBodyAddRelForce (FrontLeftWing, 0, -1, 0);
> dBodyAddRelForce (FrontRightWing, 0, 1, 0);
> 
> dWorldStep (g_Physic->WorldID (), timeOffset);
> 
> if (Skeleton)
> {
>   Quaternion Q = ODEToQuaternion (dBodyGetQuaternion (Skeleton));
>   QAngle A;
>   QuaternionAngles (Q, A);
>   pPlayerEntity->RotateTo (A.x, A.y, A.z);
> }
> 
> But it doesn't works :-/. What i'm doin'g wrong ?
> 
> PS : sorry for my poor english :-)
> 
> Petr
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 
> 


More information about the ODE mailing list