Triangle
Generated from engine/math/triangle.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.
Audience: game code.
#include "engine/math/triangle.h" · namespace labrador
struct Triangle
Section titled “struct Triangle”points
Section titled “points”Triangle · operator=
Section titled “Triangle · operator=”Triangle(const Triangle&) = default;Triangle& operator=(const Triangle&) = default; const Vector2F& point1, const Vector2F& point2);Triangle(float x0, float y0, float x1, float y1, float x2, float y2);bounding_box · shape_type · offset · inflate
Section titled “bounding_box · shape_type · offset · inflate”void inflate(float amount) override;point_0 · point_1 · point_2
Section titled “point_0 · point_1 · point_2”const Vector2F& point_1() const;const Vector2F& point_2() const;edge_0 · edge_1 · edge_2 · edges
Section titled “edge_0 · edge_1 · edge_2 · edges”Segment edge_1() const;Segment edge_2() const;std::array<Segment, 3> edges() const;angle_0 · angle_1 · angle_2
Section titled “angle_0 · angle_1 · angle_2”float angle_0() const;float angle_1() const;float angle_2() const;operator== · operator!=
Section titled “operator== · operator!=”bool operator!=(const Triangle& other) const;center
Section titled “center”calculate_gradient (protected)
Section titled “calculate_gradient (protected)”float calculate_gradient(int edge) const;dy/dx of edge edge, from vertex edge to vertex edge + 1. Throws std::invalid_argument for an edge outside 0..2.
struct TriangleRightAxisAligned
Section titled “struct TriangleRightAxisAligned”TriangleRightAxisAligned · operator=
Section titled “TriangleRightAxisAligned · operator=”TriangleRightAxisAligned(const TriangleRightAxisAligned&) = default;TriangleRightAxisAligned& operator=(const TriangleRightAxisAligned&) = default; const Vector2F& left, const Vector2F& right);TriangleRightAxisAligned(float x0, float y0, float x1, float y1, float x2, float y2);hypotenuse
Section titled “hypotenuse”hypotenuse_gradient
Section titled “hypotenuse_gradient”float hypotenuse_gradient() const;dy/dx of hypotenuse(). Both throw std::invalid_argument when no angle is a right angle.
Related types
Section titled “Related types”Named in the public declarations above: RectangleF, Segment, Shape, ShapeType, Vector2F.
In the samples and tests
Section titled “In the samples and tests”The files that include this header directly. A file can also reach it through another header.
samples/components/shape_outline.cpp,shape_outline_null_tests.cpp,shape_outline_tests.cpptests/collision/finite_shape_tests.cpp,narrow_phase_tests.cpptests/math/ericson_math_tests.cpp,inflate_tests.cpp,rectanglef_tests.cpp,shape_intersect_tests.cpp,shape_tests.cpp,triangle_tests.cpp
Explained in
Section titled “Explained in”Documentation for Labrador v0.4.0. Built from Labrador f525bc6 of 2026-11-17.