CameraSystemComponent.h 2.1 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 <AzCore/Component/Component.h>
  10. #include <AzFramework/Components/CameraBus.h>
  11. namespace Camera
  12. {
  13. class CameraSystemComponent
  14. : public AZ::Component
  15. , private CameraSystemRequestBus::Handler
  16. , private ActiveCameraRequestBus::Handler
  17. , private CameraNotificationBus::Handler
  18. {
  19. public:
  20. AZ_COMPONENT(CameraSystemComponent, "{5DF8DB49-6430-4718-9417-85321596EDA5}");
  21. static void Reflect(AZ::ReflectContext* context);
  22. CameraSystemComponent() = default;
  23. ~CameraSystemComponent() override = default;
  24. //////////////////////////////////////////////////////////////////////////
  25. // AZ::Component
  26. void Activate() override;
  27. void Deactivate() override;
  28. //////////////////////////////////////////////////////////////////////////
  29. private:
  30. //////////////////////////////////////////////////////////////////////////
  31. // CameraSystemRequestBus
  32. AZ::EntityId GetActiveCamera() override;
  33. //////////////////////////////////////////////////////////////////////////
  34. //////////////////////////////////////////////////////////////////////////
  35. // ActiveCameraRequestBus
  36. const AZ::Transform& GetActiveCameraTransform() override;
  37. const Configuration& GetActiveCameraConfiguration() override;
  38. //////////////////////////////////////////////////////////////////////////
  39. //////////////////////////////////////////////////////////////////////////
  40. // CameraNotificationBus
  41. void OnActiveViewChanged(const AZ::EntityId&) override;
  42. //////////////////////////////////////////////////////////////////////////
  43. struct CameraProperties
  44. {
  45. AZ::Transform transform;
  46. Configuration configuration;
  47. };
  48. AZ::EntityId m_activeView;
  49. CameraProperties m_activeViewProperties;
  50. };
  51. } // namespace Camera