public void Normalize()
        {
            long num  = (long)(this._x * 100);
            long num2 = (long)(this._y * 100);
            long num3 = num * num + num2 * num2;

            if (num3 == 0L)
            {
                return;
            }

            long b = (long)LMath.Sqrt(num3);

            this._x = (int)(num * 1000L / b);
            this._y = (int)(num2 * 1000L / b);
        }
Exemple #2
0
        public LVector3 Normalize(LFloat newMagn)
        {
            long num  = (long)(this._x * 100);
            long num2 = (long)(this._y * 100);
            long num3 = (long)(this._z * 100);
            long num4 = num * num + num2 * num2 + num3 * num3;

            if (num4 == 0L)
            {
                return(this);
            }

            long b    = (long)LMath.Sqrt(num4);
            long num5 = newMagn._val;

            this._x = (int)(num * num5 / b);
            this._y = (int)(num2 * num5 / b);
            this._z = (int)(num3 * num5 / b);
            return(this);
        }