Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (GetType() != obj.GetType())
            {
                return(false);
            }
            Vertex2D rhs = (Vertex2D)obj;

            if (x != rhs.x)
            {
                return(false);
            }
            if (y != rhs.y)
            {
                return(false);
            }
            if (depth != rhs.depth)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        public static Vertex2D operator /(Vertex2D lhs, Vertex2D rhs)
        {
            Vertex2D result = new Vertex2D(lhs);

            result.x /= rhs.x == 0 ? 1 : rhs.x;
            result.y /= rhs.y == 0 ? 1 : rhs.y;
            return(result);
        }
Exemplo n.º 3
0
        public static Vertex2D operator *(Vertex2D lhs, int val)
        {
            Vertex2D result = new Vertex2D(lhs);

            result.x *= val;
            result.y *= val;
            return(result);
        }
Exemplo n.º 4
0
        public static Vertex2D operator *(Vertex2D lhs, Vertex2D rhs)
        {
            Vertex2D result = new Vertex2D(lhs);

            result.x *= rhs.x;
            result.y *= rhs.y;
            return(result);
        }
Exemplo n.º 5
0
 public Vertex2D(Vertex2D oth)
 {
     x        = oth.x;
     y        = oth.y;
     color    = oth.color;
     diffuse  = oth.diffuse;
     specular = oth.specular;
     depth    = oth.depth;
     uv0      = oth.uv0;
 }
Exemplo n.º 6
0
        public static Vertex2D operator /(Vertex2D lhs, int val)
        {
            if (val == 0)
            {
                return(lhs);
            }
            Vertex2D result = new Vertex2D(lhs);

            result.x /= val;
            result.y /= val;
            return(result);
        }