prime/include/Kyoto/Math/CVector2f.hpp

32 lines
658 B
C++
Raw Normal View History

2022-04-16 07:50:32 +00:00
#ifndef __CVECTOR2F_HPP__
#define __CVECTOR2F_HPP__
#include "types.h"
2022-04-16 07:50:32 +00:00
class CVector2f {
public:
2022-10-01 20:39:52 +00:00
CVector2f(f32 x, f32 y); // : mX(x), mY(y) {}
f32 GetX() const { return mX; }
f32 GetY() const { return mY; }
2022-10-01 20:39:52 +00:00
f32 Magnitude() const;
2022-09-18 06:05:46 +00:00
// private:
f32 mX;
f32 mY;
2022-04-16 07:50:32 +00:00
};
2022-10-01 20:39:52 +00:00
CVector2f operator-(const CVector2f& lhs, const CVector2f& rhs); /* {
f32 x = lhs.GetX() - rhs.GetX();
f32 y = lhs.GetY() - rhs.GetY();
return CVector2f(x, y);
}*/
CVector2f operator+(const CVector2f& lhs, const CVector2f& rhs); /* {
f32 x = lhs.GetX() + rhs.GetX();
f32 y = lhs.GetY() + rhs.GetY();
return CVector2f(x, y);
}*/
2022-04-16 07:50:32 +00:00
#endif // __CVECTOR3F_HPP__