Refactor and improve brush

This commit is contained in:
Andras Schmelczer 2023-04-29 20:20:57 +01:00
commit d8a3ae7528
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
19 changed files with 367 additions and 92 deletions

View file

@ -7,11 +7,15 @@ export abstract class Random {
Random._seed = value;
}
public static getRandom(): number {
public static getRandomInt(): number {
let t = (Random._seed += 0x6d2b79f5);
t = Math.imul(t ^ (t >>> 15), t | 1);
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
return (t ^ (t >>> 14)) >>> 0;
}
public static getRandom(): number {
return Random.getRandomInt() / 4294967296;
}
public static randomBetween(from: number, to: number): number {