Krig Game Engine
Vector.h
Go to the documentation of this file.
1 
7 #ifndef _VECTOR_H_
8 #define _VECTOR_H_
9 
10 #include <cmath>
11 #include <cstdio>
12 
13 #include "Matrix.h"
14 
15 struct Vector {
16  Vector();
17  Vector(const float &, const float &, const float &);
18  void setVector(const float &, const float &, const float &);
19 
20  void normalize();
21  float dotProduct(const Vector &);
22  void crossProduct(const Vector &, const Vector &);
23  float getDistance(const Vector &);
24  float getLength();
25  float getScaler(const Vector &);
26  float getSum();
27  void scale(const float&);
28  void average(const Vector &, const Vector &);
29  void calcNorm(const Vector &, const Vector &, const Vector &);
30 
31  Vector operator *(float);
32  Vector operator +(const Vector &);
33  void operator =(const Vector &);
34  void operator +=(const Vector &);
35  void operator -=(const Vector &);
36 
37  void rotateVector(const Matrix &, const Vector &);
38  void transformVector(const Matrix &, const Vector &);
39 
40  bool intersectBox(const Vector &, Vector[], float, Vector &);
41  bool intersectBox(const Vector &, Vector[], float);
42 
43  float x, y, z;
44 };
45 
46 #endif
Definition: Vector.h:15
Definition: matrix.h:15