Origin.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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/Serialization/SerializeContext.h>
  9. #include <Atom/RHI.Reflect/Origin.h>
  10. namespace AZ::RHI
  11. {
  12. Origin::Origin(uint32_t left, uint32_t top, uint32_t front)
  13. : m_left{left}
  14. , m_top{top}
  15. , m_front{front}
  16. {}
  17. void Origin::Reflect(AZ::ReflectContext* context)
  18. {
  19. if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
  20. {
  21. serializeContext->Class<Origin>()
  22. ->Version(0)
  23. ->Field("Left", &Origin::m_left)
  24. ->Field("Top", &Origin::m_top)
  25. ->Field("Front", &Origin::m_front)
  26. ;
  27. }
  28. }
  29. bool Origin::operator == (const Origin& rhs) const
  30. {
  31. return m_left == rhs.m_left && m_top == rhs.m_top && m_front == rhs.m_front;
  32. }
  33. bool Origin::operator != (const Origin& rhs) const
  34. {
  35. return m_left != rhs.m_left || m_top != rhs.m_top || m_front != rhs.m_front;
  36. }
  37. }