EditorTerrainPhysicsColliderComponent.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 <Components/TerrainPhysicsColliderComponent.h>
  10. #include <AzToolsFramework/ToolsComponents/EditorComponentBase.h>
  11. #include <LmbrCentral/Component/EditorWrappedComponentBase.h>
  12. #include <EditorSurfaceTagListProvider.h>
  13. namespace Terrain
  14. {
  15. class EditorTerrainPhysicsColliderComponent
  16. : public AzToolsFramework::Components::EditorComponentBase
  17. , public EditorSurfaceTagListProvider
  18. {
  19. public:
  20. AZ_EDITOR_COMPONENT(EditorTerrainPhysicsColliderComponent, "{C43FAB8F-3968-46A6-920E-E84AEDED3DF5}", AzToolsFramework::Components::EditorComponentBase);
  21. static void Reflect(AZ::ReflectContext* context);
  22. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services);
  23. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& services);
  24. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& services);
  25. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& services);
  26. // AZ::Component interface implementation
  27. void Init() override;
  28. void Activate() override;
  29. void Deactivate() override;
  30. // EditorComponentBase overrides...
  31. void BuildGameEntity(AZ::Entity* gameEntity) override;
  32. static constexpr auto s_categoryName = "Terrain";
  33. static constexpr auto s_componentName = "Terrain Physics Heightfield Collider";
  34. static constexpr auto s_componentDescription = "Provides terrain data to a physics collider in the form of a heightfield and surface->material mapping.";
  35. static constexpr auto s_icon = "Editor/Icons/Components/TerrainPhysicsCollider.svg";
  36. static constexpr auto s_viewportIcon = "Editor/Icons/Components/Viewport/TerrainPhysicsCollider.svg";
  37. static constexpr auto s_helpUrl = "";
  38. private:
  39. // EditorSurfaceTagListProvider interface implementation
  40. AZStd::unordered_set<SurfaceData::SurfaceTag> GetSurfaceTagsInUse() const override;
  41. AZ::u32 ConfigurationChanged();
  42. void UpdateConfigurationTagProvider();
  43. TerrainPhysicsColliderConfig m_configuration;
  44. TerrainPhysicsColliderComponent m_component;
  45. };
  46. }