FeatureAngularVelocity.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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/Math/Vector3.h>
  10. #include <AzCore/Memory/Memory.h>
  11. #include <AzCore/RTTI/RTTI.h>
  12. #include <AzCore/RTTI/TypeInfo.h>
  13. #include <AzCore/std/containers/vector.h>
  14. #include <EMotionFX/Source/EMotionFXConfig.h>
  15. #include <EMotionFX/Source/Velocity.h>
  16. #include <Feature.h>
  17. namespace AZ
  18. {
  19. class ReflectContext;
  20. }
  21. namespace EMotionFX::MotionMatching
  22. {
  23. class FrameDatabase;
  24. class EMFX_API FeatureAngularVelocity : public Feature
  25. {
  26. public:
  27. AZ_RTTI(FeatureAngularVelocity, "{7C346537-E860-4DBE-9A32-492612FD0DFD}", Feature)
  28. AZ_CLASS_ALLOCATOR_DECL
  29. FeatureAngularVelocity() = default;
  30. ~FeatureAngularVelocity() override = default;
  31. void ExtractFeatureValues(const ExtractFeatureContext& context) override;
  32. void FillQueryVector(QueryVector& queryVector, const QueryVectorContext& context) override;
  33. float CalculateFrameCost(size_t frameIndex, const FrameCostContext& context) const override;
  34. static void DebugDraw(
  35. AzFramework::DebugDisplayRequests& debugDisplay,
  36. const Pose& pose,
  37. const AZ::Vector3& velocity, // in relative-to-joint space
  38. size_t jointIndex,
  39. size_t relativeToJointIndex,
  40. const AZ::Color& color);
  41. void DebugDraw(
  42. AzFramework::DebugDisplayRequests& debugDisplay,
  43. const Pose& currentPose,
  44. const FeatureMatrix& featureMatrix,
  45. const FeatureMatrixTransformer* featureTransformer,
  46. size_t frameIndex) override;
  47. static void Reflect(AZ::ReflectContext* context);
  48. size_t GetNumDimensions() const override;
  49. AZStd::string GetDimensionName(size_t index) const override;
  50. };
  51. } // namespace EMotionFX::MotionMatching