Class Vector2

Class Documentation

class Vector2

Represents a 2 dimensional vector.

Public Functions

inline Vector2()

Constructs a Vector2 with all fields set to 0.

inline Vector2(float X, float Y)

Constructs a Vector2 with the given x, y values.

Parameters
  • X – float

  • Y – float

Vector2 operator+(const Vector2 &Other) const

Member by member addition with another Vector2.

Parameters

Vector2 – Other

Vector2 operator-(const Vector2 &Other) const

Subtracts another Vector2 from this one.

Parameters

Vector2 – Other

Vector2 operator/(float Divisor) const

Divides the Vector2 by divisor.

Parameters

float – Divisor

Vector2 operator*(const Vector2 &Other) const

Member by member multiplication with another Vector2.

Parameters

Vector2 – Other

Vector2 operator*(float Scalar) const

Multiplies the Vector2 by a scalar.

Parameters

float – Scalar

bool operator==(Vector2 Other) const
bool operator!=(Vector2 Other) const

Public Members

float X
float Y

Public Static Functions

static const Vector2 &Zero()

Returns a Vector2 with all fields set to 0.

Returns

const Vector2&

static const Vector2 &One()

Returns a Vector2 with all fields set to 1.

Returns

const Vector2&