]> git.tdb.fi Git - libs/gl.git/blob - source/vector.h
Drop Id tags and copyright notices from files
[libs/gl.git] / source / vector.h
1 #ifndef MSP_GL_VECTOR_H_
2 #define MSP_GL_VECTOR_H_
3
4 namespace Msp {
5 namespace GL {
6
7 struct Vector4;
8
9 struct Vector3
10 {
11         float x, y, z;
12
13         Vector3(): x(0), y(0), z(0) { }
14         Vector3(float x_, float y_, float z_): x(x_), y(y_), z(z_) { }
15         Vector3(const Vector4 &);
16 };
17
18 struct Vector4
19 {
20         float x, y, z, w;
21
22         Vector4(): x(0), y(0), z(0), w(1) { }
23         Vector4(float x_, float y_, float z_): x(x_), y(y_), z(z_), w(1) { }
24         Vector4(float x_, float y_, float z_, float w_): x(x_), y(y_), z(z_), w(w_) { }
25         Vector4(const Vector3 &v): x(v.x), y(v.y), z(v.z), w(1) { }
26 };
27
28 inline Vector3::Vector3(const Vector4 &v):
29         x(v.x/v.w), y(v.y/v.w), z(v.z/v.w)
30 { }
31
32 } // namespace GL
33 } // namespace Msp
34
35 #endif