IsZero() публичный статический Метод

public static IsZero ( float value ) : bool
value float
Результат bool
Пример #1
0
        private bool NormalizedAffineInvert()
        {
            float num11 = (this.M12 * this.M23) - (this.M22 * this.M13);
            float num10 = (this.M32 * this.M13) - (this.M12 * this.M33);
            float num9  = (this.M22 * this.M33) - (this.M32 * this.M23);
            float num8  = ((this.M31 * num11) + (this.M21 * num10)) + (this.M11 * num9);

            if (MathUtility.IsZero(num8))
            {
                return(false);
            }

            float num20 = (this.M21 * this.M13) - (this.M11 * this.M23);
            float num19 = (this.M11 * this.M33) - (this.M31 * this.M13);
            float num18 = (this.M31 * this.M23) - (this.M21 * this.M33);
            float num7  = (this.M11 * this.M22) - (this.M21 * this.M12);
            float num6  = (this.M11 * this.M32) - (this.M31 * this.M12);
            float num5  = (this.M11 * this.M42) - (this.M41 * this.M12);
            float num4  = (this.M21 * this.M32) - (this.M31 * this.M22);
            float num3  = (this.M21 * this.M42) - (this.M41 * this.M22);
            float num2  = (this.M31 * this.M42) - (this.M41 * this.M32);
            float num17 = ((this.M23 * num5) - (this.M43 * num7)) - (this.M13 * num3);
            float num16 = ((this.M13 * num2) - (this.M33 * num5)) + (this.M43 * num6);
            float num15 = ((this.M33 * num3) - (this.M43 * num4)) - (this.M23 * num2);
            float num14 = num7;
            float num13 = -num6;
            float num12 = num4;
            float num   = 1.0f / num8;

            this.M11 = num9 * num;
            this.M12 = num10 * num;
            this.M13 = num11 * num;
            this.M21 = num18 * num;
            this.M22 = num19 * num;
            this.M23 = num20 * num;
            this.M31 = num12 * num;
            this.M32 = num13 * num;
            this.M33 = num14 * num;
            this.M41 = num15 * num;
            this.M42 = num16 * num;
            this.M43 = num17 * num;
            return(true);
        }
Пример #2
0
        private bool InvertCore()
        {
            if (!IsDistinguishedIdentity)
            {
                if (IsAffine)
                {
                    return(NormalizedAffineInvert());
                }

                float num7  = (this.M13 * this.M24) - (this.M23 * this.M14);
                float num6  = (this.M13 * this.M34) - (this.M33 * this.M14);
                float num5  = (this.M13 * this.M44) - (this.M43 * this.M14);
                float num4  = (this.M23 * this.M34) - (this.M33 * this.M24);
                float num3  = (this.M23 * this.M44) - (this.M43 * this.M24);
                float num2  = (this.M33 * this.M44) - (this.M43 * this.M34);
                float num12 = ((this.M22 * num6) - (this.M32 * num7)) - (this.M12 * num4);
                float num11 = ((this.M12 * num3) - (this.M22 * num5)) + (this.M42 * num7);
                float num10 = ((this.M32 * num5) - (this.M42 * num6)) - (this.M12 * num2);
                float num9  = ((this.M22 * num2) - (this.M32 * num3)) + (this.M42 * num4);
                float num8  = (((this.M41 * num12) + (this.M31 * num11)) + (this.M21 * num10)) + (this.M11 * num9);

                if (MathUtility.IsZero(num8))
                {
                    return(false);
                }

                float num24 = ((this.M11 * num4) - (this.M21 * num6)) + (this.M31 * num7);
                float num23 = ((this.M21 * num5) - (this.M41 * num7)) - (this.M11 * num3);
                float num22 = ((this.M11 * num2) - (this.M31 * num5)) + (this.M41 * num6);
                float num21 = ((this.M31 * num3) - (this.M41 * num4)) - (this.M21 * num2);
                num7 = (this.M11 * this.M22) - (this.M21 * this.M12);
                num6 = (this.M11 * this.M32) - (this.M31 * this.M12);
                num5 = (this.M11 * this.M42) - (this.M41 * this.M12);
                num4 = (this.M21 * this.M32) - (this.M31 * this.M22);
                num3 = (this.M21 * this.M42) - (this.M41 * this.M22);
                num2 = (this.M31 * this.M42) - (this.M41 * this.M32);
                float num20 = ((this.M13 * num4) - (this.M23 * num6)) + (this.M33 * num7);
                float num19 = ((this.M23 * num5) - (this.M43 * num7)) - (this.M13 * num3);
                float num18 = ((this.M13 * num2) - (this.M33 * num5)) + (this.M43 * num6);
                float num17 = ((this.M33 * num3) - (this.M43 * num4)) - (this.M23 * num2);
                float num16 = ((this.M24 * num6) - (this.M34 * num7)) - (this.M14 * num4);
                float num15 = ((this.M14 * num3) - (this.M24 * num5)) + (this.M44 * num7);
                float num14 = ((this.M34 * num5) - (this.M44 * num6)) - (this.M14 * num2);
                float num13 = ((this.M24 * num2) - (this.M34 * num3)) + (this.M44 * num4);
                float num   = 1.0f / num8;
                this.M11 = num9 * num;
                this.M12 = num10 * num;
                this.M13 = num11 * num;
                this.M14 = num12 * num;
                this.M21 = num21 * num;
                this.M22 = num22 * num;
                this.M23 = num23 * num;
                this.M24 = num24 * num;
                this.M31 = num13 * num;
                this.M32 = num14 * num;
                this.M33 = num15 * num;
                this.M34 = num16 * num;
                this.M41 = num17 * num;
                this.M42 = num18 * num;
                this.M43 = num19 * num;
                this.M44 = num20 * num;
            }
            return(true);
        }