HatchitMath
ht_vector2.h
1 
24 #pragma once
25 
26 #include <ht_platform.h>
27 #include <iostream>
28 #include <cmath>
29 
30 namespace Hatchit
31 {
32  namespace Math
33  {
34 
35  class Vector3;
36  class Vector4;
37 
38  class HT_API Vector2
39  {
40  public:
41  //Constructors
43  Vector2();
45  Vector2(float x, float y);
47  Vector2(const Vector2& other);
48 
49  //Destructor
50  virtual ~Vector2();
51 
52  //Accessors & Mutators
54  float getX();
56  float getY();
57 
61  float getMagnitude();
65  float* getAsArray();
66 
70  void setX(float x);
74  void setY(float y);
75 
76  //Static functions
77 
83  static float Dot(Vector2 v, Vector2 u);
88  static Vector2 Normalize(Vector2 v);
89 
90  //Operators
91 
96  float operator* (Vector2 u);
101  Vector2 operator* (float s);
106  Vector2 operator+ (Vector2 u);
112  float& operator[] (int i);
113 
114  private:
115  float vector[2];
116  };
117 
122  HT_API std::ostream& operator<< (std::ostream& output, Vector2& h);
127  HT_API std::istream& operator>> (std::istream& input, Vector2& h);
128  }
129 }
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_intrin.h:33
Hatchit Engine Copyright(c) 2015 Third-Degree.
Hatchit Engine Copyright(c) 2015 Third-Degree.
Hatchit Engine Copyright(c) 2015 Third-Degree.