Represents a 2-dimensional vector with float components.
More...
#include <Vec2.h>
|
float | x |
|
float | y |
| The x and y components of the vector.
|
|
Represents a 2-dimensional vector with float components.
◆ Vec2() [1/2]
Default constructor. Initializes all components to zero.
◆ Vec2() [2/2]
Vec2::Vec2 |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
inline |
Constructs a vector with the given x and y components.
- Parameters
-
x | The x component. |
y | The y component. |
◆ operator*()
Vec2 Vec2::operator* |
( |
float |
scalar | ) |
const |
|
inline |
Multiplies this vector by a scalar.
- Parameters
-
- Returns
- The result of scalar multiplication.
◆ operator+()
Vec2 Vec2::operator+ |
( |
const Vec2 & |
other | ) |
const |
|
inline |
Adds this vector to another vector.
- Parameters
-
- Returns
- The result of vector addition.
◆ operator-()
Vec2 Vec2::operator- |
( |
const Vec2 & |
other | ) |
const |
|
inline |
Subtracts another vector from this vector.
- Parameters
-
other | The vector to subtract. |
- Returns
- The result of vector subtraction.
The x and y components of the vector.
The documentation for this struct was generated from the following file: