I would like to know if there is any difference/advantage between attaching a scene node to a camera using node->setParent(camera); or camera->addChild(node), besides the order of declarations?
They have the same effect. setParent() can be used to set the parent to NULL if you want to remove a node from the scene graph temporarily. It calls addChild() if the parent you specified is a valid pointer, so setParent() is a tiny bit more expensive.
vitek wrote:They have the same effect. setParent() can be used to set the parent to NULL if you want to remove a node from the scene graph temporarily. It calls addChild() if the parent you specified is a valid pointer, so setParent() is a tiny bit more expensive.