Esempio n. 1
0
        public static Vector3 Refract(Vector3 i, Vector3 n, float eta)
        {
            var ni = Dot(n, i);
            var k  = 1.0f - eta * eta * (1.0f - ni * ni);

            var result = k >= 0.0f
                ? eta * i - n * (eta * ni + MathHelpres.FastSqrt(k))
                : new Vector3();

            return(result);
        }
Esempio n. 2
0
        public static float Float() => (float)Next() / int.MaxValue;    //random.NextFloat();

        public static long Long(long min, long max) => MathHelpres.Lerp(min, max, Double());
Esempio n. 3
0
 public static double Double(double min, double max) => MathHelpres.Lerp(min, max, Double());