Skip to content

RectangleI

Generated from engine/math/rectanglei.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/rectanglei.h" · namespace mattmath

struct RectangleI
int x = 0;
int y = 0;
int width = 0;
int height = 0;
RectangleI() = default;
RectangleI(const RectangleI&) = default;
constexpr RectangleI(int x, int y, int width, int height);
RectangleI(const mattmath::Vector2I& position,
const mattmath::Vector2I& size);
RectangleI(const mattmath::Vector2F& position,
const mattmath::Vector2F& size);
explicit RectangleI(const mattmath::RectangleF& rectangle);

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

int left() const;
int top() const;
int right() const;
int bottom() const;
mattmath::Vector2I position() const;
mattmath::Vector2I size() const;
mattmath::Vector2I top_left() const;
mattmath::Vector2I bottom_right() const;
bool operator==(const RectangleI& other) const;
bool operator!=(const RectangleI& other) const;
bool contains(const mattmath::Vector2I& point) const;
bool contains(const RectangleI& other) const;
void offset(int horizontal_amount, int vertical_amount);
void offset(const mattmath::Vector2I& amount);

set_left · set_top · set_right · set_bottom

Section titled “set_left · set_top · set_right · set_bottom”
void set_left(int left);
void set_top(int top);
void set_right(int right);
void set_bottom(int bottom);
void set_position(const mattmath::Vector2I& position);
void set_size(const mattmath::Vector2I& size);

set_top_left · set_bottom_right · set_top_left_and_bottom_right

Section titled “set_top_left · set_bottom_right · set_top_left_and_bottom_right”
void set_top_left(const mattmath::Vector2I& top_left);
void set_bottom_right(const mattmath::Vector2I& bottom_right);
void set_top_left_and_bottom_right(const mattmath::Vector2I& top_left,
const mattmath::Vector2I& bottom_right);
static const RectangleI ZERO;

Named in the public declarations above: RectangleF, Vector2F, Vector2I.

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.