Ejemplo n.º 1
0
const NzBoundingVolumef& NzLight::GetBoundingVolume() const
{
	if (!m_boundingVolumeUpdated)
		UpdateBoundingVolume();

	return m_boundingVolume;
}
Ejemplo n.º 2
0
	void cLight3DSpot::SetFarAttenuation(float afX)
	{
		mfFarAttenuation = afX;

		UpdateBoundingVolume();

		//This is so that the render container is updated.
		SetTransformUpdated();
		mbProjectionUpdated = true;
	}
Ejemplo n.º 3
0
	cBoundingVolume* iLight3D::GetBoundingVolume()
	{
		if(mbUpdateBoundingVolume)
		{
			UpdateBoundingVolume();
			mbUpdateBoundingVolume = false;
		}

		return &mBoundingVolume;
	}
Ejemplo n.º 4
0
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;
}
Ejemplo n.º 5
0
	cLight3DPoint::cLight3DPoint(tString asName, cResources *apResources) : iLight3D(asName,apResources)
	{
		mLightType = eLight3DType_Point;

		UpdateBoundingVolume();
	}