GradientWeightModifierController.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/Component.h>
  10. #include <AzCore/Component/TransformBus.h>
  11. #include <AtomLyIntegration/CommonFeatures/PostProcess/GradientWeightModifier/GradientWeightModifierComponentConfig.h>
  12. #include <AtomLyIntegration/CommonFeatures/PostProcess/PostFxWeightRequestBus.h>
  13. namespace AZ
  14. {
  15. namespace Render
  16. {
  17. class GradientWeightModifierComponentController final
  18. : public PostFxWeightRequestBus::Handler
  19. {
  20. public:
  21. friend class EditorGradientWeightModifierComponent;
  22. AZ_TYPE_INFO(AZ::Render::GradientWeightModifierComponentController, "{62AB316D-8B8E-434E-8F87-C4ABC42642A6}");
  23. static void Reflect(AZ::ReflectContext* context);
  24. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  25. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  26. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  27. GradientWeightModifierComponentController() = default;
  28. GradientWeightModifierComponentController(const GradientWeightModifierComponentConfig& config);
  29. void Activate(EntityId entityId);
  30. void Deactivate();
  31. void SetConfiguration(const GradientWeightModifierComponentConfig& config);
  32. const GradientWeightModifierComponentConfig& GetConfiguration() const { return m_configuration; }
  33. virtual float GetWeightAtPosition(const AZ::Vector3& influencerPosition) const override;
  34. private:
  35. AZ_DISABLE_COPY(GradientWeightModifierComponentController);
  36. GradientWeightModifierComponentConfig m_configuration;
  37. EntityId m_entityId;
  38. };
  39. }
  40. }