Empeld
Empeld plugin documentation.
pluginbase.Helpers.Computative.Random.Random3D Class Reference

A value instance of pure random numbers More...

Inheritance diagram for pluginbase.Helpers.Computative.Random.Random3D:
pluginbase.Helpers.Computative.ValuePoint3D

Public Member Functions

 Random3D (IPseudoRandom gen)
 Initializes an instance with a random number generator More...
 
 Random3D (int seed)
 Initialize an instance with the default random number generator More...
 
float Rand (int x)
 Returns 0-1 float More...
 
float Rand (int x, int y)
 returns 0-1 float More...
 
float Rand (int x, int y, int z)
 Returns 0-1 float More...
 
float Rand (int x, int y, float min, float max)
 Returns between min-max for a given vec2 More...
 
float Rand (int x, int y, int z, float min, float max)
 Returns between min-max, for the given vec3 More...
 
int Randi (int x, int min, int max)
 Returns int between (min, max) More...
 
int Randi (int x, int y, int min, int max)
 returns int between (min, max) More...
 
int Randi (int x, int y, int z, int min, int max)
 Returns int between (min, max) More...
 
override float GetValue (int x, int y, int z)
 Get the value at a coordinate x,y,z More...
 
override float GetValue (int x, int y)
 Get the value at the coordinate x,y More...
 
- Public Member Functions inherited from pluginbase.Helpers.Computative.ValuePoint3D
ValuePoint3D Mix (ValuePoint3D with, float sourceOpacity)
 Mix this value with another one at a certain ratio More...
 
ValuePoint3D Lighten (ValuePoint3D with)
 Lighten this value by another one More...
 
ValuePoint3D Darken (ValuePoint3D with)
 Darken this value by another one More...
 
ValuePoint3D CustomCombine (ValuePoint3D with, Combiner3D.CombinerOperator func)
 Combine two values using a custom combiner More...
 
ValuePoint3D CustomManipulator (Manip3D.ManipOperator func)
 Manipulate this value with a custom manipulator More...
 
ValuePoint3D Abs ()
 Absolute value More...
 
ValuePoint3D Invert ()
 Invert the value from a 0-1 range More...
 
ValuePoint3D Brightness (float amount)
 Adjust brightness. Takes in -1 to 1f More...
 
ValuePoint3D Contrast (float amount)
 Adjusts contract from -1 to 1 More...
 
ValuePoint3D Scale (float factor)
 Scale the specified factor and clamp More...
 
ValuePoint3D LinearBounds (float min, float max)
 Linearly interpolates to squish between the bounds More...
 
ValuePoint3D Threshold (float threshold)
 Threshold the specified threshold. Returns 0 if below, otherwise 1f More...
 
ValuePoint3D Gamma (float gamma)
 Gamma the specified gamma. Range 0f - 2f More...
 
ValuePoint3D Clamp ()
 Clamp this value between 0 and 1 More...
 
ValuePoint3D Clamp (float min, float max)
 Clamp this value between a min and max More...
 

Additional Inherited Members

- Static Public Member Functions inherited from pluginbase.Helpers.Computative.ValuePoint3D
static ValuePoint3D operator+ (ValuePoint3D a, ValuePoint3D b)
 Add two value points together More...
 
static ValuePoint3D operator- (ValuePoint3D a, ValuePoint3D b)
 Subtract two value points More...
 
static ValuePoint3D operator* (ValuePoint3D a, ValuePoint3D b)
 Multiply two value points More...
 
static ValuePoint3D operator/ (ValuePoint3D a, ValuePoint3D b)
 Divide one value by another More...
 

Detailed Description

A value instance of pure random numbers

Constructor & Destructor Documentation

◆ Random3D() [1/2]

pluginbase.Helpers.Computative.Random.Random3D.Random3D ( IPseudoRandom  gen)

Initializes an instance with a random number generator

Parameters
genGen.
18  {
19  generator = gen;
20  }

◆ Random3D() [2/2]

pluginbase.Helpers.Computative.Random.Random3D.Random3D ( int  seed)

Initialize an instance with the default random number generator

Parameters
seedSeed.
27  :this(new PseudoRandom(seed))
28  {
29  }
A basic implementation of a random number generator
Definition: PseudoRandom.cs:7

Member Function Documentation

◆ GetValue() [1/2]

override float pluginbase.Helpers.Computative.Random.Random3D.GetValue ( int  x,
int  y,
int  z 
)
virtual

