The Table Engine
Vec2 Struct Reference

A structure to represent 2D vectors. More...

#include <vec2.h>

+ Collaboration diagram for Vec2:

Public Member Functions

 Vec2 ()
 Default constructor initializing vector to (0, 0). More...
 
 Vec2 (float x, float y)
 Constructor that initializes vector with specified x and y values. More...
 
bool operator== (const Vec2 &other) const
 Checks equality of this vector with another vector. More...
 

Public Attributes

float x
 X coordinate of the vector. More...
 
float y
 Y coordinate of the vector. More...
 

Detailed Description

A structure to represent 2D vectors.

This structure is used throughout the Game Engine to handle 2-dimensional vector operations.

Definition at line 16 of file vec2.h.

Constructor & Destructor Documentation

◆ Vec2() [1/2]

Vec2::Vec2 ( )

Default constructor initializing vector to (0, 0).

Definition at line 23 of file vec2.h.

◆ Vec2() [2/2]

Vec2::Vec2 ( float  x,
float  y 
)

Constructor that initializes vector with specified x and y values.

Parameters
xThe x coordinate.
yThe y coordinate.

Definition at line 30 of file vec2.h.

Member Function Documentation

◆ operator==()

bool Vec2::operator== ( const Vec2 other) const

Checks equality of this vector with another vector.

Parameters
otherThe vector to compare with.
Returns
true if the vectors are equal, false otherwise.

Definition at line 37 of file vec2.h.

Member Data Documentation

◆ x

float Vec2::x

X coordinate of the vector.

Definition at line 17 of file vec2.h.

◆ y

float Vec2::y

Y coordinate of the vector.

Definition at line 18 of file vec2.h.


The documentation for this struct was generated from the following file: