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

◆ point()

MAYAFLUX_API GeometryFn< glm::vec2 > MayaFlux::Portal::Forma::Geometry::point ( glm::vec3  color = glm::vec3(1.0F),
float  size = 10.0F,
float  hit_radius = 0.04F 
)

Geometry function for a positioned point in NDC space.

Value type is glm::vec2 (NDC position). Renders a single PointVertex and sets a circular hit region centered on the position. Suitable as a cursor follower, node handle, or any draggable point primitive.

Parameters
colorPoint color.
sizePoint size in pixels.
hit_radiusHit region radius in NDC units.

Definition at line 86 of file Geometry.cpp.

90{
91 return [color, size, hit_radius](glm::vec2 pos, std::vector<uint8_t>& out, Element& el) {
93 .position = { pos.x, pos.y, 0.0F },
94 .color = color,
95 .size = size,
96 });
97 el.bounds_hint = Kinesis::AABB2D::from_ndc(pos, glm::vec2(hit_radius));
98 el.contains = Kinesis::circular_bounds(pos, hit_radius);
99 };
100}
void write_verts(std::vector< uint8_t > &out, const std::vector< V > &verts)
Write a vertex array into a GeometryFn output buffer.
Definition Geometry.hpp:35
Vertex type for point primitives (POINT_LIST topology)
A bounded, renderable region on a window surface.
Definition Element.hpp:58

References MayaFlux::Kinesis::circular_bounds(), MayaFlux::Kinesis::AABB2D::from_ndc(), MayaFlux::Kakshya::PointVertex::position, and write_verts().

+ Here is the call graph for this function: