| 12 | #include "Engine/Level/Scene/SceneRendering.h" |
| 13 | |
| 14 | SpotLight::SpotLight(const SpawnParams& params) |
| 15 | : LightWithShadow(params) |
| 16 | , _radius(1000.0f) |
| 17 | , _outerConeAngle(43.0f) |
| 18 | , _innerConeAngle(10.0f) |
| 19 | { |
| 20 | CastVolumetricShadow = false; |
| 21 | ShadowsDistance = 2000.0f; |
| 22 | ShadowsFadeDistance = 100.0f; |
| 23 | ShadowsDepthBias = 0.5f; |
| 24 | |
| 25 | _direction = Vector3::Forward; |
| 26 | _cosOuterCone = Math::Cos(_outerConeAngle * DegreesToRadians); |
| 27 | _cosInnerCone = Math::Cos(_innerConeAngle * DegreesToRadians); |
| 28 | _invCosConeDifference = 1.0f / (_cosInnerCone - _cosOuterCone); |
| 29 | const float boundsRadius = Math::Sqrt(1.25f * _radius * _radius - _radius * _radius * _cosOuterCone); |
| 30 | _sphere = BoundingSphere(GetPosition() + 0.5f * GetDirection() * _radius, boundsRadius); |
| 31 | BoundingBox::FromSphere(_sphere, _box); |
| 32 | } |
| 33 | |
| 34 | float SpotLight::ComputeBrightness() const |
| 35 | { |
nothing calls this directly
no test coverage detected