ColliderAssetScaleMode.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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/ScaleManipulators.h>
  11. namespace PhysX
  12. {
  13. /// Sub component mode for modifying the asset scale on a collider in the viewport.
  14. class ColliderAssetScaleMode : public PhysXSubComponentModeBase
  15. {
  16. public:
  17. AZ_CLASS_ALLOCATOR_DECL
  18. ColliderAssetScaleMode();
  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 OnManipulatorDown(const AZ::EntityComponentIdPair& idPair);
  26. void OnManipulatorMoved(const AZ::Vector3& scale, const AZ::EntityComponentIdPair& idPair);
  27. AZ::Vector3 m_initialScale;
  28. AzToolsFramework::ScaleManipulators m_dimensionsManipulators;
  29. };
  30. } //namespace PhysX