GeoreferenceInternalStructures.cpp 1.1 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
  4. * of this distribution.
  5. *
  6. * SPDX-License-Identifier: Apache-2.0 OR MIT
  7. *
  8. */
  9. #include "GeoreferenceInternalStructures.h"
  10. namespace Georeferencing::WGS
  11. {
  12. Vector3d::Vector3d(double x, double y, double z)
  13. : m_x(x)
  14. , m_y(y)
  15. , m_z(z)
  16. {
  17. }
  18. Vector3d::Vector3d(const AZ::Vector3& xyz)
  19. : m_x(xyz.GetX())
  20. , m_y(xyz.GetY())
  21. , m_z(xyz.GetZ())
  22. {
  23. }
  24. [[nodiscard]] AZ::Vector3 Vector3d::ToVector3f() const
  25. {
  26. return AZ::Vector3(static_cast<float>(m_x), static_cast<float>(m_y), static_cast<float>(m_z));
  27. }
  28. Vector3d Vector3d::operator+(Vector3d const& v) const
  29. {
  30. Vector3d r;
  31. r.m_x = m_x + v.m_x;
  32. r.m_y = m_y + v.m_y;
  33. r.m_z = m_z + v.m_z;
  34. return r;
  35. }
  36. Vector3d Vector3d::operator-(Vector3d const& v) const
  37. {
  38. Vector3d r;
  39. r.m_x = m_x - v.m_x;
  40. r.m_y = m_y - v.m_y;
  41. r.m_z = m_z - v.m_z;
  42. return r;
  43. }
  44. } // namespace Georeferencing::WGS