Skip to content

Vector2I

Generated from engine/math/vector2i.h at 862e08b. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.

Browse the math module

#include "engine/math/vector2i.h" · namespace mattmath

struct Vector2I
int x = 0;
int y = 0;
Vector2I() = default;
Vector2I(const Vector2I&) = default;
constexpr Vector2I(int x, int y);
explicit Vector2I(const mattmath::Vector2F& vector);

constexpr and defined here so ZERO is constant-initialised. See Vector2F's constants for what the dynamic alternative risks.

bool operator==(const Vector2I& other) const;
bool operator!=(const Vector2I& other) const;

operator+= · operator-= · operator*= · operator/=

Section titled “operator+= · operator-= · operator*= · operator/=”
Vector2I& operator+=(const Vector2I& other);
Vector2I& operator-=(const Vector2I& other);
Vector2I& operator*=(const Vector2I& other);
Vector2I& operator/=(const Vector2I& other);
Vector2I& operator*=(int other);
Vector2I& operator/=(int other);
void offset(int horizontal_amount, int vertical_amount);
void scale(int horizontal_amount, int vertical_amount);
void set(int x, int y);
static const Vector2I ZERO;

operator+ · operator- · operator* · operator/

Section titled “operator+ · operator- · operator* · operator/”
Vector2I operator+ (const Vector2I& V1, const Vector2I& V2);
Vector2I operator- (const Vector2I& V1, const Vector2I& V2);
Vector2I operator* (const Vector2I& V1, const Vector2I& V2);
Vector2I operator* (const Vector2I& V, int S);
Vector2I operator/ (const Vector2I& V1, const Vector2I& V2);
Vector2I operator/ (const Vector2I& V, int S);
Vector2I operator* (int S, const Vector2I& V);

Named in the public declarations above: Vector2F.

The files that include this header directly. A file can also reach it through another header.

Development documentation (unreleased). Built from Labrador 862e08b of 2026-10-08.