Skip to content

Engine → Core

rect.h

A float rectangle given by its min and max corners (y may point either way; the struct only assumes min <= max). The default rectangle is empty at the origin. Containment and intersection are inclusive: touching counts.

Structs

File Description
rect A float rectangle given by its min and max corners (y may point either way; the struct only assumes min <= max). The default rectangle is empty at the origin. Containment and intersection are inclusive: touching counts.
std::formatter<conjure::math::rect>
std::formatter<conjure::math::urect>
urect An unsigned pixel rectangle (viewports, scissors, texture regions): top-left origin plus size. Pixel (x, y) is covered when x < right() and y < bottom(), so the right and bottom edges are exclusive. Invariant: x + width and y + height must not exceed 0xFFFFFFFF (the edges must be representable); right() and bottom() assert when they would wrap.

Functions

Public

nearly_equal

[[nodiscard]] inline bool nearly_equal(
    const rect &a,
    const rect &b,
    f32 epsilon = EPSILON) noexcept;

True when both corners are within epsilon.