示例#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);
}
示例#2
0
 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
     ));
 }
示例#3
0
 static
 unsigned int
 sizeWrapper(NodeSet::Ptr nodeSet)
 {
     return nodeSet->size();
 }
示例#4
0
 static
 std::shared_ptr<Node>
 getWrapper(NodeSet::Ptr nodeSet, int index)
 {
     return nodeSet->nodes().at(index - 1);
 }
示例#5
0
 static
 NodeSet::Ptr
 rootsWrapper(NodeSet::Ptr nodeSet)
 {
     return nodeSet->roots();
 }
示例#6
0
 static
 NodeSet::Ptr
 ancestorsWrapper(NodeSet::Ptr nodeSet, bool andSelf)
 {
     return nodeSet->ancestors(andSelf);
 }
示例#7
0
 static
 NodeSet::Ptr
 childrenWrapper(NodeSet::Ptr nodeSet, bool andSelf)
 {
     return nodeSet->children(andSelf);
 }
示例#8
0
 static
 NodeSet::Ptr
 descendantsWrapper(NodeSet::Ptr nodeSet, bool andSelf)
 {
     return nodeSet->descendants(andSelf);
 }