Get the value at a coordinate x,y,z

Returns
The value.
Parameters
xThe x coordinate.
yThe y coordinate.
zThe z coordinate.

Implements pluginbase.Helpers.Computative.ValuePoint3D.

190  {
191  return Rand(x,y,z);
192  }
float Rand(int x)
Returns 0-1 float
Definition: Random3D.cs:41

◆ GetValue() [2/2]

override float pluginbase.Helpers.Computative.Random.Random3D.GetValue ( int  x,
int  y 
)
virtual

Get the value at the coordinate x,y

Returns
The value.
Parameters
xThe x coordinate.
yThe y coordinate.

Implements pluginbase.Helpers.Computative.ValuePoint3D.

200  {
201  return Rand(x, y);
202  }
float Rand(int x)
Returns 0-1 float
Definition: Random3D.cs:41

◆ Rand() [1/5]

float pluginbase.Helpers.Computative.Random.Random3D.Rand ( int  x)

Returns 0-1 float

Parameters
xA System.Int32
Returns
A System.Single
42  {
43  return generator.Rand(x);
44  }
float Rand(int val)
Random function expected to return between 0 and 1

◆ Rand() [2/5]

float pluginbase.Helpers.Computative.Random.Random3D.Rand ( int  x,
int  y 
)

returns 0-1 float

Parameters
xA System.Int32
yA System.Int32
Returns
A System.Single
59  {
60  return generator.Rand(x*98429 + y*48937);
61  }
float Rand(int val)
Random function expected to return between 0 and 1

◆ Rand() [3/5]

float pluginbase.Helpers.Computative.Random.Random3D.Rand ( int  x,
int  y,
int  z 
)

Returns 0-1 float

Parameters
xA System.Int32
yA System.Int32
zA System.Int32
Returns
A System.Single
79  {
80  return generator.Rand(x*98429 + y*48937 + z*532);
81  }
float Rand(int val)
Random function expected to return between 0 and 1

◆ Rand() [4/5]

float pluginbase.Helpers.Computative.Random.Random3D.Rand ( int  x,
int  y,
float  min,
float  max 
)

Returns between min-max for a given vec2

Returns
The rand.
Parameters
xThe x coordinate.
yThe y coordinate.
minMinimum.
maxMax.
92  {
93  return Rand(x, y) * (max - min) + min;
94  }
float Rand(int x)
Returns 0-1 float
Definition: Random3D.cs:41

◆ Rand() [5/5]

float pluginbase.Helpers.Computative.Random.Random3D.Rand ( int  x,
int  y,
int  z,
float  min,
float  max 
)

Returns between min-max, for the given vec3

Returns
The rand.
Parameters
xThe x coordinate.
yThe y coordinate.
zThe z coordinate.
minMinimum.
maxMax.
106  {
107  return Rand(x, y, z) * (max - min) + min;
108  }
float Rand(int x)
Returns 0-1 float
Definition: Random3D.cs:41

◆ Randi() [1/3]

int pluginbase.Helpers.Computative.Random.Random3D.Randi ( int  x,
int  min,
int  max 
)

Returns int between (min, max)

Parameters
xA System.Int32
minA System.Int32
maxA System.Int32
Returns
A System.Int32
127  {
128  return (int)(Rand(x) * (max-min) + min);
129  }
float Rand(int x)
Returns 0-1 float
Definition: Random3D.cs:41

◆ Randi() [2/3]

int pluginbase.Helpers.Computative.Random.Random3D.Randi ( int  x,
int  y,
int  min,
int  max 
)

returns int between (min, max)

Parameters
xA System.Int32
yA System.Int32
minA System.Int32
maxA System.Int32
Returns
A System.Int32
150  {
151  return (int)(Rand(x,y) * (max-min) + min);
152  }
float Rand(int x)
Returns 0-1 float
Definition: Random3D.cs:41

◆ Randi() [3/3]

int pluginbase.Helpers.Computative.Random.Random3D.Randi ( int  x,
int  y,
int  z,
int  min,
int  max 
)

Returns int between (min, max)

Parameters
xA System.Int32
yA System.Int32
zA System.Int32
minA System.Int32
maxA System.Int32
Returns
A System.Int32
176  {
177  return (int)(Rand(x,y,z) * (max-min) + min);
178  }
float Rand(int x)
Returns 0-1 float
Definition: Random3D.cs:41

The documentation for this class was generated from the following file: