g2chromatic2. written with 0 ai just to see if I could. uses grid22.hpp.
This commit is contained in:
@@ -10,6 +10,12 @@ class Vec2 {
|
||||
float x, y;
|
||||
Vec2() : x(0), y(0) {}
|
||||
Vec2(float x, float y) : x(x), y(y) {}
|
||||
|
||||
Vec2& move(const Vec2 newpos) {
|
||||
x = newpos.x;
|
||||
y = newpos.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec2 operator+(const Vec2& other) const {
|
||||
return Vec2(x + other.x, y + other.y);
|
||||
@@ -266,7 +272,6 @@ class Vec2 {
|
||||
std::string toString() const {
|
||||
return "(" + std::to_string(x) + ", " + std::to_string(y) + ")";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const Vec2& vec) {
|
||||
|
||||
@@ -25,6 +25,13 @@ public:
|
||||
static Vec4 RGB(float r, float g, float b, float a = 1.0f) { return Vec4(r, g, b, a); }
|
||||
static Vec4 RGBA(float r, float g, float b, float a) { return Vec4(r, g, b, a); }
|
||||
|
||||
Vec4& recolor(const Vec4 newColor) {
|
||||
r = newColor.r;
|
||||
g = newColor.g;
|
||||
b = newColor.b;
|
||||
a = newColor.a;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec4 operator+(const Vec4& other) const {
|
||||
return Vec4(x + other.x, y + other.y, z + other.z, w + other.w);
|
||||
|
||||
Reference in New Issue
Block a user