Modified SceneNode::FrustumCull

Now provides an implementation which will test the bounding volume
against the frustum (Basic frustum culling)
Is now const
Disabled face culling on sprites


Former-commit-id: 5cb7a94b38ef8b0ffa5a78f16f5ef65a59ab375d
This commit is contained in:
Lynix
2014-06-05 21:28:17 +02:00
parent bc9c8c6bdb
commit a31ced1d76
10 changed files with 13 additions and 36 deletions

View File

@@ -229,7 +229,7 @@ void NzLight::Disable(const NzShader* shader, const NzLightUniforms& uniforms, i
shader->SendInteger(uniforms.locations.type + offset, -1);
}
bool NzLight::FrustumCull(const NzFrustumf& frustum)
bool NzLight::FrustumCull(const NzFrustumf& frustum) const
{
switch (m_type)
{
@@ -244,10 +244,7 @@ bool NzLight::FrustumCull(const NzFrustumf& frustum)
return frustum.Contains(NzSpheref(m_derivedPosition, m_radius));
case nzLightType_Spot:
if (!m_boundingVolumeUpdated)
UpdateBoundingVolume();
return frustum.Contains(m_boundingVolume);
return NzSceneNode::FrustumCull(frustum);
}
NazaraError("Invalid light type (0x" + NzString::Number(m_type, 16) + ')');