Represents a 2D vector with basic arithmetic operations. More...
#include <transform.hpp>
Public Member Functions | |
Vec2 | operator+ (const Vec2 &other) const |
Adds two Vec2 vectors. | |
Vec2 | operator* (float scalar) const |
Multiplies the vector by a scalar value. | |
Public Attributes | |
float | x |
float | y |
The x and y components of the vector. | |
Represents a 2D vector with basic arithmetic operations.
The Vec2
structure holds two floating-point values, x
and y
, and supports basic operations such as vector addition and scalar multiplication.
Definition at line 28 of file transform.hpp.
|
inline |
Multiplies the vector by a scalar value.
This operator multiplies each component (x
and y
) of the vector by a scalar value.
scalar | The scalar value to multiply the vector by. |
Vec2
vector after multiplication. Definition at line 50 of file transform.hpp.
Adds two Vec2
vectors.
This operator adds the x
and y
components of two Vec2
vectors and returns a new vector.
other | The other vector to add. |
Vec2
vector representing the sum of the two vectors. Definition at line 40 of file transform.hpp.
float Raftel::Vec2::x |
Definition at line 30 of file transform.hpp.
float Raftel::Vec2::y |
The x and y components of the vector.
Definition at line 30 of file transform.hpp.