EditorQuadShapeComponent.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 "EditorBaseShapeComponent.h"
  10. #include "QuadShapeComponent.h"
  11. #include <AzFramework/Entity/EntityDebugDisplayBus.h>
  12. #include <LmbrCentral/Shape/QuadShapeComponentBus.h>
  13. namespace LmbrCentral
  14. {
  15. //! Editor representation of a rectangle in 3d space.
  16. class EditorQuadShapeComponent
  17. : public EditorBaseShapeComponent
  18. , private AzFramework::EntityDebugDisplayEventBus::Handler
  19. {
  20. public:
  21. AZ_EDITOR_COMPONENT(LmbrCentral::EditorQuadShapeComponent, EditorQuadShapeComponentTypeId, EditorBaseShapeComponent);
  22. static void Reflect(AZ::ReflectContext* context);
  23. EditorQuadShapeComponent() = default;
  24. //! AZ::Component overrides...
  25. void Init() override;
  26. void Activate() override;
  27. void Deactivate() override;
  28. //! EditorComponentBase overrides...
  29. void BuildGameEntity(AZ::Entity* gameEntity) override;
  30. protected:
  31. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  32. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  33. private:
  34. AZ_DISABLE_COPY_MOVE(EditorQuadShapeComponent);
  35. //! AzFramework::EntityDebugDisplayEventBus overrides...
  36. void DisplayEntityViewport(
  37. const AzFramework::ViewportInfo& viewportInfo,
  38. AzFramework::DebugDisplayRequests& debugDisplay) override;
  39. void ConfigurationChanged();
  40. QuadShape m_quadShape; //! Stores underlying quad representation for this component.
  41. };
  42. } // namespace LmbrCentral