mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Changed love.math.randomnormal([mean], stddev) to love.math.randomNormal(stddev, [mean]);
Changed love.math.randomseed(seed) to love.math.setRandomState(state) and love.math.setRandomState(low, high). Added low, high = love.math.getRandomState(). love.math.setRandomState(state) can set the random state to an integer of up to 53 bits, love.math.setRandomState(low, high) can set the random state to a 64 bit integer by using the first argument as the lower 32 bits and the second argument as the higher 32 bits. This allows for reliable setting and saving of the state of a RNG. --HG-- branch : RandomGenerator-2
This commit is contained in:
@@ -217,8 +217,8 @@ void ParticleSystem::initParticle(particle *p)
|
||||
p->position[1] += (float) rng.random(-areaSpread.getY(), areaSpread.getY());
|
||||
break;
|
||||
case DISTRIBUTION_NORMAL:
|
||||
p->position[0] += (float) rng.randomnormal(areaSpread.getX());
|
||||
p->position[1] += (float) rng.randomnormal(areaSpread.getY());
|
||||
p->position[0] += (float) rng.randomNormal(areaSpread.getX());
|
||||
p->position[1] += (float) rng.randomNormal(areaSpread.getY());
|
||||
break;
|
||||
case DISTRIBUTION_NONE:
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user