rayfract
diff src/vmath.h @ 3:bf1d56975cc9
- added visual studio project
- removed vmath dependency
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 26 Oct 2010 09:52:57 +0300 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/vmath.h Tue Oct 26 09:52:57 2010 +0300 1.3 @@ -0,0 +1,34 @@ 1.4 +#ifndef VMATH_H_ 1.5 +#define VMATH_H_ 1.6 + 1.7 +class Vector2 { 1.8 +public: 1.9 + float x, y; 1.10 + 1.11 + Vector2(); 1.12 + Vector2(float x, float y); 1.13 +}; 1.14 + 1.15 +Vector2 operator +(const Vector2 &a, const Vector2 &b); 1.16 +Vector2 operator *(const Vector2 &v, float s); 1.17 + 1.18 +class Vector3 { 1.19 +public: 1.20 + float x, y, z; 1.21 + 1.22 + Vector3(); 1.23 + Vector3(float x, float y, float z); 1.24 +}; 1.25 + 1.26 +class Vector4 { 1.27 +public: 1.28 + float x, y, z, w; 1.29 + 1.30 + Vector4(); 1.31 + Vector4(float x, float y, float z, float w); 1.32 + 1.33 + float &operator [](int idx); 1.34 + const float &operator [](int idx) const; 1.35 +}; 1.36 + 1.37 +#endif /* VMATH_H_ */ 1.38 \ No newline at end of file