Example #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            Matrix lOther = (Matrix)obj;

            return
                (FloatHelper.AlmostEqual(mElements[0, 0], lOther[0, 0]) &&
                 FloatHelper.AlmostEqual(mElements[0, 1], lOther[0, 1]) &&
                 FloatHelper.AlmostEqual(mElements[0, 2], lOther[0, 2]) &&
                 FloatHelper.AlmostEqual(mElements[0, 3], lOther[0, 3]) &&
                 FloatHelper.AlmostEqual(mElements[1, 0], lOther[1, 0]) &&
                 FloatHelper.AlmostEqual(mElements[1, 1], lOther[1, 1]) &&
                 FloatHelper.AlmostEqual(mElements[1, 2], lOther[1, 2]) &&
                 FloatHelper.AlmostEqual(mElements[1, 3], lOther[1, 3]) &&
                 FloatHelper.AlmostEqual(mElements[2, 0], lOther[2, 0]) &&
                 FloatHelper.AlmostEqual(mElements[2, 1], lOther[2, 1]) &&
                 FloatHelper.AlmostEqual(mElements[2, 2], lOther[2, 2]) &&
                 FloatHelper.AlmostEqual(mElements[2, 3], lOther[2, 3]) &&
                 FloatHelper.AlmostEqual(mElements[3, 0], lOther[3, 0]) &&
                 FloatHelper.AlmostEqual(mElements[3, 1], lOther[3, 1]) &&
                 FloatHelper.AlmostEqual(mElements[3, 2], lOther[3, 2]) &&
                 FloatHelper.AlmostEqual(mElements[3, 3], lOther[3, 3]));
        }
Example #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (ReferenceEquals(obj, this))
            {
                return(true);
            }

            Vector lOther = (Vector)obj;

            return(FloatHelper.AlmostEqual(lOther[0], mElements[0]) &&
                   FloatHelper.AlmostEqual(lOther[1], mElements[1]) &&
                   FloatHelper.AlmostEqual(lOther[2], mElements[2]));
        }