Example #1
0
        public void TestCorrelation_In01()
        {
            // Checks correlation between successive values of the generator.
            // This is kind of a wonky test, but it's what detected our terrible RNG in the first place.
            var rng        = new StatelessRng(kSeed);
            var rStateless = S.GetCorrelation(Gen(i => new Vector2(rng.In01(2 * i), rng.In01(2 * i + 1))));

            Assert.Less(Mathf.Abs(rStateless), .01f);
        }
Example #2
0
        public void TestUniformity_In01()
        {
            var rng = new StatelessRng(kSeed);

            S.CheckUniformity("u", Gen(i => rng.In01(i)));
        }
Example #3
0
        // Returns brush size in local space with pressure and variance factored in.
        protected float PressuredRandomSize(float pressure01, int salt)
        {
            float randomness = 1f + m_rng.In01(salt) * m_Desc.m_SizeVariance;

            return(PressuredSize(pressure01) * randomness);
        }