Added Scene::GetActiveCamera()

Also fixed a warning when instancing is used without lighting


Former-commit-id: 5326e95f99a58ffcc91d7942ec2991482d7e58bd
This commit is contained in:
Lynix 2013-03-25 13:27:18 +01:00
parent 5dd2d0d6a7
commit 56feddb100
2 changed files with 8 additions and 1 deletions

View File

@ -34,6 +34,7 @@ class NAZARA_API NzScene
void Cull(); void Cull();
void Draw(); void Draw();
const NzCamera* GetActiveCamera() const;
NzBackground* GetBackground() const; NzBackground* GetBackground() const;
NzSceneNode& GetRoot() const; NzSceneNode& GetRoot() const;
float GetUpdateTime() const; float GetUpdateTime() const;

View File

@ -269,7 +269,8 @@ void NzScene::Draw()
if (instancing) if (instancing)
{ {
shader->SendInteger(lightCountLocation, lightIndex); if (lightCountLocation != -1)
shader->SendInteger(lightCountLocation, lightIndex);
unsigned int count = 0; unsigned int count = 0;
for (const NzMatrix4f& matrix : subMeshIt.second) for (const NzMatrix4f& matrix : subMeshIt.second)
@ -322,6 +323,11 @@ void NzScene::Draw()
drawable->Draw(); drawable->Draw();
} }
const NzCamera* NzScene::GetActiveCamera() const
{
return m_impl->camera;
}
NzBackground* NzScene::GetBackground() const NzBackground* NzScene::GetBackground() const
{ {
return m_impl->background.get(); return m_impl->background.get();