Example #1
0
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);
}
Example #2
0
 static
 std::shared_ptr<Node>
 getWrapper(NodeSet::Ptr nodeSet, int index)
 {
     return nodeSet->nodes().at(index - 1);
 }