Rev | Line | |
---|
[5636] | 1 | #ifndef VECTOR_HH |
---|
| 2 | #define VECTOR_HH |
---|
| 3 | |
---|
| 4 | class Vector{ |
---|
| 5 | public: |
---|
| 6 | Vector(void): x(0.0), y(0.0), z(0.0) {} |
---|
| 7 | Vector(float x, float y, float z): x(x), y(y), z(z) {} |
---|
| 8 | Vector &operator += (const Vector &other); |
---|
| 9 | Vector operator + (const Vector &other) const; |
---|
| 10 | Vector &operator -= (const Vector &other); |
---|
| 11 | Vector operator - (const Vector &other) const; |
---|
| 12 | Vector cross(const Vector &other) const; |
---|
| 13 | float dot(const Vector &other) const; |
---|
| 14 | float magnitude(void) const; |
---|
| 15 | Vector scale(float amount) const; |
---|
| 16 | float x; |
---|
| 17 | float y; |
---|
| 18 | float z; |
---|
| 19 | }; |
---|
| 20 | |
---|
| 21 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.