VegetationModule.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. #include <VegetationModule.h>
  9. #include <Components/AreaBlenderComponent.h>
  10. #include <Components/BlockerComponent.h>
  11. #include <Components/DescriptorListCombinerComponent.h>
  12. #include <Components/DescriptorListComponent.h>
  13. #include <Components/DescriptorWeightSelectorComponent.h>
  14. #include <Components/DistanceBetweenFilterComponent.h>
  15. #include <Components/DistributionFilterComponent.h>
  16. #include <Components/LevelSettingsComponent.h>
  17. #include <Components/MeshBlockerComponent.h>
  18. #include <Components/PositionModifierComponent.h>
  19. #include <Components/RotationModifierComponent.h>
  20. #include <Components/ScaleModifierComponent.h>
  21. #include <Components/ShapeIntersectionFilterComponent.h>
  22. #include <Components/SlopeAlignmentModifierComponent.h>
  23. #include <Components/SpawnerComponent.h>
  24. #include <Components/SurfaceAltitudeFilterComponent.h>
  25. #include <Components/SurfaceMaskDepthFilterComponent.h>
  26. #include <Components/SurfaceMaskFilterComponent.h>
  27. #include <Components/SurfaceSlopeFilterComponent.h>
  28. #include <Debugger/DebugComponent.h>
  29. #include <Debugger/AreaDebugComponent.h>
  30. #include <AreaSystemComponent.h>
  31. #include <InstanceSystemComponent.h>
  32. #include <VegetationSystemComponent.h>
  33. #include <DebugSystemComponent.h>
  34. namespace Vegetation
  35. {
  36. VegetationModule::VegetationModule()
  37. : AZ::Module()
  38. {
  39. m_descriptors.insert(m_descriptors.end(), {
  40. AreaBlenderComponent::CreateDescriptor(),
  41. BlockerComponent::CreateDescriptor(),
  42. DescriptorListCombinerComponent::CreateDescriptor(),
  43. DescriptorListComponent::CreateDescriptor(),
  44. DescriptorWeightSelectorComponent::CreateDescriptor(),
  45. DistanceBetweenFilterComponent::CreateDescriptor(),
  46. DistributionFilterComponent::CreateDescriptor(),
  47. LevelSettingsComponent::CreateDescriptor(),
  48. MeshBlockerComponent::CreateDescriptor(),
  49. PositionModifierComponent::CreateDescriptor(),
  50. RotationModifierComponent::CreateDescriptor(),
  51. ScaleModifierComponent::CreateDescriptor(),
  52. ShapeIntersectionFilterComponent::CreateDescriptor(),
  53. SlopeAlignmentModifierComponent::CreateDescriptor(),
  54. SpawnerComponent::CreateDescriptor(),
  55. SurfaceAltitudeFilterComponent::CreateDescriptor(),
  56. SurfaceMaskDepthFilterComponent::CreateDescriptor(),
  57. SurfaceMaskFilterComponent::CreateDescriptor(),
  58. SurfaceSlopeFilterComponent::CreateDescriptor(),
  59. AreaSystemComponent::CreateDescriptor(),
  60. InstanceSystemComponent::CreateDescriptor(),
  61. VegetationSystemComponent::CreateDescriptor(),
  62. DebugComponent::CreateDescriptor(),
  63. DebugSystemComponent::CreateDescriptor(),
  64. AreaDebugComponent::CreateDescriptor(),
  65. });
  66. }
  67. AZ::ComponentTypeList VegetationModule::GetRequiredSystemComponents() const
  68. {
  69. // [LY-90913] Revisit the need for these to be required components if/when other components ever get created that fulfill the same
  70. // service and interface as these. Until then, making them required improves usability because users will be guided to add all the
  71. // dependent system components that vegetation needs.
  72. return AZ::ComponentTypeList{
  73. azrtti_typeid<VegetationSystemComponent>(),
  74. azrtti_typeid<AreaSystemComponent>(),
  75. azrtti_typeid<InstanceSystemComponent>(),
  76. azrtti_typeid<DebugSystemComponent>(),
  77. };
  78. }
  79. }
  80. #if !defined(VEGETATION_EDITOR)
  81. #if defined(O3DE_GEM_NAME)
  82. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), Vegetation::VegetationModule)
  83. #else
  84. AZ_DECLARE_MODULE_CLASS(Gem_Vegetation, Vegetation::VegetationModule)
  85. #endif
  86. #endif