imunano33
0.1.1
|
A minimal 2D vector representation. More...
#include <sv_embed.hpp>
Public Member Functions | |
EmbVec2D () | |
No-argument constructor. More... | |
EmbVec2D (const float xOther, const float yOther) | |
Initializes a vector given xy components. More... | |
EmbVec2D (const EmbVec2D &other)=default | |
Copy constructor. | |
EmbVec2D (EmbVec2D &&) noexcept=default | |
Move constructor. More... | |
EmbVec2D & | operator= (const EmbVec2D &other) |
Assignment operator. | |
EmbVec2D & | operator= (EmbVec2D &&) noexcept=default |
Move assignment operator. More... | |
virtual | ~EmbVec2D ()=default |
Destructor. More... | |
EmbVec2D & | operator+= (const EmbVec2D &other) |
In-place addtion. More... | |
EmbVec2D & | operator-= (const EmbVec2D &other) |
In-place subtraction. More... | |
EmbVec2D & | operator*= (const float &other) |
In-place scalar multiplication. More... | |
EmbVec2D & | operator/= (const float &other) |
In-place scalar division. More... | |
Public Attributes | |
float | x |
The x-component of the 2D vector. | |
float | y |
The y-component of the 2D vector. | |
A minimal 2D vector representation.
|
inline |
No-argument constructor.
Initializes a zero vector.
|
inline |
Initializes a vector given xy components.
xOther | The x-component. |
yOther | The y-component. |
|
defaultnoexcept |
Move constructor.
Uses C++ default move constructor.
|
virtualdefault |
Destructor.
Uses C++ default destructor.
|
inline |
In-place scalar multiplication.
Performs scalar multiplication on the current object.
other | The number to multiply by. |
In-place addtion.
Adds another vector object to current vector.
other | The other object to add. |
In-place subtraction.
Subtracts another vector object from current vector.
other | The other object to subtract. |
|
inline |
In-place scalar division.
Performs scalar division on the current object.
other | The number to divide by. |
Move assignment operator.
Uses C++ default move assignment operator.