TypeSerialization.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // This code is in the public domain -- Ignacio Castaño <castano@gmail.com>
  2. #include "TypeSerialization.h"
  3. #include "nvcore/Stream.h"
  4. #include "nvmath/Vector.h"
  5. #include "nvmath/Matrix.h"
  6. #include "nvmath/Quaternion.h"
  7. #include "nvmath/Basis.h"
  8. #include "nvmath/Box.h"
  9. #include "nvmath/Plane.inl"
  10. using namespace nv;
  11. Stream & nv::operator<< (Stream & s, Vector2 & v)
  12. {
  13. return s << v.x << v.y;
  14. }
  15. Stream & nv::operator<< (Stream & s, Vector3 & v)
  16. {
  17. return s << v.x << v.y << v.z;
  18. }
  19. Stream & nv::operator<< (Stream & s, Vector4 & v)
  20. {
  21. return s << v.x << v.y << v.z << v.w;
  22. }
  23. Stream & nv::operator<< (Stream & s, Matrix & m)
  24. {
  25. return s;
  26. }
  27. Stream & nv::operator<< (Stream & s, Quaternion & q)
  28. {
  29. return s << q.x << q.y << q.z << q.w;
  30. }
  31. Stream & nv::operator<< (Stream & s, Basis & basis)
  32. {
  33. return s << basis.tangent << basis.bitangent << basis.normal;
  34. }
  35. Stream & nv::operator<< (Stream & s, Box & box)
  36. {
  37. return s << box.minCorner << box.maxCorner;
  38. }
  39. Stream & nv::operator<< (Stream & s, Plane & plane)
  40. {
  41. return s << plane.v;
  42. }