Skip to content

ludus::foundation::geometry::ConvexPolygon

Ludus Wiki · API overview · Browse API

Struct

One convex planar polygon made of whole source triangles.
Positions are bitwise copies of source vertex positions, ordered by the source winding: counterclockwise when viewed against NormalMesh. Consecutive edges turn by more than the collinearity tolerance, so no three vertices are collinear. An affine transform keeps the polygon convex and planar; transform the positions, then derive a world normal from them.

Declared in modules/foundation/geometry/include/ludus/foundation/geometry/convex_polygon.hpp

#include <ludus/foundation/geometry/convex_polygon.hpp>
struct ludus::foundation::geometry::ConvexPolygon final

Fields

PositionsMesh

StaticArray<math::Vector3, MAX_CONVEX_POLYGON_VERTICES> ludus::foundation::geometry::ConvexPolygon::PositionsMesh {}
Valid prefix of VertexCount.

Related types: StaticArray · MAX_CONVEX_POLYGON_VERTICES · math::Vector3

Declared in modules/foundation/geometry/include/ludus/foundation/geometry/convex_polygon.hpp

VertexCount

usize ludus::foundation::geometry::ConvexPolygon::VertexCount = 0
3 through MAX_CONVEX_POLYGON_VERTICES.

Related types: usize

Declared in modules/foundation/geometry/include/ludus/foundation/geometry/convex_polygon.hpp

NormalMesh

math::Vector3 ludus::foundation::geometry::ConvexPolygon::NormalMesh {}
Unit normal from the winding, in the positions' space.

Related types: math::Vector3

Declared in modules/foundation/geometry/include/ludus/foundation/geometry/convex_polygon.hpp

FirstTriangle

usize ludus::foundation::geometry::ConvexPolygon::FirstTriangle = 0
First entry of this polygon in ConvexPolygonPartition::Triangles.

Related types: usize

Declared in modules/foundation/geometry/include/ludus/foundation/geometry/convex_polygon.hpp

TriangleCount

usize ludus::foundation::geometry::ConvexPolygon::TriangleCount = 0
Number of source triangles covered by this polygon.

Related types: usize

Declared in modules/foundation/geometry/include/ludus/foundation/geometry/convex_polygon.hpp