ColliderCylinderMode.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 <AzFramework/Entity/EntityDebugDisplayBus.h>
  10. #include <AzToolsFramework/ComponentModes/CapsuleViewportEdit.h>
  11. #include <Editor/Source/ComponentModes/PhysXSubComponentModeBase.h>
  12. namespace PhysX
  13. {
  14. //! Sub component mode for modifying the height and radius on a cylinder collider.
  15. class ColliderCylinderMode
  16. : public PhysXSubComponentModeBase
  17. , private AzFramework::EntityDebugDisplayEventBus::Handler
  18. {
  19. public:
  20. AZ_CLASS_ALLOCATOR_DECL
  21. // PhysXSubComponentModeBase overrides ...
  22. void Setup(const AZ::EntityComponentIdPair& idPair) override;
  23. void Refresh(const AZ::EntityComponentIdPair& idPair) override;
  24. void Teardown(const AZ::EntityComponentIdPair& idPair) override;
  25. void ResetValues(const AZ::EntityComponentIdPair& idPair) override;
  26. private:
  27. // AzFramework::EntityDebugDisplayEventBus overrides ...
  28. void DisplayEntityViewport(
  29. const AzFramework::ViewportInfo& viewportInfo,
  30. AzFramework::DebugDisplayRequests& debugDisplay) override;
  31. AZ::EntityComponentIdPair m_entityComponentIdPair;
  32. // cylinder is equivalent to capsule for the purposes of viewport editing
  33. AZStd::unique_ptr<AzToolsFramework::CapsuleViewportEdit> m_capsuleViewportEdit;
  34. };
  35. } //namespace PhysX