Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
noise.qh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 classfield (Noise).float noise_baccum
 entityclass (Noise)
ERASEABLE float Noise_Brown (entity e, float dt)
ERASEABLE float Noise_Burst (entity e, float dt, float p)
 +1 or -1
ERASEABLE float Noise_Pink (entity e, float dt)
ERASEABLE float Noise_White (entity e, float dt)

Function Documentation

◆ classfield()

classfield ( Noise )

References ERASEABLE.

◆ entityclass()

entityclass ( Noise )

◆ Noise_Brown()

ERASEABLE float Noise_Brown ( entity e,
float dt )

Definition at line 12 of file noise.qh.

13{
14 e.noise_baccum += random() * sqrt(dt); // same stddev for all dt
15 return e.noise_baccum;
16}
float random(void)
float sqrt(float f)

References entity(), random(), and sqrt().

◆ Noise_Burst()

ERASEABLE float Noise_Burst ( entity e,
float dt,
float p )

+1 or -1

Definition at line 35 of file noise.qh.

36{
37 if (random() > (p ** dt)) e.noise_bstate = !e.noise_bstate;
38 return 2 * e.noise_bstate - 1;
39}

References entity(), and random().

◆ Noise_Pink()

ERASEABLE float Noise_Pink ( entity e,
float dt )

Definition at line 18 of file noise.qh.

19{
20 float f;
21 f = dt * 60;
22 // http://home.earthlink.net/~ltrammell/tech/pinkalg.htm
23 if (random() > (0.3190 ** f)) e.noise_paccum = 0.34848 * (2 * random() - 1);
24 if (random() > (0.7756 ** f)) e.noise_paccum2 = 0.28768 * (2 * random() - 1);
25 if (random() > (0.9613 ** f)) e.noise_paccum3 = 0.43488 * (2 * random() - 1);
26 return e.noise_paccum + e.noise_paccum2 + e.noise_paccum3;
27}

References entity(), and random().

Referenced by View_NightVision().

◆ Noise_White()

ERASEABLE float Noise_White ( entity e,
float dt )

Definition at line 29 of file noise.qh.

30{
31 return random() * 2 - 1;
32}

References entity(), and random().

Referenced by View_NightVision().