Example #1
0
        public static Vector2 Direction(this IRNG rng)
        {
            var vector = new Vector2
            {
                x = rng.Float(),
                y = rng.Float()
            };

            return(vector.normalized);
        }
        public float Sample(IRNG random)
        {
            var point      = random.Float();
            var curvePoint = this.curve.Evaluate(point);

            return(Mathf.Lerp(this.minimum, this.maximum, curvePoint));
        }
Example #3
0
 public float Sample(IRNG random) => random.Float();
Example #4
0
 public static bool Flip(this IRNG rng, float probability = 0.5f)
 {
     return(rng.Float() < probability);
 }