沿 Hermite 曲线返回值。例如,可以使用 Hermite 函数沿曲线平滑地移动对象。
vector hermite(vector start, vector end, vector tan1, vector tan2, float parameter)
float hermite(float start, float end, float tan1, float tan2, float parameter)
start 为曲线的起点。
end 为曲线的终点。
tan1 是切向向量,用于控制曲线在离开曲线的起点时的方向和形状。向量的位置在曲线的起点开始。
tan2 是切向向量,用于控制曲线在接近曲线的终点时的方向和形状。向量的位置在曲线的终点开始。
parameter 是介于 0 和 1 之间的浮点值,例如 linstep 函数返回的值。
在第二种格式中,参数和返回值在单维中工作。