const NzBoundingVolumef& NzLight::GetBoundingVolume() const { if (!m_boundingVolumeUpdated) UpdateBoundingVolume(); return m_boundingVolume; }
void cLight3DSpot::SetFarAttenuation(float afX) { mfFarAttenuation = afX; UpdateBoundingVolume(); //This is so that the render container is updated. SetTransformUpdated(); mbProjectionUpdated = true; }
cBoundingVolume* iLight3D::GetBoundingVolume() { if(mbUpdateBoundingVolume) { UpdateBoundingVolume(); mbUpdateBoundingVolume = false; } return &mBoundingVolume; }
bool NzLight::FrustumCull(const NzFrustumf& frustum) { switch (m_type) { case nzLightType_Directional: return true; // Toujours visible case nzLightType_Point: if (!m_derivedUpdated) UpdateDerived(); // Un test sphérique est bien plus rapide et précis que celui de la bounding box return frustum.Contains(NzSpheref(m_derivedPosition, m_radius)); case nzLightType_Spot: if (!m_boundingVolumeUpdated) UpdateBoundingVolume(); return frustum.Contains(m_boundingVolume); } NazaraError("Invalid light type (0x" + NzString::Number(m_type, 16) + ')'); return false; }
cLight3DPoint::cLight3DPoint(tString asName, cResources *apResources) : iLight3D(asName,apResources) { mLightType = eLight3DType_Point; UpdateBoundingVolume(); }