The Table Engine
vec2.h
Go to the documentation of this file.
1 #pragma once
2 
16 struct Vec2 {
17  float x;
18  float y;
19 
23  Vec2() : x(0), y(0) {}
24 
30  Vec2(float x, float y) : x(x), y(y) {}
31 
37  bool operator==(const Vec2& other) const
38  {
39  return x == other.x && y == other.y;
40  }
41 };
A structure to represent 2D vectors.
Definition: vec2.h:16
float y
Y coordinate of the vector.
Definition: vec2.h:18
Vec2(float x, float y)
Constructor that initializes vector with specified x and y values.
Definition: vec2.h:30
Vec2()
Default constructor initializing vector to (0, 0).
Definition: vec2.h:23
float x
X coordinate of the vector.
Definition: vec2.h:17
bool operator==(const Vec2 &other) const
Checks equality of this vector with another vector.
Definition: vec2.h:37