aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/thekla_atlas/nvmath/TypeSerialization.cpp
blob: 72fa678f47d37119897660370c20d83ff9618594 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// This code is in the public domain -- Ignacio Castaño <castano@gmail.com>

#include "TypeSerialization.h"

#include "nvcore/Stream.h"

#include "nvmath/Vector.h"
#include "nvmath/Matrix.h"
#include "nvmath/Quaternion.h"
#include "nvmath/Basis.h"
#include "nvmath/Box.h"
#include "nvmath/Plane.inl"

using namespace nv;

Stream & nv::operator<< (Stream & s, Vector2 & v)
{
    return s << v.x << v.y;
}

Stream & nv::operator<< (Stream & s, Vector3 & v)
{
    return s << v.x << v.y << v.z;
}

Stream & nv::operator<< (Stream & s, Vector4 & v)
{
    return s << v.x << v.y << v.z << v.w;
}

Stream & nv::operator<< (Stream & s, Matrix & m)
{
    return s;
}

Stream & nv::operator<< (Stream & s, Quaternion & q)
{
    return s << q.x << q.y << q.z << q.w;
}

Stream & nv::operator<< (Stream & s, Basis & basis)
{
    return s << basis.tangent << basis.bitangent << basis.normal;
}

Stream & nv::operator<< (Stream & s, Box & box)
{
    return s << box.minCorner << box.maxCorner;
}

Stream & nv::operator<< (Stream & s, Plane & plane)
{
    return s << plane.v;
}