MayaFlux 0.2.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 382 of file PathGeneratorNode.cpp.

383{
384 auto view = m_control_points.linearized_view();
385 const size_t num_points = view.size();
386 size_t total_samples = m_samples_per_segment * (num_points - 1);
387
388 m_vertices.resize(total_samples);
389
390 for (Eigen::Index i = 0; i < total_samples; ++i) {
391 double t = static_cast<double>(i) / static_cast<double>(total_samples - 1);
392
393 auto ctrl_idx = std::min<size_t>(static_cast<size_t>(t * float(num_points - 1)), num_points - 1);
394 glm::vec3 color = m_force_uniform_color ? m_current_color : view[ctrl_idx].color;
395 float thickness = m_force_uniform_thickness ? m_current_thickness : view[ctrl_idx].thickness;
396
397 m_vertices[i] = LineVertex {
398 .position = m_custom_func(view, t),
399 .color = color,
400 .thickness = thickness
401 };
402 }
403}
Memory::HistoryBuffer< LineVertex > m_control_points

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::Nodes::LineVertex::position.

Referenced by generate_path_vertices().

+ Here is the caller graph for this function: