AcquireByEntityId.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/std/string/string.h>
  10. #include <AzCore/RTTI/RTTI.h>
  11. #include <CameraFramework/ICameraTargetAcquirer.h>
  12. #include <AzCore/Component/Component.h>
  13. #include <AzCore/Memory/SystemAllocator.h>
  14. namespace AZ
  15. {
  16. class ReflectContext;
  17. }
  18. namespace Camera
  19. {
  20. //////////////////////////////////////////////////////////////////////////
  21. /// This will request Camera targets from the CameraTarget buses. It will
  22. /// then return that target's transform when requested by the Camera Rig
  23. //////////////////////////////////////////////////////////////////////////
  24. class AcquireByEntityId
  25. : public ICameraTargetAcquirer
  26. {
  27. public:
  28. ~AcquireByEntityId() override = default;
  29. AZ_RTTI(AcquireByEntityId, "{14D0D355-1F83-4F46-9DE1-D41D23BDFC3C}", ICameraTargetAcquirer)
  30. AZ_CLASS_ALLOCATOR(AcquireByEntityId, AZ::SystemAllocator);
  31. static void Reflect(AZ::ReflectContext* reflection);
  32. //////////////////////////////////////////////////////////////////////////
  33. // ICameraTargetAcquirer
  34. bool AcquireTarget(AZ::Transform& outTransformInformation) override;
  35. void Activate(AZ::EntityId) override {}
  36. void Deactivate() override {}
  37. private:
  38. //////////////////////////////////////////////////////////////////////////
  39. // Reflected Data
  40. AZ::EntityId m_target = AZ::EntityId();
  41. bool m_shouldUseTargetRotation = true;
  42. bool m_shouldUseTargetPosition = true;
  43. };
  44. } //namespace Camera