MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ vertex_geometry_form()

MAYAFLUX_API std::optional< Geometry::Form< std::monostate > > MayaFlux::Portal::Forma::vertex_geometry_form ( const VertexGeometryInputs & input,
const RectPlacementInputs & placement,
std::string & error )
nodiscard

A Form with no state that draws ordered vertices.

Positions are x y in the unit square, mapped through the placement's rect onto the surface, with z kept. The hit region is derived from the placed vertices: inside the triangles for triangle topologies, the circumscribing box otherwise.

Definition at line 78 of file StaticGeometry.cpp.

80{
81 const auto region = region_of(placement, error);
82 if (!region)
83 return std::nullopt;
84
85 VertexGeometryInputs mapped { .topology = input.topology, .vertices = input.vertices };
86 for (Kakshya::Vertex& vertex : mapped.vertices) {
87 const glm::vec2 ndc = region->point_at({ vertex.position.x, vertex.position.y });
88 vertex.position = { ndc.x, ndc.y, vertex.position.z };
89 }
90 return vertex_form(mapped);
91}
std::optional< Kinesis::AABB2D > region_of(const RectPlacementInputs &placement, std::string &error)
The surface region a rect placement covers.
Geometry::Form< std::monostate > vertex_form(const VertexGeometryInputs &input)
A Form with no state that draws ordered vertices exactly as written.
Type-neutral vertex carrying the universal 68-byte attribute layout.
A topology and ordered vertices in the Kakshya::Vertex field format.

References MayaFlux::Kakshya::Vertex::position, region_of(), MayaFlux::Portal::Forma::VertexGeometryInputs::topology, vertex_form(), and MayaFlux::Portal::Forma::VertexGeometryInputs::vertices.

Referenced by expose_vertex_geometry().

Here is the call graph for this function:
Here is the caller graph for this function: