EditorCompoundShapeComponent.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 "CompoundShapeComponent.h"
  11. #include <LmbrCentral/Shape/CompoundShapeComponentBus.h>
  12. namespace LmbrCentral
  13. {
  14. class EditorCompoundShapeComponent
  15. : public EditorBaseShapeComponent
  16. , private CompoundShapeComponentRequestsBus::Handler
  17. , private CompoundShapeComponentHierarchyRequestsBus::Handler
  18. {
  19. public:
  20. AZ_EDITOR_COMPONENT(EditorCompoundShapeComponent, EditorCompoundShapeComponentTypeId, EditorBaseShapeComponent);
  21. static void Reflect(AZ::ReflectContext* context);
  22. // AZ::Component
  23. void Init() override;
  24. void Activate() override;
  25. void Deactivate() override;
  26. // EditorComponentBase
  27. void BuildGameEntity(AZ::Entity* gameEntity) override;
  28. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  29. {
  30. EditorBaseShapeComponent::GetProvidedServices(provided);
  31. provided.push_back(AZ_CRC_CE("CompoundShapeService"));
  32. }
  33. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  34. AZ::u32 ConfigurationChanged();
  35. private:
  36. // CompoundShapeComponentRequestsBus::Handler
  37. const CompoundShapeConfiguration& GetCompoundShapeConfiguration() const override
  38. {
  39. return m_configuration;
  40. }
  41. // CompoundShapeComponentHierarchyRequestsBus::Handler
  42. bool HasChildId(const AZ::EntityId& entityId) const override;
  43. bool ValidateChildIds() override;
  44. bool ValidateConfiguration();
  45. CompoundShapeConfiguration m_configuration; ///< Stores configuration for this component.
  46. CompoundShapeComponent m_component;
  47. };
  48. } // namespace LmbrCentral