[ODE] Syntax differences

smythst smythst at tcd.ie
Tue Sep 23 21:18:28 MST 2003


I'm currently trying to get my head around ODE's nuances and have been playing 
around with test_chain2.cpp, as it's the simplest of the test files.

However there's something weird about how it creates and uses ODE objects. 
test_chain2.cpp says stuff like :

static dWorld world;
static dSimpleSpace space (0);

and


world.setGravity (0,0,-0.5);
dWorldSetCFM (world.id(),1e-5);

whereas the documentation, and some of the other test files do it like:

dWorldID world = dWorldCreate();

and 
dWorldSetCFM (world, 1e-5);


Why the difference? Is test_chain2.cpp 's way of doing it a legacy from an old 
version of ODE, is there a difference in performance, and which is better?
I guess what I'm trying to ask is which way should I get into the habbit of 
using, creating the objects myself and accessing their member functions with a 
dot operator, or let ODE do it and just pass in the ID's to global functions 
that it gives me when I ask it to?

Cheers guys.




More information about the ODE mailing list