Skip to content

Quad

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

struct Quad : public Shape

A quadrilateral with four points, ordered clockwise starting from the top left.

Quad() = default;
Quad(const Quad&) = default;
Quad(const Vector2F& point1, const Vector2F& point2,
const Vector2F& point3, const Vector2F& point4);
explicit Quad(const RectangleF& rectangle);
explicit Quad(const RectangleRotated& rectangle);

bounding_box · shape_type · offset · inflate

Section titled “bounding_box · shape_type · offset · inflate”
mattmath::RectangleF bounding_box() const override;
ShapeType shape_type() const override;
void offset(const mattmath::Vector2F& amount) override;
void inflate(float amount) override;
bool is_valid() const;

point_0 · point_1 · point_2 · point_3 · set_point_0 · set_point_1 · set_point_2 · set_point_3

Section titled “point_0 · point_1 · point_2 · point_3 · set_point_0 · set_point_1 · set_point_2 · set_point_3”
const Point2F& point_0() const;
const Point2F& point_1() const;
const Point2F& point_2() const;
const Point2F& point_3() const;
void set_point_0(const Point2F& point);
void set_point_1(const Point2F& point);
void set_point_2(const Point2F& point);
void set_point_3(const Point2F& point);

edge_0 · edge_1 · edge_2 · edge_3 · edges

Section titled “edge_0 · edge_1 · edge_2 · edge_3 · edges”
Segment edge_0() const;
Segment edge_1() const;
Segment edge_2() const;
Segment edge_3() const;
std::array<Segment, 4> edges() const;
Triangle triangle_0() const;
Triangle triangle_1() const;
std::array<Triangle, 2> triangles() const;
bool operator==(const Quad& other) const;
bool operator!=(const Quad& other) const;
mattmath::Vector2F center() const override;

Named in the public declarations above: RectangleF, RectangleRotated, Segment, Shape, ShapeType, Triangle, 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.