Exemplo n.º 1
0
	void OcTree::GetVisibleSceneNodes(const Collidable &collider, SceneNodes &sceneNodes) const
	{
		sceneNodes.clear();

		WalkScene(collider, [&](const SceneNode::Ptr &sceneNode) 
		{
			sceneNodes.push_back(sceneNode);
		});
	}
Exemplo n.º 2
0
	void OcTree::GetVisibleRenderables(const Collidable &collider, SceneNodes &renderables) const
	{
		renderables.clear();

		WalkScene(collider, [&](const SceneNode::Ptr &sceneNode)
		{
			auto render = sceneNode->GetComponent<MeshRender>();
			if (render != nullptr && render->GetRenderable())
				renderables.push_back(sceneNode);
		});
	}
Exemplo n.º 3
0
	void OcTree::GetVisibleLights(const Collidable &collider, SceneNodes &lights) const
	{
		lights.clear();

		WalkScene(collider, [&](const SceneNode::Ptr &sceneNode)
		{
			if (sceneNode->GetComponent<Light>() != nullptr)
				lights.push_back(sceneNode);

		});
	}
Exemplo n.º 4
0
	void OcTree::GetVisibleShadowCasters(const Collidable &collider, SceneNodes &renderables, bool clear) const
	{
		if (clear)
			renderables.clear();

		WalkScene(collider, [&](const SceneNode::Ptr &sceneNode)
		{
			auto render = sceneNode->GetComponent<MeshRender>();
			if (render != nullptr && render->GetRenderable() && render->GetMesh()->GetCastShadows())
				renderables.push_back(sceneNode);
		});
	}
Exemplo n.º 5
0
	void OcTree::GetRenderQuery(const Collidable &collider, const std::shared_ptr<RenderQuery> &renderQuery) const
	{
		renderQuery->Clear();

		WalkScene(collider, [&](const SceneNode::Ptr &sceneNode)
		{
			if (sceneNode->GetComponent<Light>() != nullptr)
				renderQuery->AddLight(sceneNode);
			
			if (auto render = sceneNode->GetComponent<MeshRender>())
			{
				if (render->GetRenderable())
					renderQuery->AddRenderable(sceneNode);
			}
		});
	}
Exemplo n.º 6
0
	void OcTree::GetVisibleRenderableAndLights(const Collidable &collider, SceneNodes &renderables, SceneNodes &lights, bool clear) const
	{
		if (clear)
		{
			renderables.clear();
			lights.clear();
		}

		WalkScene(collider, [&](const SceneNode::Ptr &sceneNode)
		{
			auto render = sceneNode->GetComponent<MeshRender>();
			if (render != nullptr && render->GetRenderable())
				renderables.push_back(sceneNode);
			else if (sceneNode->GetComponent<Light>() != nullptr)
				lights.push_back(sceneNode);

		});
	}