Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
 public static FVector2 Min(FVector2 lhs, FVector2 rhs)
 {
     return(new FVector2(FMath.Min(lhs.X, rhs.X), FMath.Min(lhs.Y, rhs.Y)));
 }
Ejemplo n.º 3
0
        public static FVector3 Lerp(FVector3 from, FVector3 to, fint t)
        {
            t = FMath.Clamp01(t);

            return(new FVector3(from.x + (to.x - from.x) * t, from.y + (to.y - from.y) * t, from.z + (to.z - from.z) * t));
        }
Ejemplo n.º 4
0
 public static FVector3 Min(FVector3 lhs, FVector3 rhs)
 {
     return(new FVector3(FMath.Min(lhs.x, rhs.x), FMath.Min(lhs.y, rhs.y), FMath.Min(lhs.z, rhs.z)));
 }
Ejemplo n.º 5
0
        public static fint Distance(FVector3 a, FVector3 b)
        {
            FVector3 vector = new FVector3(a.x - b.x, a.y - b.y, a.z - b.z);

            return(FMath.Sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z));
        }