RagdollOutlinerNotificationHandler.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #if !defined(Q_MOC_RUN)
  10. #include <Editor/Plugins/SkeletonOutliner/SkeletonOutlinerBus.h>
  11. #endif
  12. QT_FORWARD_DECLARE_CLASS(QVBoxLayout)
  13. namespace EMotionFX
  14. {
  15. class Node;
  16. class RagdollNodeWidget;
  17. class RagdollOutlinerNotificationHandler
  18. : public QObject
  19. , private EMotionFX::SkeletonOutlinerNotificationBus::Handler
  20. {
  21. Q_OBJECT //AUTOMOC
  22. public:
  23. RagdollOutlinerNotificationHandler(RagdollNodeWidget* nodeWidget);
  24. ~RagdollOutlinerNotificationHandler() override;
  25. // SkeletonOutlinerNotificationBus overrides
  26. void OnContextMenu(QMenu* menu, const QModelIndexList& selectedRowIndices) override;
  27. static void AddToRagdoll(const QModelIndexList& modelIndices);
  28. static void RemoveFromRagdoll(const QModelIndexList& modelIndices);
  29. static bool IsNodeInRagdoll(const QModelIndex& index);
  30. static void AddCollider(const QModelIndexList& modelIndices, const AZ::TypeId& colliderType);
  31. static void CopyColliders(const QModelIndexList& modelIndices, PhysicsSetup::ColliderConfigType copyFrom);
  32. public slots:
  33. void OnAddToRagdoll();
  34. void OnAddCollider();
  35. void OnRemoveFromRagdoll();
  36. void OnClearColliders();
  37. void OnPasteJointLimits();
  38. private:
  39. bool IsPhysXGemAvailable() const;
  40. RagdollNodeWidget* m_nodeWidget = nullptr;
  41. };
  42. } // namespace EMotionFX