Exemple #1
0
        public static void NormalizeFast(ref SCNVector3 vec, out SCNVector3 result)
        {
            pfloat scale = (pfloat)MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z);

            result.X = vec.X * scale;
            result.Y = vec.Y * scale;
            result.Z = vec.Z * scale;
        }
Exemple #2
0
        public void NormalizeFast()
        {
            pfloat scale = (pfloat)MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z);

            X *= scale;
            Y *= scale;
            Z *= scale;
        }
Exemple #3
0
        public static SCNVector3 NormalizeFast(SCNVector3 vec)
        {
            pfloat scale = (pfloat)MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z);

            vec.X *= scale;
            vec.Y *= scale;
            vec.Z *= scale;
            return(vec);
        }