Need help about the Ninja sample.

Immoho

11-12-2007 10:13:21

Hey guys.
I am learning about the Ninja sample on the OgreOde's wiki.The code below has an error.
:
OgreOde::Body* torso = torsoBodies->getObject("ninja");
Quaternion q = torso->getOrientation();

I tried to complie it with my vc8,but it said that torsoBodies was not declared.
So what's the torsoBodies and the getObject()?
I think it maybe caused by the different version of OgreOde.
Mine is 0.9 and I have no idea with which vision does the Ninja sample use.
What is the worst is that OgreOde does not has an API manual!Or maybe I dont find it.
Anyone can help me?Tell me where to find the getObject() in the Ode 0.9 version.Thank u very much indeed!!

rewb0rn

11-12-2007 13:40:38

Its not a version problem but the tutorial is improper. What you want to do is to get the body that you created before and do something with it. Best way to do this in my opinion is to store the pointer to the body the whole time in your class (declare it as an attribute), then in your move method just access it:

Quaternion q = dollTorsoBody->getOrientation();

Immoho

12-12-2007 07:38:17

Its not a version problem but the tutorial is improper. What you want to do is to get the body that you created before and do something with it. Best way to do this in my opinion is to store the pointer to the body the whole time in your class (declare it as an attribute), then in your move method just access it:

Quaternion q = dollTorsoBody->getOrientation();

It's done.Thank u rewb0rn. :D