getActor?

mtx123

08-11-2007 01:49:38

I still don't understand the difference between Body and Actor.
I have a Body and I must move it. I need to search the Body by his name.
I'm looking for something like:
Body myBody = mScene->GETBODY('name');
I've only found getActor.

Can someone explain me the differences between body and actor? And what I must use to find a Body by name?
Thank you

OgreMage

04-05-2008 03:35:21

No one responded to this thread!

I too am unclear about the difference between a Body and an Actor!
In fact, I have casted Actor's to Body's in the past to access getEntity.

If there is another thread in this forum that answers this, please reply with the link!

Thank you!
OM

betajaen

04-05-2008 10:13:49

Basically: In 0.9 and Bleeding, Bodies are Actors (they inherit from the Actor class) with some sort of visualisation. In 0.9 it's the SceneNode/Entity interface, in Bleeding it's a NodeRenderable.

Actors do not have any form of visualization (they are invisible within the Scene) but they do exist. The reason being; I cannot predict how you want your physics actors represented in your application. But for the sake of my sanity and many others, I have provided an example class - Body to show how it's done with the NxOgre RenderSystem. Normally in serious applications you would write your own, and sometimes that is called body too.

Anyway, here is some reading:

- http://www.nxogre.org/Core_Hierarchy_Diagram (I just added this today)
- http://www.nxogre.org/Inheriting_Actor_ ... type_class (Second part not in the SVN yet)
- http://www.nxogre.org/RenderSystem (Still being written but worth a read)