Rotate.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 <CameraFramework/ICameraTransformBehavior.h>
  10. #include <AzCore/Math/Transform.h>
  11. #include <AzCore/RTTI/ReflectContext.h>
  12. #include "StartingPointCamera/StartingPointCameraConstants.h"
  13. #include <AzCore/Memory/SystemAllocator.h>
  14. namespace Camera
  15. {
  16. //////////////////////////////////////////////////////////////////////////
  17. /// This behavior will rotate the calculated camera transform
  18. //////////////////////////////////////////////////////////////////////////
  19. class Rotate
  20. : public ICameraTransformBehavior
  21. {
  22. public:
  23. ~Rotate() override = default;
  24. AZ_RTTI(Rotate, "{EE06111E-75E8-47F0-B243-5A5308A5F605}", ICameraTransformBehavior)
  25. AZ_CLASS_ALLOCATOR(Rotate, AZ::SystemAllocator);
  26. static void Reflect(AZ::ReflectContext* reflection);
  27. //////////////////////////////////////////////////////////////////////////
  28. // ICameraTransformBehavior
  29. void AdjustCameraTransform(float deltaTime, const AZ::Transform& initialCameraTransform, const AZ::Transform& targetTransform, AZ::Transform& inOutCameraTransform) override;
  30. void Activate(AZ::EntityId) override {}
  31. void Deactivate() override {}
  32. private:
  33. //////////////////////////////////////////////////////////////////////////
  34. // Reflected Data
  35. float m_angleInDegrees = 0.f;
  36. AxisOfRotation m_axisType = X_Axis;
  37. };
  38. } // namespace Camera