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

◆ generate_custom_path()

void MayaFlux::Nodes::GpuSync::PathGeneratorNode::generate_custom_path ( )
private

Definition at line 454 of file PathGeneratorNode.cpp.

455{
456 const size_t num_points = m_control_points.size();
457 size_t total_samples = m_samples_per_segment * (num_points - 1);
458
459 m_vertices.resize(total_samples);
460
461 for (Eigen::Index i = 0; i < total_samples; ++i) {
462 double t = static_cast<double>(i) / static_cast<double>(total_samples - 1);
463
464 auto ctrl_idx = std::min<size_t>(static_cast<size_t>(t * float(num_points - 1)), num_points - 1);
465 glm::vec3 color = m_force_uniform_color ? m_current_color : m_control_points[ctrl_idx].color;
466 float thickness = m_force_uniform_thickness ? m_current_thickness : m_control_points[ctrl_idx].thickness;
467
470 .color = color,
471 .thickness = thickness
472 };
473 }
474}
std::vector< LineVertex > m_control_points
Control points, newest first: index 0 is the most recently added.
Kakshya::LineVertex LineVertex
Definition VertexSpec.hpp:8

References m_control_points, m_current_color, m_current_thickness, m_custom_func, m_force_uniform_color, m_force_uniform_thickness, m_samples_per_segment, m_vertices, and MayaFlux::Kakshya::LineVertex::position.

Referenced by generate_path_vertices().

+ Here is the caller graph for this function: