annotate src/vector.h @ 51:9c0867942612
changed the binary target to clray
author |
John Tsiombikas <nuclear@member.fsf.org> |
date |
Thu, 02 Sep 2010 01:41:51 +0100 |
parents |
|
children |
6a30f27fa1e6 |
rev |
line source |
nuclear@23
|
1 #ifndef VECTOR_H_
|
nuclear@23
|
2 #define VECTOR_H_
|
nuclear@23
|
3
|
nuclear@23
|
4 class Vector2 {
|
nuclear@23
|
5 public:
|
nuclear@23
|
6 float x, y;
|
nuclear@23
|
7
|
nuclear@23
|
8 Vector2();
|
nuclear@23
|
9 Vector2(float x, float y);
|
nuclear@23
|
10 };
|
nuclear@23
|
11
|
nuclear@23
|
12 class Vector3 {
|
nuclear@23
|
13 public:
|
nuclear@23
|
14 float x, y, z;
|
nuclear@23
|
15
|
nuclear@23
|
16 Vector3();
|
nuclear@23
|
17 Vector3(float x, float y, float z);
|
nuclear@23
|
18
|
nuclear@23
|
19 void normalize();
|
nuclear@23
|
20 inline float length();
|
nuclear@23
|
21 inline float lengthsq();
|
nuclear@23
|
22 };
|
nuclear@23
|
23
|
nuclear@23
|
24 inline Vector3 operator +(const Vector3 &a, const Vector3 &b);
|
nuclear@23
|
25 inline Vector3 operator -(const Vector3 &a, const Vector3 &b);
|
nuclear@23
|
26 inline Vector3 operator *(const Vector3 &a, const Vector3 &b);
|
nuclear@23
|
27 inline Vector3 operator /(const Vector3 &a, const Vector3 &b);
|
nuclear@23
|
28
|
nuclear@23
|
29 inline Vector3 operator -(const Vector3 &vec);
|
nuclear@23
|
30 inline Vector3 operator *(const Vector3 &vec, float s);
|
nuclear@23
|
31
|
nuclear@23
|
32 inline float dot(const Vector3 &a, const Vector3 &b);
|
nuclear@23
|
33 inline Vector3 cross(const Vector3 &a, const Vector3 &b);
|
nuclear@23
|
34
|
nuclear@23
|
35 #include "vector.inl"
|
nuclear@23
|
36
|
nuclear@23
|
37 #endif /* VECTOR_H_ */
|