Printers.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 <AzCore/Math/Quaternion.h>
  9. #include <AzCore/Math/Vector3.h>
  10. #include <Tests/Printers.h>
  11. #include <string>
  12. #include <ostream>
  13. namespace AZ
  14. {
  15. void PrintTo(const AZ::Vector3& vector, ::std::ostream* os)
  16. {
  17. *os << '(' << vector.GetX() << ", " << vector.GetY() << ", " << vector.GetZ() << ')';
  18. }
  19. void PrintTo(const AZ::Quaternion& quaternion, ::std::ostream* os)
  20. {
  21. *os << '(' << quaternion.GetX() << ", " << quaternion.GetY() << ", " << quaternion.GetZ() << ", " << quaternion.GetW() << ')';
  22. }
  23. } // namespace AZ
  24. namespace AZStd
  25. {
  26. void PrintTo(const string& string, ::std::ostream* os)
  27. {
  28. *os << '"' << std::string(string.data(), string.size()) << '"';
  29. }
  30. } // namespace AZStd
  31. namespace EMotionFX
  32. {
  33. void PrintTo(const Transform& transform, ::std::ostream* os)
  34. {
  35. *os << "(pos: ";
  36. PrintTo(transform.m_position, os);
  37. *os << ", rot: ";
  38. PrintTo(transform.m_rotation, os);
  39. #if !defined(EMFX_SCALE_DISABLED)
  40. *os << ", scale: ";
  41. PrintTo(transform.m_scale, os);
  42. #endif
  43. *os << ")";
  44. }
  45. } // namespace EMotionFX