Esempio n. 1
0
        public static IVec3 Subtract(IVec3 first, params IVec3[] vecs)
        {
            if (vecs.Length == 0)
            {
                return(first);
            }
            IVec3 vec = first.GetNewInstance(first.X, first.Y, first.Z);

            for (int i = 0; i < vecs.Length; i++)
            {
                vec.X -= vecs[i].X;
                vec.Y -= vecs[i].Y;
                vec.Z -= vecs[i].Z;
            }
            return(vec);
        }
Esempio n. 2
0
 public static IVec3 Dot(IVec3 left, IVec3 right)
 {
     return(left.GetNewInstance(left.X * right.X, left.Y * right.Y, left.Z * right.Z));
 }
Esempio n. 3
0
        public static IVec3 Normalized(IVec3 vec)
        {
            float dist = GetLength(vec);

            return(vec.GetNewInstance(vec.X / dist, vec.Y / dist, vec.Z / dist));
        }
Esempio n. 4
0
 public static IVec3 Scale(IVec3 vec, IVec3 scalar)
 {
     return(vec.GetNewInstance(vec.X * scalar.X, vec.Y * scalar.Y, vec.Z * scalar.Z));
 }
Esempio n. 5
0
 public static IVec3 Scale(IVec3 vec, float scalar)
 {
     return(vec.GetNewInstance(vec.X * scalar, vec.Y * scalar, vec.Z * scalar));
 }