Page 1 of 1

can i attach a subentity to scenenode?

Posted: Thu Jan 22, 2015 9:30 am
by watermoon123
i want to rotate a turret of a tank, (and i have never used bone animation,is it difficult?)
i can do this by split the model to two models and then control them divide, but if there are many subentity need to move, it's maybe troublesome.
so can i attach a subentity to a scenenode?

Re: can i attach a subentity to scenenode?

Posted: Thu Jan 22, 2015 4:50 pm
by Kojack
Subentities are designed to separate an entity into parts with different materials, but are part of the same whole. They can't be moved individually and scenenodes don't understand them.
However using bones you can effectively move them, if all vertices in a subentity are attached to the same bone then it will act like a scene node. A bone is actually a sibling to scene node, they both inherit from Node, so they share the same methods.

The most efficient way is if you use just one material (so one subentity for the whole tank) and use bones to control it. That would be one render call instead of two (each subentity takes one call and will slow things down, while many bones can be used in one call).

Using separate entities for each part and putting them on scene nodes may be easier to do, but won't be as fast as bones.

Re: can i attach a subentity to scenenode?

Posted: Fri Jan 23, 2015 3:14 am
by watermoon123
thank you for your advice!
using bone need .skeleton file?
i just have .mesh file
(it's my first time to use ogre forums,i dont know if you can see my reply...)