Ejemplo n.º 1
0
        public static WorldPosition operator +(WorldPosition a, WorldPosition b)
        {
            WorldPosition result = new WorldPosition();

            result.BX = a.BX + b.BX;
            result.BY = a.BY + b.BY;
            result.X  = a.X + b.X;
            result.Y  = a.Y + b.Y;
            result.Z  = a.Z + b.Z;

            result.Normalize();

            return(result);
        }
Ejemplo n.º 2
0
        public static WorldPosition operator *(WorldPosition a, float b)
        {
            WorldPosition result = new WorldPosition();
            float         rBX    = a.BX * b;
            float         rBY    = a.BY * b;

            result.BX = (int)rBX;
            result.BY = (int)rBY;
            result.X  = a.X * b + (Stride * (rBX - result.BX));
            result.Y  = a.Y * b;
            result.Z  = a.Z * b + (Stride * (rBY - result.BY));

            result.Normalize();

            return(result);
        }