ColliderRotationManipulators.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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/TickBus.h>
  10. #include <AzToolsFramework/Manipulators/RotationManipulators.h>
  11. #include <Editor/Plugins/Ragdoll/PhysicsSetupManipulatorCommandCallback.h>
  12. #include <Editor/Plugins/Ragdoll/PhysicsSetupManipulators.h>
  13. #include <MCore/Source/Command.h>
  14. #include <MCore/Source/MCoreCommandManager.h>
  15. namespace EMotionFX
  16. {
  17. //! Provides functionality for interactively editing character physics collider orientations in the Animation Editor Viewport.
  18. class ColliderRotationManipulators
  19. : public PhysicsSetupManipulatorsBase
  20. , private AZ::TickBus::Handler
  21. , private PhysicsSetupManipulatorRequestBus::Handler
  22. {
  23. public:
  24. ColliderRotationManipulators();
  25. void Setup(const PhysicsSetupManipulatorData& physicsSetupManipulatorData) override;
  26. void Refresh() override;
  27. void Teardown() override;
  28. void ResetValues() override;
  29. private:
  30. // AZ::TickBus::Handler overrides ...
  31. void OnTick(float delta, AZ::ScriptTimePoint timePoint) override;
  32. // PhysicsSetupManipulatorRequestBus::Handler overrides ...
  33. void OnUnderlyingPropertiesChanged() override;
  34. void OnManipulatorMoved(const AZ::Quaternion& rotation);
  35. void BeginEditing(const AZ::Quaternion& rotation);
  36. void EndEditing(const AZ::Quaternion& rotation);
  37. AzToolsFramework::RotationManipulators m_rotationManipulators;
  38. PhysicsSetupManipulatorData m_physicsSetupManipulatorData;
  39. MCore::CommandGroup m_commandGroup;
  40. AZStd::unique_ptr<PhysicsSetupManipulatorCommandCallback> m_adjustColliderCallback;
  41. };
  42. } // namespace EMotionFX