Function veloren_common::terrain::quadratic_nearest_point
source · pub fn quadratic_nearest_point(
spline: &Vec3<Vec2<f64>>,
point: Vec2<f64>,
_line: Vec2<Vec2<f64>>,
) -> Option<(f64, Vec2<f64>, f64)>
Expand description
Find the nearest point from a quadratic spline to this point (in terms of t, the “distance along the curve” by which our spline is parameterized). Note that if t < 0.0 or t >= 1.0, we probably shouldn’t be considered “on the curve”… hopefully this works out okay and gives us what we want (a river that extends outwards tangent to a quadratic curve, with width configured by distance along the line).