3
0

SimpleSpotLightDelegate.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Component/TransformBus.h>
  10. #include <CoreLights/LightDelegateBase.h>
  11. #include <Atom/Feature/CoreLights/SimpleSpotLightFeatureProcessorInterface.h>
  12. #include <AzFramework/Entity/EntityDebugDisplayBus.h>
  13. namespace AZ::Render
  14. {
  15. class SimpleSpotLightDelegate final : public LightDelegateBase<SimpleSpotLightFeatureProcessorInterface>
  16. {
  17. using Base = LightDelegateBase<SimpleSpotLightFeatureProcessorInterface>;
  18. public:
  19. SimpleSpotLightDelegate(EntityId entityId, bool isVisible);
  20. // LightDelegateBase overrides...
  21. float CalculateAttenuationRadius(float lightThreshold) const override;
  22. void DrawDebugDisplay(
  23. const Transform& transform,
  24. const Color& color,
  25. AzFramework::DebugDisplayRequests& debugDisplay,
  26. bool isSelected) const override;
  27. float GetSurfaceArea() const override;
  28. float GetEffectiveSolidAngle() const override;
  29. void SetShutterAngles(float innerAngleDegrees, float outerAngleDegrees) override;
  30. void SetAffectsGI(bool affectsGI) override;
  31. void SetAffectsGIFactor(float affectsGIFactor) override;
  32. Aabb GetLocalVisualizationBounds() const override;
  33. private:
  34. void HandleShapeChanged() override;
  35. struct ConeVisualizationDimensions
  36. {
  37. float m_radius;
  38. float m_height;
  39. };
  40. ConeVisualizationDimensions CalculateConeVisualizationDimensions(float degrees) const;
  41. };
  42. inline float SimpleSpotLightDelegate::GetEffectiveSolidAngle() const
  43. {
  44. return PhotometricValue::DirectionalEffectiveSteradians;
  45. }
  46. } // namespace AZ::Render