Skip to content

Circle

Generated from engine/math/circle.h at f525bc6. 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

Audience: game code.

#include "engine/math/circle.h" · namespace labrador

struct Circle : public Shape

Private, unlike RectangleF's and Triangle's data, because Shape's polymorphic accessor is center() and a field of that name cannot coexist with it. radius() is here to keep the pair symmetrical.

Circle() = default;
Circle(const Circle&) = default;
Circle& operator=(const Circle&) = default;
Circle(const Vector2F& center, float radius);
Circle(float x, float y, float radius);

bounding_box · shape_type · offset · inflate

Section titled “bounding_box · shape_type · offset · inflate”
RectangleF bounding_box() const override;
ShapeType shape_type() const override;
void offset(const Vector2F& amount) override;
void inflate(float amount) override;
bool operator==(const Circle& other) const;
bool operator!=(const Circle& other) const;
Vector2F center() const override;
float radius() const;
bool is_valid() const;

Whether the centre and radius are finite and the radius is not negative. A zero radius is a point and is valid. The constructors and inflate accept any radius; the circle predicates in intersects.h and ericson_math.h answer false for a circle that is not valid.

Named in the public declarations above: RectangleF, Shape, ShapeType, Vector2F.

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

Documentation for Labrador v0.4.0. Built from Labrador f525bc6 of 2026-11-17.

All documentation versions