Class BezierCurve

Class Documentation

class inexor::vulkan_renderer::BezierCurve

This struct bundles describes everything about the bezier curve. It contains both the input points and the generated output points.

Public Functions

void add_input_point(const BezierInputPoint &input_point)
void add_input_point(const glm::vec3 &position, float weight = 1.0f)
void calculate_bezier_curve(std::uint32_t curve_segments)
std::vector<BezierOutputPoint> output_points()
void clear_output()
void clear_input()
void clear()
inline bool is_curve_generated() const

Private Functions

BezierOutputPoint calculate_point_on_curve(float curve_precision)

Private Members

bool m_curve_generated = {false}
float m_curve_precision = {0.0f}
std::vector<BezierInputPoint> m_input_points
std::vector<BezierOutputPoint> m_output_points

Private Static Functions

static uint32_t binomial_coefficient(uint32_t n, uint32_t k)
static float bernstein_polynomial(uint32_t n, uint32_t k, float curve_precision, float coordinate_value)