public static LVector4 Slerp(LVector4 from, LVector4 to, LFloat t) { t = LMath.Clamp(t, 0, 1); LFloat diff = Angle(from, to) * LMath.DegToRad; LFloat sind = LMath.Sin(diff); LFloat sintd = LMath.Sin(t * diff); LFloat sin1td = LMath.Sin((1 - t) * diff); return((sin1td / sind) * from + (sintd / sind) * to); }
public LFloat Dot(LVector4 v) { return(LVector4.Dot(this, v)); }
public static LVector4 Lerp(LVector4 from, LVector4 to, float t) { return((1 - t) * from + t * to); }
public static LFloat Angle(LVector4 lhs, LVector4 rhs) { lhs.Normalize(); rhs.Normalize(); return(LMath.Acos(lhs.Dot(rhs)) * LMath.RadToDeg); }
public static LVector4 Project(LVector4 vec, LVector4 on) { return(vec.Dot(on) / on.sqrMagnitude * on); }
public static LFloat Dot(LVector4 lhs, LVector4 rhs) { return(lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z + lhs.w * rhs.w); }