ColliderOffsetMode.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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 <Editor/Source/ComponentModes/PhysXSubComponentModeBase.h>
  10. #include <AzToolsFramework/Manipulators/TranslationManipulators.h>
  11. namespace PhysX
  12. {
  13. /// Sub component mode for modifying offset on a collider in the viewport.
  14. class ColliderOffsetMode : public PhysXSubComponentModeBase
  15. {
  16. public:
  17. AZ_CLASS_ALLOCATOR_DECL
  18. ColliderOffsetMode();
  19. // PhysXSubComponentModeBase ...
  20. void Setup(const AZ::EntityComponentIdPair& idPair) override;
  21. void Refresh(const AZ::EntityComponentIdPair& idPair) override;
  22. void Teardown(const AZ::EntityComponentIdPair& idPair) override;
  23. void ResetValues(const AZ::EntityComponentIdPair& idPair) override;
  24. private:
  25. void OnManipulatorMoved(
  26. const AZ::Vector3& startPosition, const AZ::Vector3& offset, const AZ::EntityComponentIdPair& idPair);
  27. AzToolsFramework::TranslationManipulators m_translationManipulators;
  28. };
  29. } //namespace PhysX