FeatureVelocity.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 FeatureVelocity
  25. : public Feature
  26. {
  27. public:
  28. AZ_RTTI(FeatureVelocity, "{DEEA4F0F-CE70-4F16-9136-C2BFDDA29336}", Feature)
  29. AZ_CLASS_ALLOCATOR_DECL
  30. FeatureVelocity() = default;
  31. ~FeatureVelocity() override = default;
  32. void ExtractFeatureValues(const ExtractFeatureContext& context) override;
  33. void FillQueryVector(QueryVector& queryVector, const QueryVectorContext& context) override;
  34. float CalculateFrameCost(size_t frameIndex, const FrameCostContext& context) const override;
  35. static void DebugDraw(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(AzFramework::DebugDisplayRequests& debugDisplay,
  42. const Pose& currentPose,
  43. const FeatureMatrix& featureMatrix,
  44. const FeatureMatrixTransformer* featureTransformer,
  45. size_t frameIndex) override;
  46. static void Reflect(AZ::ReflectContext* context);
  47. size_t GetNumDimensions() const override;
  48. AZStd::string GetDimensionName(size_t index) const override;
  49. };
  50. } // namespace EMotionFX::MotionMatching