Big Graphics update

Separated LightManager
Added Sprite class
Added View class
Camera is no longer a SceneNode
Fixed Material not invalidating programs
Renamed CameraPosition uniform to EyePosition
Renamed VisibilityTest to FrustumCull


Former-commit-id: ff7fbe4d9b31a3c269baab0b48c6faa347a12161
This commit is contained in:
Lynix
2013-08-21 20:05:33 +02:00
parent 09e3027129
commit c8414a39d8
39 changed files with 1772 additions and 556 deletions

View File

@@ -630,6 +630,25 @@ NzModel& NzModel::operator=(NzModel&& node)
return *this;
}
bool NzModel::FrustumCull(const NzFrustumf& frustum)
{
#if NAZARA_GRAPHICS_SAFE
if (!IsDrawable())
{
NazaraError("Model is not drawable");
return false;
}
#endif
if (!m_drawEnabled)
return false;
if (!m_boundingVolumeUpdated)
UpdateBoundingVolume();
return frustum.Contains(m_boundingVolume);
}
void NzModel::Invalidate()
{
NzSceneNode::Invalidate();
@@ -671,23 +690,4 @@ void NzModel::UpdateBoundingVolume() const
m_boundingVolumeUpdated = true;
}
bool NzModel::VisibilityTest(const NzCamera* camera)
{
#if NAZARA_GRAPHICS_SAFE
if (!IsDrawable())
{
NazaraError("Model is not drawable");
return false;
}
#endif
if (!m_drawEnabled)
return false;
if (!m_boundingVolumeUpdated)
UpdateBoundingVolume();
return camera->GetFrustum().Contains(m_boundingVolume);
}
NzModelLoader::LoaderList NzModel::s_loaders;