Graphics/SpotLight: Add UpdateAngles method
This commit is contained in:
parent
3514ac6340
commit
b7bdc74f3f
|
|
@ -46,6 +46,7 @@ namespace Nz
|
||||||
std::unique_ptr<LightShadowData> InstanciateShadowData(FramePipeline& pipeline, ElementRendererRegistry& elementRegistry) const override;
|
std::unique_ptr<LightShadowData> InstanciateShadowData(FramePipeline& pipeline, ElementRendererRegistry& elementRegistry) const override;
|
||||||
|
|
||||||
inline void UpdateAmbientFactor(float factor);
|
inline void UpdateAmbientFactor(float factor);
|
||||||
|
inline void UpdateAngles(RadianAnglef innerAngle, RadianAnglef outerAngle);
|
||||||
inline void UpdateColor(Color color);
|
inline void UpdateColor(Color color);
|
||||||
inline void UpdateDiffuseFactor(float factor);
|
inline void UpdateDiffuseFactor(float factor);
|
||||||
inline void UpdateDirection(const Vector3f& direction);
|
inline void UpdateDirection(const Vector3f& direction);
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,7 @@ namespace Nz
|
||||||
m_ambientFactor(0.2f),
|
m_ambientFactor(0.2f),
|
||||||
m_diffuseFactor(1.f)
|
m_diffuseFactor(1.f)
|
||||||
{
|
{
|
||||||
UpdateInnerAngle(DegreeAnglef(30.f));
|
UpdateAngles(DegreeAnglef(30.f), DegreeAnglef(45.f));
|
||||||
UpdateOuterAngle(DegreeAnglef(45.f));
|
|
||||||
UpdateRadius(5.f);
|
UpdateRadius(5.f);
|
||||||
UpdateRotation(Quaternionf::Identity());
|
UpdateRotation(Quaternionf::Identity());
|
||||||
}
|
}
|
||||||
|
|
@ -98,6 +97,19 @@ namespace Nz
|
||||||
OnLightDataInvalided(this);
|
OnLightDataInvalided(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void SpotLight::UpdateAngles(RadianAnglef innerAngle, RadianAnglef outerAngle)
|
||||||
|
{
|
||||||
|
m_innerAngle = innerAngle;
|
||||||
|
m_innerAngleCos = m_innerAngle.GetCos();
|
||||||
|
m_outerAngle = outerAngle;
|
||||||
|
m_outerAngleCos = m_outerAngle.GetCos();
|
||||||
|
m_outerAngleTan = m_outerAngle.GetTan();
|
||||||
|
|
||||||
|
UpdateBoundingVolume();
|
||||||
|
UpdateViewProjMatrix();
|
||||||
|
OnLightDataInvalided(this);
|
||||||
|
}
|
||||||
|
|
||||||
inline void SpotLight::UpdateColor(Color color)
|
inline void SpotLight::UpdateColor(Color color)
|
||||||
{
|
{
|
||||||
m_color = color;
|
m_color = color;
|
||||||
|
|
@ -121,6 +133,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
m_innerAngle = innerAngle;
|
m_innerAngle = innerAngle;
|
||||||
m_innerAngleCos = m_innerAngle.GetCos();
|
m_innerAngleCos = m_innerAngle.GetCos();
|
||||||
|
|
||||||
|
OnLightDataInvalided(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void SpotLight::UpdateOuterAngle(RadianAnglef outerAngle)
|
inline void SpotLight::UpdateOuterAngle(RadianAnglef outerAngle)
|
||||||
|
|
@ -131,6 +145,7 @@ namespace Nz
|
||||||
|
|
||||||
UpdateBoundingVolume();
|
UpdateBoundingVolume();
|
||||||
UpdateViewProjMatrix();
|
UpdateViewProjMatrix();
|
||||||
|
OnLightDataInvalided(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void SpotLight::UpdatePosition(const Vector3f& position)
|
inline void SpotLight::UpdatePosition(const Vector3f& position)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue