[ODE] help in Get functions

Vast vasko.tim at gmail.com
Sun Mar 5 12:33:26 MST 2006


João, please look at the ODE sample demoes, if you study them a little more
carefully, you will see where your problem lies. In the mean time, since you
haven't studied them well enough, and honestly told us that you are new to
C++ (and I imagine C as well) I would suggest picking up few good books and
read up on how everything works.

ODE may be a little too big of a jump for you right now, try simpler things
first.


To be on topic, your simulation didn't even run once, basically, you need a
function that repeatedly steps the simulation (updates it) - think "loop" ;)
and you would need to set the mass of the box, rotation, etc. (look at the
samples) you would also need to create something for the box to collide
against, a plane could be a good start. You would also need a space to solve
the collision detection, and callback function which solves the contacts for
the collision.

That could go for a start. Read the samples!

Good luck João.
- Tim


On 3/5/06, Joao Pinto <joao_icaro at yahoo.com> wrote:
>
>  I am a newbie with ODE and cpp for that matter, so my question can be
> very stupid, anyway I can't seem to sort it out.
>
> I have made a very simple program that only creates a world, sets a
> gravity vector and creates an object at a specific location. Then I use the
> dWorldGetGravity and dBodyGetPosition functions to check if the changes
> where actually made in the simulation. However, when I cout to the screen
> the results of the vectors only the 1st position is actually changed. The
> rest still has my initialization data. This happens in the gravity vector as
> well as in the pointer of the position.
>
> Can anyone help me...? I'm sure this is a very basic stuff...
>
> Thank you very much
>
> João
>
> here is the code:
>
> //*******************************************************
>
> using namespace std;
> int main(int argc, char *argv[])
> {
>
>     dReal x, y, z;
>
>       //init values to be updated with the real values in the world
>     gravity[0]=1111111.;
>     gravity[1]=1111111.;
>     gravity[2]=1111111.;
>
>     world = dWorldCreate();
>
>     dWorldSetGravity (world,x=1.,y=2.,z=3.);
>     body1 = dBodyCreate (world);
>     dBodySetPosition   (body1, 1., 2., 3.);
>     const dReal *pos = dBodyGetPosition (body1);
>     cout << "\n\npos " << pos[0]<< "\t" << pos[1]<< "\t" << pos[2];
>
>     dWorldGetGravity (world,gravity);
>     cout << "\n\ngravity: " << gravity[0]<< "\t" <<gravity[1]<< "\t"
> <<gravity[2] << endl << endl;
>     dWorldDestroy (world);
>     system("PAUSE");
>     return EXIT_SUCCESS;
> }
> //*******************************************************
>
>
>   _________________________________
> *BECAUSE WE CAN*!
>
> phone number: *96 843 15 16*
>
> Follow this link to my homepage:
> *http://protocol7.no-ip.com/joao/myhomepage.htm*
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>
>


--
Tim Vasko
VaskoSoftware Development Company
- President
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20060305/88ee59d2/attachment.htm


More information about the ODE mailing list