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

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

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