MotionMatchingEditorSystemComponent.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 <MotionMatchingSystemComponent.h>
  11. #include <AzToolsFramework/Entity/EditorEntityContextBus.h>
  12. #include <MotionMatchingData.h>
  13. namespace EMotionFX::MotionMatching
  14. {
  15. /// System component for MotionMatching editor
  16. class MotionMatchingEditorSystemComponent
  17. : public MotionMatchingSystemComponent
  18. , protected MotionMatchingEditorRequestBus::Handler
  19. , private AzToolsFramework::EditorEvents::Bus::Handler
  20. {
  21. using BaseSystemComponent = MotionMatchingSystemComponent;
  22. public:
  23. AZ_COMPONENT(MotionMatchingEditorSystemComponent, "{a43957d3-5a2d-4c29-873d-7daacc357722}", BaseSystemComponent);
  24. static void Reflect(AZ::ReflectContext* context);
  25. MotionMatchingEditorSystemComponent();
  26. ~MotionMatchingEditorSystemComponent();
  27. // AZTickBus overrides ...
  28. int GetTickOrder() override
  29. {
  30. return AZ::TICK_PRE_RENDER;
  31. }
  32. void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
  33. // MotionMatchingRequestBus overrides ...
  34. void SetDebugDrawFeatureSchema(FeatureSchema* featureSchema) override;
  35. FeatureSchema* GetDebugDrawFeatureSchema() const override;
  36. private:
  37. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  38. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  39. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  40. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  41. // AZ::Component
  42. void Activate() override;
  43. void Deactivate() override;
  44. // Debug drawing
  45. void DebugDraw(AZ::s32 debugDisplayId) override;
  46. void DebugDrawFrameFeatures(AzFramework::DebugDisplayRequests* debugDisplay);
  47. MotionInstance* m_lastMotionInstance = nullptr;
  48. AZStd::unique_ptr<MotionMatchingData> m_data;
  49. FeatureSchema* m_debugVisFeatureSchema = nullptr;
  50. };
  51. } // namespace EMotionFX::MotionMatching