]> git.tdb.fi Git - libs/gl.git/blob - source/vector.h
Add Vector3 and Vector4 classes
[libs/gl.git] / source / vector.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_VECTOR_H_
9 #define MSP_GL_VECTOR_H_
10
11 namespace Msp {
12 namespace GL {
13
14 struct Vector3
15 {
16         float x, y, z;
17
18         Vector3(): x(0), y(0), z(0) { }
19         Vector3(float x_, float y_, float z_): x(x_), y(y_), z(z_) { }
20 };
21
22 struct Vector4
23 {
24         float x, y, z, w;
25
26         Vector4(): x(0), y(0), z(0), w(1) { }
27         Vector4(float x_, float y_, float z_): x(x_), y(y_), z(z_), w(1) { }
28         Vector4(float x_, float y_, float z_, float w_): x(x_), y(y_), z(z_), w(w_) { }
29         Vector4(const Vector3 &v): x(v.x), y(v.y), z(v.z), w(1) { }
30 };
31
32 } // namespace GL
33 } // namespace Msp
34
35 #endif