CameraFrameworkGem.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 "CameraRigComponent.h"
  9. #include <AzCore/Module/Module.h>
  10. #include <AzFramework/Metrics/MetricsPlainTextNameRegistration.h>
  11. namespace CameraFramework
  12. {
  13. class CameraFrameworkModule
  14. : public AZ::Module
  15. {
  16. public:
  17. AZ_RTTI(CameraFrameworkModule, "{F9223D55-1D4C-4746-8864-5E2075A4DE50}", AZ::Module);
  18. CameraFrameworkModule()
  19. : AZ::Module()
  20. {
  21. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  22. m_descriptors.insert(m_descriptors.end(), {
  23. Camera::CameraRigComponent::CreateDescriptor(),
  24. });
  25. // This is an internal Amazon gem, so register it's components for metrics tracking, otherwise the name of the component won't get sent back.
  26. // IF YOU ARE A THIRDPARTY WRITING A GEM, DO NOT REGISTER YOUR COMPONENTS WITH EditorMetricsComponentRegistrationBus
  27. AZStd::vector<AZ::Uuid> typeIds;
  28. typeIds.reserve(m_descriptors.size());
  29. for (AZ::ComponentDescriptor* descriptor : m_descriptors)
  30. {
  31. typeIds.emplace_back(descriptor->GetUuid());
  32. }
  33. AzFramework::MetricsPlainTextNameRegistrationBus::Broadcast(
  34. &AzFramework::MetricsPlainTextNameRegistrationBus::Events::RegisterForNameSending, typeIds);
  35. }
  36. };
  37. }
  38. #if defined(O3DE_GEM_NAME)
  39. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), CameraFramework::CameraFrameworkModule)
  40. #else
  41. AZ_DECLARE_MODULE_CLASS(Gem_CameraFramework, CameraFramework::CameraFrameworkModule)
  42. #endif