If there are many scene nodes created from same entity, which are managed dynamically at run-time, which way is more efficient to make them visible/invisible?
call function sceneNode->setVisible(visibility) only
OR
call parentNode->removeChild(sceneNode) to remove sceneNode from it's parent.
According to my understanding, if only setVisible function is called to make the nodes invisible,
then OGRE engine will need to check this node for its visibility.
But if the node is removed from its parent and becomes free, there is no such necessary. However it takes extra time to remove from it's parent, which may be time-consuming.
Which is more efficient
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
Re: Which is more efficient
I think that removeChild is more efficient.
It is almost a removal from a list, and the node transform (and all it's child transform) won't be computed anymore.
With setVisible(false), the node transform will still be computed, even if it's not visible, so it is less optimal.
I'd suggest you to use setVisible if you still need the transform to be updated, and removeChild if you don't.
It is almost a removal from a list, and the node transform (and all it's child transform) won't be computed anymore.
With setVisible(false), the node transform will still be computed, even if it's not visible, so it is less optimal.
I'd suggest you to use setVisible if you still need the transform to be updated, and removeChild if you don't.