|
constexpr | Vec2 () |
| ctor, that will initialize vector to null vector More...
|
|
constexpr | Vec2 (T x, T y) |
| ctor that will initialize it to the current value More...
|
|
constexpr | Vec2 (SDL_Point const &p) |
| Convert SDL_Point to sdl::Vec2. More...
|
|
constexpr | Vec2 (Vec2 const &) noexcept=default |
|
constexpr | Vec2 (Vec2 &&) noexcept=default |
|
Vec2 & | operator= (Vec2 const &) noexcept=default |
|
Vec2 & | operator= (Vec2 &&) noexcept=default |
|
constexpr Vec2 | operator- () const |
| Return the opposite vector. More...
|
|
Vec2 & | operator+= (Vec2 const &other) |
| Add vector to this one. More...
|
|
Vec2 & | operator-= (Vec2 const &other) |
| Substract vector to this one. More...
|
|
Vec2 & | operator*= (T value) |
| Multiply vector to this one (x1*x2, y1*y2) More...
|
|
Vec2 & | operator/= (T value) |
| Divide vector to this one (x1/x2, y1/y2) More...
|
|
constexpr Vec2 | operator+ (Vec2 const &other) const |
| Add vectors together. More...
|
|
constexpr Vec2 | operator- (Vec2 const &other) const |
| Substract vectors together. More...
|
|
constexpr Vec2 | operator* (T value) const |
| Multiply vectors together. More...
|
|
constexpr Vec2 | operator/ (T value) const |
| Divide vectors together. More...
|
|
constexpr bool | operator== (Vec2 const &other) const |
| Compare vectors, true if they are the same. More...
|
|
constexpr bool | operator!= (Vec2 const &other) const |
| Compare vectors, false if they are the same. More...
|
|
Vec2 | clamped (SDL_Rect const &box) const |
| Clamp vector inside a box rectangle were to clamp vector. More...
|
|
void | clamp (SDL_Rect const &box) |
| Clamp vector inside a box rectangle were to clamp vector. More...
|
|
T | length () const |
| Get lenghts of this vector. More...
|
|
T | sqlength () const |
| Get squared lenght of this vector. More...
|
|
bool | is_null () const |
| Return true if this vector is null. More...
|
|
Vec2 | normalized () const |
| Return normalized copy of this vector. More...
|
|
void | normalize () |
| Normalize this vector. More...
|
|
template<typename U > |
| operator Vec2< U > () const |
| Convert this vectort to a vector of <U> type. More...
|
|