gl3n.interpolate

gl3n.interpolate

Authors

David Herberth

License

MIT

  • Declaration

    T interp(T)(T a, T b, float t);
    alias interp_linear = interp(T)(T a, T b, float t);
    alias lerp = interp(T)(T a, T b, float t);
    alias mix = interp(T)(T a, T b, float t);

    Interpolates linear between two points, also known as lerp.

  • Declaration

    T interp_spherical(T)(T a, T b, float t) if (is_vector!T || is_quaternion!T);
    alias slerp = interp_spherical(T)(T a, T b, float t) if (is_vector!T || is_quaternion!T);

    Interpolates spherical between to vectors or quaternions, also known as slerp.

  • Declaration

    pure nothrow @safe quat nlerp(quat a, quat b, float t);

    Normalized quaternion linear interpolation.

  • Declaration

    T interp_nearest(T)(T x, T y, float t);

    Nearest interpolation of two points.

  • Declaration

    T interp_catmullrom(T)(T p0, T p1, T p2, T p3, float t);

    Catmull-rom interpolation between four points.

  • Declaration

    T catmullrom_derivative(T)(T p0, T p1, T p2, T p3, float t);

    Catmull-derivatives of the interpolation between four points.

  • Declaration

    T interp_hermite(T)(T x, T tx, T y, T ty, float t);

    Hermite interpolation (cubic hermite spline).