void AbstractAnimation::findSceneManager() { NodeSet::Ptr roots = NodeSet::create(targets()) ->roots() ->where([](NodePtr node) { return node->hasComponent<SceneManager>(); }); if (roots->nodes().size() > 1) throw std::logic_error("Renderer cannot be in two separate scenes."); else if (roots->nodes().size() == 1) setSceneManager(roots->nodes()[0]->component<SceneManager>()); else setSceneManager(nullptr); }
static NodeSet::Ptr whereWrapper(NodeSet::Ptr nodeSet, std::shared_ptr<LuaGlueFunctionRef> p) { return nodeSet->where(std::bind( &LuaGlueFunctionRef::invoke<bool, std::shared_ptr<Node>>, p, std::placeholders::_1 )); }
static unsigned int sizeWrapper(NodeSet::Ptr nodeSet) { return nodeSet->size(); }
static std::shared_ptr<Node> getWrapper(NodeSet::Ptr nodeSet, int index) { return nodeSet->nodes().at(index - 1); }
static NodeSet::Ptr rootsWrapper(NodeSet::Ptr nodeSet) { return nodeSet->roots(); }
static NodeSet::Ptr ancestorsWrapper(NodeSet::Ptr nodeSet, bool andSelf) { return nodeSet->ancestors(andSelf); }
static NodeSet::Ptr childrenWrapper(NodeSet::Ptr nodeSet, bool andSelf) { return nodeSet->children(andSelf); }
static NodeSet::Ptr descendantsWrapper(NodeSet::Ptr nodeSet, bool andSelf) { return nodeSet->descendants(andSelf); }