3
0

EditorMeshBlockerComponent.h 2.2 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/Module/Module.h>
  10. #include <AzToolsFramework/ToolsComponents/EditorComponentBase.h>
  11. #include <AzToolsFramework/ToolsComponents/EditorVisibilityBus.h>
  12. #include <Components/MeshBlockerComponent.h>
  13. #include <AzFramework/Entity/EntityDebugDisplayBus.h>
  14. #include <Vegetation/Editor/EditorAreaComponentBase.h>
  15. namespace Vegetation
  16. {
  17. class EditorMeshBlockerComponent
  18. : public EditorAreaComponentBase<MeshBlockerComponent, MeshBlockerConfig>
  19. , private AzFramework::EntityDebugDisplayEventBus::Handler
  20. {
  21. public:
  22. using DerivedClassType = EditorMeshBlockerComponent;
  23. using BaseClassType = EditorAreaComponentBase<MeshBlockerComponent, MeshBlockerConfig>;
  24. AZ_EDITOR_COMPONENT(EditorMeshBlockerComponent, EditorMeshBlockerComponentTypeId, BaseClassType);
  25. static void Reflect(AZ::ReflectContext* context);
  26. //////////////////////////////////////////////////////////////////////////
  27. // AZ::Component interface implementation
  28. void Activate() override;
  29. void Deactivate() override;
  30. //////////////////////////////////////////////////////////////////////////
  31. // AzFramework::EntityDebugDisplayEventBus
  32. void DisplayEntityViewport(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) override;
  33. static constexpr const char* const s_categoryName = "Vegetation";
  34. static constexpr const char* const s_componentName = "Vegetation Layer Blocker (Mesh)";
  35. static constexpr const char* const s_componentDescription = "Prevents vegetation from being placed in the mesh";
  36. static constexpr const char* const s_icon = "Editor/Icons/Components/Vegetation.svg";
  37. static constexpr const char* const s_viewportIcon = "Editor/Icons/Components/Viewport/Vegetation.svg";
  38. static constexpr const char* const s_helpUrl = "https://www.o3de.org/docs/user-guide/components/reference/vegetation/vegetation-layer-blocker-mesh/";
  39. private:
  40. bool m_drawDebugBounds = false;
  41. };
  42. }