QueryVector.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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/Vector2.h>
  10. #include <AzCore/Math/Vector3.h>
  11. #include <AzCore/Memory/Memory.h>
  12. #include <AzCore/RTTI/RTTI.h>
  13. #include <AzCore/std/containers/vector.h>
  14. #include <EMotionFX/Source/EMotionFXConfig.h>
  15. namespace EMotionFX
  16. {
  17. namespace MotionMatching
  18. {
  19. //! The input query vector for the motion matching search.
  20. //! It contains the feature values based on the feature schema for the current character pose.
  21. //! The number of values should be equal to the number of columns in the feature matrix.
  22. class EMFX_API QueryVector
  23. {
  24. public:
  25. AZ_RTTI(QueryVector, "{1C30F00B-7ACA-460D-96F4-A8C98436623B}")
  26. AZ_CLASS_ALLOCATOR_DECL
  27. virtual ~QueryVector() = default;
  28. size_t GetSize() const { return m_data.size(); }
  29. void Resize(size_t newSize) { m_data.resize(newSize); }
  30. void SetVector2(const AZ::Vector2& value, size_t offset);
  31. void SetVector3(const AZ::Vector3& value, size_t offset);
  32. AZ::Vector2 GetVector2(size_t offset) const;
  33. AZ::Vector3 GetVector3(size_t offset) const;
  34. AZStd::vector<float>& GetData() { return m_data; }
  35. const AZStd::vector<float>& GetData() const { return m_data; }
  36. private:
  37. AZStd::vector<float> m_data;
  38. };
  39. } // namespace MotionMatching
  40. } // namespace EMotionFX