Meteor2D
dev internal
Meteor is a lightweight 2D game engine.
|
A structure representing a 2D Vector. More...
#include <vector2d.h>
Public Member Functions | |
void | operator+= (SVector2 const &other) |
void | operator-= (SVector2 const &other) |
SVector2 | operator+ (SVector2 const &other) |
SVector2 | operator- (SVector2 const &other) |
SVector2 | operator* (int const &scalar) |
SVector2 | operator/ (int const &scalar) |
SVector2 | operator* (float const &scalar) |
SVector2 | operator/ (float const &scalar) |
std::string | toString () |
Static Public Member Functions | |
static SVector2 | make (float x, float y) |
returns a vector2 using x and y. (similar to Vector(x,y) constructor) | |
static SVector2 | one () |
static SVector2 | zero () |
static SVector2 | scale (SVector2 v1, SVector2 v2) |
Multiplies each component of v1 with their respective parts in v2. | |
static float | dist (SVector2 v1, SVector2 v2) |
Computes the euclidian distance. | |
static bool | parse (std::string str, SVector2 &out) |
Parses a string to a vector, serialized vector to be in the form '(x,y)'. | |
Public Attributes | |
float | x = 0 |
float | y = 0 |
A structure representing a 2D Vector.
Computes the euclidian distance.
v1 | vector 1 |
v2 | vector 2 |
|
inlinestatic |
returns a vector2 using x and y. (similar to Vector(x,y) constructor)
x | value in x-axis |
y | value in y-axis |
|
inlinestatic |
|
inlinestatic |
Parses a string to a vector, serialized vector to be in the form '(x,y)'.
str | serialised string containg vector2 data |
out | Vector2 struct reference to update values. |
Multiplies each component of v1 with their respective parts in v2.
v1 | vector 1 |
v2 | vector 2 |
|
inlinestatic |