Beispiel #1
0
 public static FVector2 Lerp(FVector2 from, FVector2 to, fint t)
 {
     t = FMath.Clamp01(t);
     return(new FVector2(from.X + (to.X - from.X) * t, from.Y + (to.Y - from.Y) * t));
 }
Beispiel #2
0
 public static fint Distance(FVector2 a, FVector2 b)
 {
     return((a - b).magnitude);
 }
Beispiel #3
0
 public static fint Dot(FVector2 lhs, FVector2 rhs)
 {
     return(lhs.X * rhs.X + lhs.Y * rhs.Y);
 }
Beispiel #4
0
 //
 // Static Methods
 //
 public static fint Angle(FVector2 from, FVector2 to)
 {
     return(FMath.Acos(FMath.Clamp(FVector2.Dot(from.normalized, to.normalized), -fint.one, fint.one)) * FMath.Rad2Deg);
 }
Beispiel #5
0
 public void Scale(FVector2 scale)
 {
     this.X *= scale.X;
     this.Y *= scale.Y;
 }
Beispiel #6
0
 public static fint SqrMagnitude(FVector2 a)
 {
     return(a.X * a.X + a.Y * a.Y);
 }
Beispiel #7
0
 public static FVector2 Scale(FVector2 a, FVector2 b)
 {
     return(new FVector2(a.X * b.X, a.Y * b.Y));
 }
Beispiel #8
0
 public static FVector2 Min(FVector2 lhs, FVector2 rhs)
 {
     return(new FVector2(FMath.Min(lhs.X, rhs.X), FMath.Min(lhs.Y, rhs.Y)));
 }