Rotate SubEntity ?


29-04-2010 16:30:33

I have a mesh file. In this mesh file are these 3 objects:
- main
- sub
- main_anim

Now i want to rotate the main_anim object but how ?
This is the code to access the subentity:
(myObject is an Entity)

I can set the visiblity of an subentity with the code above but that's all.

Is this an 'bug' or some missing feature ?


30-04-2010 12:15:39

It was a while since i've used Ogre but i'm pretty sure you can't transform subentities(submeshes).
When you have a mesh with three different materials, you will have 1 mesh with 3 submeshes(on for each material), these submeshes cannot be transformed individually(except for animating them with bones).

For example if you want a tank with a rotatable turret, you will need to have two separate meshes. One for the tank base and one for the turret.
The scenegraph would look like this...

--- Entity(Tank Mesh)
--- SceneNode(Turret)
--- Entity(Turret Mesh)

Or maybe this isn't what you meant?


30-04-2010 14:48:49

Yes, exactly what i need Sweenie :D.
I have not come up with the idea to add a SceneNode into a SceneNode :oops:

I'll try it :roll: