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

◆ point()

MAYAFLUX_API Form< 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 128 of file FormFactory.cpp.

132{
133 GeometryFn<glm::vec2> fn = [color, size, hit_radius](glm::vec2 pos, std::vector<uint8_t>& out, Element& el) {
135 .position = { pos.x, pos.y, 0.0F },
136 .color = color,
137 .size = size,
138 });
139 el.bounds_hint = Kinesis::AABB2D::from_ndc(pos, glm::vec2(hit_radius));
140 el.contains = Kinesis::circular_bounds(pos, hit_radius);
141 };
142
143 return { std::move(fn),
144 Graphics::PrimitiveTopology::POINT_LIST,
145 sizeof(Kakshya::PointVertex),
146 follow_move() };
147}
glm::vec3 color
Definition Decoder.cpp:97
bool size
std::vector< float > * out
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
std::function< void(T value, std::vector< uint8_t > &out_bytes, Element &element)> GeometryFn
Geometry function signature.
Definition Mapped.hpp:71
Vertex type for point primitives (POINT_LIST topology)
A bounded, renderable region on a window surface.
Definition Element.hpp:61

References MayaFlux::Kinesis::circular_bounds(), color, follow_move(), MayaFlux::Kinesis::AABB2D::from_ndc(), out, MayaFlux::Portal::Graphics::POINT_LIST, MayaFlux::Kakshya::PointVertex::position, size, and write_verts().

+ Here is the call graph for this function: