abstract class
|
NoiseFunction
|
with
|
<TValue>
|
as
|
struct, IEquatable<TValue>
|
implements
|
INoiseFunction<TValue>
|
||||
extends
|
SerializableBase
|
||||
base of
|
ColorFunction
|
||||
ScalarFunction
|
|||||
VectorFunction
|
Returns the configuration value that describes this object.
public
abstract
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
The configuration value. | |
implements
|
IConfigurable.ToConfig
|
Remarks:
All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.
The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.
Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.
For
constant
noise
functions,
returns
the
constant
value.
For
all
others,
the
default
value
of
TValue
is
returned.
public
property
|
ConstantValue
{
get
}
|
||
type
|
TValue
|
||
value
|
The constant value. | ||
implements
|
INoiseFunction.ConstantValue
|
Does this noise function return a constant value?
public
virtual
property
|
IsConstant
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
noise
function
is
constant,
false
if
not. |
||
implements
|
INoiseFunctionBase.IsConstant
|
Remarks:
A constant noise function computes the same value for all input coordinates.
Returns the serial type of this object.
public
property
|
SerialType
{
get
}
|
||
type
|
ISerialTypeInfo
|
||
value
|
|
The serial type. | |
inherited
|
SerializableBase.SerialType
|
Returns the serial data version.
public
virtual
property
|
SerialVersion
{
get
}
|
||
type
|
int32
|
||
value
|
|
The serial data version tag. | |
inherited
|
SerializableBase.SerialVersion
|
Remarks:
An ISerializable implementation is required to support all versions up to the one returned by SerialVersion.
See also:
ISerializable.SerializeComputes the noise value for the given input vector.
public
method
|
ComputeValue
(Vec3D v)
|
||
type
|
TValue
|
||
params
|
v
|
Coordinate of input vector. | |
returns
|
The noise value. | ||
implements
|
INoiseFunction.ComputeValue
|
Computes the noise value for the given input vector.
public
abstract
method
|
ComputeValue
(float64 x,
float64 y,
float64 z)
|
||
type
|
TValue
|
||
params
|
x
|
X-coordinate of input vector. | |
y
|
Y-coordinate of input vector. | ||
z
|
Z-coordinate of input vector. | ||
returns
|
The noise value. | ||
implements
|
INoiseFunction.ComputeValue
|
Initializes the state of this object from the given data stream.
public
virtual
method
|
Deserialize
(int32 serialVersion,
ISerializer data)
|
||
type
|
ISerializable
|
||
params
|
serialVersion
|
[>=1]
|
The serial data version. |
data
|
[not-null]
|
The serial data stream. | |
returns
|
|
The
deserialized
object.
This
will
typically
be
this ,
but
in
some
circumstances,
another
instance
may
be
returned
(e.g.
singletons).
|
|
inherited
|
SerializableBase.Deserialize
|
Remarks:
The Deserialize method will be called immediately after the object has been instantiated via its default constructor.
The provided serialVersion number is guaranteed to be equal to or less than the SerialVersion returned by this object (i.e. ISerializable object must provide backwards compatibility).
See also:
ISerializable.SerializeCompares this object with the given one.
[Pure]
|
||||
public
abstract
method
|
Equals
(INoiseFunctionBase other)
|
|||
type
|
bool
|
|||
params
|
other
|
The object to compare to. | ||
returns
|
true
if
this
object
is
equal
to
other,
false
if
not.
|
|||
implements
|
IEquatable.Equals
|
Does this noise function have the given constant value?
public
method
|
HasConstantValue
(TValue value)
|
||
type
|
bool
|
||
params
|
value
|
The constant value. | |
returns
|
true
if
this
noise
function
has
the
given
constant
value,
false
if
not.
|
||
implements
|
INoiseFunction.HasConstantValue
|
Applies a linear transformation on the output value of this noise function.
[Pure]
|
||||
public
abstract
method
|
LinearBase
(TValue scale,
TValue offset)
|
|||
type
|
INoiseFunction<TValue>
|
|||
params
|
scale
|
Linear coefficient of output transform. | ||
offset
|
Linear coefficient of output transform. | |||
returns
|
|
The resulting noise function. | ||
implements
|
INoiseFunction.LinearBase
|
Remarks:
result = noise * scale + offsetwhere
noise
is
this
noise
function
and
result
is
the
returned
noise
function.
Serializes the current state of this object to the given data stream.
public
virtual
method
|
Serialize
(ISerializer data)
|
||
params
|
data
|
[not-null]
|
The serial data stream. |
inherited
|
SerializableBase.Serialize
|
See also:
ISerializable.DeserializeSimplifies this noise function, if possible.
[Pure]
|
||||
public
virtual
method
|
SimplifyBase
()
|
|||
type
|
INoiseFunction<TValue>
|
|||
returns
|
|
The
simplified
noise
function
or
this . |
||
implements
|
INoiseFunction.SimplifyBase
|
Creates a new instance of NoiseFunction.
protected
constructor
|
NoiseFunction
(ISerialTypeInfo serialType,
bool valueNegative,
TValue valueZero,
TValue valueOne)
|
||
params
|
serialType
|
[not-null]
|
The serial ID. |
valueNegative
|
Can values be negative? | ||
valueZero
|
The zero-element value. | ||
valueOne
|
The one-element value. |
protected
abstract
method
|
EqualValue
(TValue a,
TValue b)
|
||
type
|
bool
|
||
params
|
a
|
||
b
|
protected
method
|
SimplifyAdd
(INoiseFunction<TValue> a,
INoiseFunction<TValue> b)
|
||
type
|
INoiseFunction<TValue>
|
||
params
|
a
|
||
b
|
protected
method
|
SimplifyMul
(INoiseFunction<TValue> a,
INoiseFunction<TValue> b)
|
||
type
|
INoiseFunction<TValue>
|
||
params
|
a
|
||
b
|
protected
method
|
SimplifySub
(INoiseFunction<TValue> a,
INoiseFunction<TValue> b)
|
||
type
|
INoiseFunction<TValue>
|
||
params
|
a
|
||
b
|
Negates
the
given
noise
value,
so
that
value
+
(-value)
=
0
.
protected
virtual
method
|
ValueNeg
(TValue value)
|
||
type
|
TValue
|
||
params
|
value
|
The noise value. | |
returns
|
The resulting noise value. |