QueryVector.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #include <Allocators.h>
  9. #include <QueryVector.h>
  10. namespace EMotionFX::MotionMatching
  11. {
  12. AZ_CLASS_ALLOCATOR_IMPL(QueryVector, MotionMatchAllocator)
  13. void QueryVector::SetVector2(const AZ::Vector2& value, size_t offset)
  14. {
  15. m_data[offset + 0] = value.GetX();
  16. m_data[offset + 1] = value.GetY();
  17. }
  18. void QueryVector::SetVector3(const AZ::Vector3& value, size_t offset)
  19. {
  20. m_data[offset + 0] = value.GetX();
  21. m_data[offset + 1] = value.GetY();
  22. m_data[offset + 2] = value.GetZ();
  23. }
  24. AZ::Vector2 QueryVector::GetVector2(size_t offset) const
  25. {
  26. return AZ::Vector2(m_data[offset + 0], m_data[offset + 1]);
  27. }
  28. AZ::Vector3 QueryVector::GetVector3(size_t offset) const
  29. {
  30. return AZ::Vector3(m_data[offset + 0], m_data[offset + 1], m_data[offset + 2]);
  31. }
  32. } // namespace EMotionFX::MotionMatching