DebugDrawModule.cpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 "DebugDrawSystemComponent.h"
  9. #include "DebugDrawLineComponent.h"
  10. #include "DebugDrawRayComponent.h"
  11. #include "DebugDrawSphereComponent.h"
  12. #include "DebugDrawObbComponent.h"
  13. #include "DebugDrawTextComponent.h"
  14. #ifdef DEBUGDRAW_GEM_EDITOR
  15. #include "EditorDebugDrawLineComponent.h"
  16. #include "EditorDebugDrawRayComponent.h"
  17. #include "EditorDebugDrawSphereComponent.h"
  18. #include "EditorDebugDrawObbComponent.h"
  19. #include "EditorDebugDrawTextComponent.h"
  20. #endif // DEBUGDRAW_GEM_EDITOR
  21. #include <IGem.h>
  22. namespace DebugDraw
  23. {
  24. class DebugDrawModule
  25. : public CryHooksModule
  26. {
  27. public:
  28. AZ_RTTI(DebugDrawModule, "{07AC9E51-535C-402D-A2EB-529366ED9985}", CryHooksModule);
  29. DebugDrawModule()
  30. : CryHooksModule()
  31. {
  32. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  33. m_descriptors.insert(m_descriptors.end(), {
  34. //DebugDrawSystemComponent::CreateDescriptor(),
  35. DebugDrawLineComponent::CreateDescriptor(),
  36. DebugDrawRayComponent::CreateDescriptor(),
  37. DebugDrawSphereComponent::CreateDescriptor(),
  38. DebugDrawObbComponent::CreateDescriptor(),
  39. DebugDrawTextComponent::CreateDescriptor(),
  40. DebugDrawSystemComponent::CreateDescriptor(),
  41. #ifdef DEBUGDRAW_GEM_EDITOR
  42. EditorDebugDrawLineComponent::CreateDescriptor(),
  43. EditorDebugDrawRayComponent::CreateDescriptor(),
  44. EditorDebugDrawSphereComponent::CreateDescriptor(),
  45. EditorDebugDrawObbComponent::CreateDescriptor(),
  46. EditorDebugDrawTextComponent::CreateDescriptor(),
  47. #endif // DEBUGDRAW_GEM_EDITOR
  48. });
  49. }
  50. /**
  51. * Add required SystemComponents to the SystemEntity.
  52. */
  53. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  54. {
  55. return AZ::ComponentTypeList{
  56. azrtti_typeid<DebugDrawSystemComponent>(),
  57. };
  58. }
  59. };
  60. }
  61. #if defined(O3DE_GEM_NAME)
  62. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), DebugDraw::DebugDrawModule)
  63. #else
  64. AZ_DECLARE_MODULE_CLASS(Gem_DebugDraw, DebugDraw::DebugDrawModule)
  65. #endif