TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

interface IScalarFunction in Tinman.Terrain.Procedural

Base interface for classes that compute procedural scalar (i.e. 1D) noise values.

interface IScalarFunction extends INoiseFunctionOps<float64, IScalarFunction>
  base of ScalarFunction

Attributes

ConstantValue

For constant noise functions, returns the constant value. For all others, the default value of TValue is returned.

property ConstantValue { get }
type TValue
value The constant value.
inherited INoiseFunction.ConstantValue

IsConstant

Does this noise function return a constant value?

property IsConstant { get }
type bool
value true if this noise function is constant, false if not.
inherited INoiseFunctionBase.IsConstant

Remarks:

A constant noise function computes the same value for all input coordinates.

SerialType

Returns the serial type of this object.

property SerialType { get }
type ISerialTypeInfo
value [not-null] The serial type.
inherited ISerializable.SerialType

SerialVersion

Returns the serial data version.

property SerialVersion { get }
type int32
value [>=1] The serial data version tag.
inherited ISerializable.SerialVersion

Remarks:

An ISerializable implementation is required to support all versions up to the one returned by SerialVersion.

See also:

ISerializable.Serialize
ISerializable.Deserialize

Methods

Abs

Returns a noise function that returns the absolute value of this function.

[Pure]
method Abs ()
type IScalarFunction
returns [not-null] The resulting noise function.

Remarks:

result = | this |
  out  : [>=0]

Add

Returns a noise function that sums the noise values of the given function and this one.

[Pure]
method Add (IScalarFunction function)
type IScalarFunction
params function [not-null] The noise function to add.
returns [not-null] The resulting noise function.

Remarks:

result = this + function

Atan

Returns a noise function that computes the arcus tangent of the noise values returned by this noise function.

[Pure]
method Atan ()
type IScalarFunction
returns [not-null] The resulting noise function.

Remarks:

result = atan(this)
  out  : [-90..90] degrees

Clamp

Returns a noise function that clamps the noise values returned by this function to the specified number range.

[Pure]
method Clamp (float64 minimum, float64 maximum)
type IScalarFunction
params minimum The minimum noise value.
  maximum The maximum noise value.
returns [not-null] The resulting noise function.

ComputeValue

Computes the noise value for the given input vector.

method ComputeValue (Vec3D v)
type TValue
params v Coordinate of input vector.
returns The noise value.
inherited INoiseFunction.ComputeValue

Computes the noise value for the given input vector.

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.
inherited INoiseFunction.ComputeValue

Deserialize

Initializes the state of this object from the given data stream.

method Deserialize (int32 serialVersion, ISerializer data)
type ISerializable
params serialVersion [>=1] The serial data version.
  data [not-null] The serial data stream.
returns [not-null] The deserialized object. This will typically be this, but in some circumstances, another instance may be returned (e.g. singletons).
inherited ISerializable.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.Serialize
ISerializable.SerialVersion

Div

Returns a noise function that divides the noise values returned by this function by the noise values returned by the given noise function.

[Pure]
method Div (IScalarFunction function)
type IScalarFunction
params function [not-null] The divisor noise function.
returns [not-null] The resulting noise function.

Remarks:

result := this / function

HasConstantValue

Does this noise function have the given constant value?

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.
inherited INoiseFunction.HasConstantValue

Linear

Applies a linear transformation on the output value of this noise function.

[Pure]
method Linear (TValue scale, TValue offset)
type TNoise
params scale Linear coefficient of output transform.
  offset Linear coefficient of output transform.
returns [not-null] The resulting noise function.
inherited INoiseFunctionOps.Linear

Remarks:

result = noise * scale + offset
where noise is this noise function and result is the returned noise function.

LinearBase

Applies a linear transformation on the output value of this noise function.

[Pure]
method LinearBase (TValue scale, TValue offset)
type INoiseFunction<TValue>
params scale Linear coefficient of output transform.
  offset Linear coefficient of output transform.
returns [not-null] The resulting noise function.
inherited INoiseFunction.LinearBase

Remarks:

result = noise * scale + offset
where noise is this noise function and result is the returned noise function.

Log

Returns a noise function that computes the logarithm base 10 of the noise values returned by this noise function.

[Pure]
method Log ()
type IScalarFunction
returns [not-null] The resulting noise function.

Remarks:

result = log10(this)
  in   : [>0]

Max

Returns a noise function that returns the maximum of the noise values returned by this noise function and the noise values returned by the given noise function.

[Pure]
method Max (IScalarFunction function)
type IScalarFunction
params function [not-null] The noise function.
returns [not-null] The resulting noise function.

Remarks:

result := max(this, function)

Min

Returns a noise function that returns the minimum of the noise values returned by this noise function and the noise values returned by the given noise function.

[Pure]
method Min (IScalarFunction function)
type IScalarFunction
params function [not-null] The noise function.
returns [not-null] The resulting noise function.

Remarks:

result := min(this, function)

Mul

Returns a noise function that multiplies the noise values returned by this noise function with the noise values returned by the given noise function.

[Pure]
method Mul (IScalarFunction function)
type IScalarFunction
params function [not-null] The noise function.
returns [not-null] The resulting noise function.

Remarks:

result := this * function

NaN

Returns a noise function that replaces bad number values produced by this noise function with the given values.

method NaN (float64 nan = 0, float64 neg = 0, float64 pos = 0)
type IScalarFunction
params nan The replacement value for NaN (not-a-number). Defaults to 0.
  neg The replacement value for negative infinity. Defaults to 0.
  pos The replacement value for positive infinity. Defaults to 0.
returns [not-null] The resulting noise function.

Neg

Returns a noise function that negates the values returned by this noise function.

[Pure]
method Neg ()
type IScalarFunction
returns [not-null] The resulting noise function.

Remarks:

result := -this

Pow

Returns a noise function that raises the noise values returned by this noise function to the power values returned by the given noise function.

[Pure]
method Pow (IScalarFunction function)
type IScalarFunction
params function [not-null] The noise function.
returns [not-null] The resulting noise function.

Remarks:

result := this ^ function

Recip

Returns a noise function that computes the reciprocal of the values returned by this noise function.

[Pure]
method Recip ()
type IScalarFunction
returns [not-null] The resulting noise function.

Remarks:

result := 1 / this

Serialize

Serializes the current state of this object to the given data stream.

method Serialize (ISerializer data)
params data [not-null] The serial data stream.
inherited ISerializable.Serialize

See also:

ISerializable.Deserialize
ISerializable.SerialVersion

Simplify

Simplifies this noise function, if possible.

[Pure]
method Simplify ()
type TNoise
returns [not-null] The simplified noise function or this.
inherited INoiseFunctionOps.Simplify

SimplifyBase

Simplifies this noise function, if possible.

[Pure]
method SimplifyBase ()
type INoiseFunction<TValue>
returns [not-null] The simplified noise function or this.
inherited INoiseFunction.SimplifyBase

Sin

Returns a noise function that computes the sine of the noise values returned by this noise function.

[Pure]
method Sin ()
type IScalarFunction
returns [not-null] The resulting noise function.

Remarks:

result = sin(this)
  in   : angle in degrees
  out  : [-1..1]

Spline

Returns a noise function that maps the noise values returned by this noise function onto the given curve.

[Pure]
method Spline (ICurve curve, float64 minimum, float64 maximum)
type IScalarFunction
params curve [not-null] The curve.
  minimum The noise value to map to the first curve control point.
  maximum The noise value to map to the last curve control point.
returns [not-null] The resulting noise function.

Remarks:

The given curve is assumed to be 1D, so only the X-coordinate is used. The noise values computed by this function are used as control point indices (see Compute1D).

Sqr

Returns a noise function that computes the square value of the noise values returned by this noise function.

[Pure]
method Sqr ()
type IScalarFunction
returns [not-null] The resulting noise function.

Remarks:

result := this ^ 2

Sqrt

Returns a noise function that computes the square root of the noise values returned by this noise function.

[Pure]
method Sqrt ()
type IScalarFunction
returns [not-null] The resulting noise function.

Remarks:

result := this ^ 0.5

Sub

Returns a noise function that subtracts the noise values returned by the given noise function from the noise values returned by this noise function.

[Pure]
method Sub (IScalarFunction function)
type IScalarFunction
params function [not-null] The noise function.
returns [not-null] The resulting noise function.

Remarks:

result := this - function

ToConfig

Returns the configuration value that describes this object.

method ToConfig ()
type ConfigValue
returns [not-null] The configuration value.
inherited 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.

Transform

Transforms the input coordinates using the given vector function before plugging them into this noise function.

[Pure]
method Transform (IVectorFunction function)
type TNoise
params function [not-null] The vector function to use for transforming the input coordinates.
returns [not-null] The resulting noise function.
inherited INoiseFunctionOps.Transform

Extensions

AddD

Returns a noise function that adds the given scalar value to the noise values returned by this function.

[Pure]
method AddD (float64 value)
type IScalarFunction
params value The absolute value to add.
returns [not-null] The resulting noise function.

Remarks:

result := this + value

Clamp

Returns a noise function that clamps the noise values returned by this function to the specified number range.

[Pure]
method Clamp (RangeD range)
type IScalarFunction
params range The number range.
returns [not-null] The resulting noise function.

ColorRamp

Returns a noise function that computes color values from noise values using the given color ramp.

[Pure]
method ColorRamp (IColorRamp ramp)
type IColorFunction
params ramp [not-null] The color ramp to use.
returns [not-null] The resulting color function.

DivD

Returns a noise function that divides the noise values returned by this function by the given scalar value.

[Pure]
method DivD (float64 value)
type IScalarFunction
params value The scalar divisor value.
returns [not-null] The resulting noise function.

Remarks:

result := this / value

DivInvD

Returns a noise function that divides the given scalar value by the noise values returned by this noise function.

[Pure]
method DivInvD (float64 value)
type IScalarFunction
params value The scalar dividend value.
returns [not-null] The resulting noise function.

Remarks:

result := value / this

MaxD

Returns a noise function that returns the maximum of the given scalar value and the noise values returned by this noise function.

[Pure]
method MaxD (float64 value)
type IScalarFunction
params value The scalar maximum value.
returns [not-null] The resulting noise function.

Remarks:

result := max(this, value)

MinD

Returns a noise function that returns the minimum of the given scalar value and the noise values returned by this noise function.

[Pure]
method MinD (float64 value)
type IScalarFunction
params value The scalar minimum value.
returns [not-null] The resulting noise function.

Remarks:

result := min(this, value)

MulD

Returns a noise function that multiplies the noise values returned by this noise function with the given scalar value.

[Pure]
method MulD (float64 value)
type IScalarFunction
params value The scalar value to multiply with.
returns [not-null] The resulting noise function.

Remarks:

result := this * value

MultiRidged

Returns a multifractal noise function based on this noise function.

[Pure]
method MultiRidged (int32 octaves, float64 amplitude = 0.5, float64 frequency = 2, float64 offset = 1, float64 gain = 2)
type IScalarFunction
params octaves [>=1] The number of octaves.
  amplitude Factor to apply to amplitude when going to the next octave. The amplitude of the first octave is 1.
  frequency Factor to apply to frequency when going to the next octave. The frequency of the first octave is 1.
  offset The offset value.
  gain The gain value.
returns [not-null] The resulting noise function.

MultiSum

Returns a multifractal noise function based on this noise function.

[Pure]
method MultiSum (int32 octaves, float64 amplitude = 0.5, float64 frequency = 2)
type IScalarFunction
params octaves [>=1] The number of octaves.
  amplitude Factor to apply to amplitude when going to the next octave. The amplitude of the first octave is 1.
  frequency Factor to apply to frequency when going to the next octave. The frequency of the first octave is 1.
returns [not-null] The resulting noise function.

Op

Applies the given function operator to this noise function and the given one (for binary operators only).

method Op (ScalarFunctionOpCode op, IScalarFunction other = null)
type IScalarFunction
params op The operation to use.
  other The other noise function or null if op is unary.
returns [not-null] The resulting noise function.

OpD

Applies the given function operator to this noise function and the given scalar value (for binary operators only).

method OpD (ScalarFunctionOpCode op, float64 value)
type IScalarFunction
params op The operation to use.
  value The scalar value to combine with.
returns [not-null] The resulting noise function.

PowD

Returns a noise function that raises the noise values returned by this noise function to the given power.

[Pure]
method PowD (float64 value)
type IScalarFunction
params value The scalar power value.
returns [not-null] The resulting noise function.

Remarks:

result := this ^ value

PowInvD

Returns a noise function that raises the given scalar value to the power of the noise values returned by this noise function.

[Pure]
method PowInvD (float64 value)
type IScalarFunction
params value The scalar value.
returns [not-null] The resulting noise function.

Remarks:

result := value ^ this

Select

Returns a noise function that blends between this noise function and the given one using a third blend factor noise function.

[Pure]
method Select (IScalarFunction[] noise)
type IScalarFunction
params noise [not-null] The noise functions to blend.
returns [not-null] The resulting noise function.

Returns a noise function that blends between this noise function and the given one using a third blend factor noise function.

[Pure]
method Select (IScalarFunction noise0, IScalarFunction noise1, IScalarFunction noise2 = null, IScalarFunction noise3 = null, IScalarFunction noise4 = null, IScalarFunction noise5 = null, IScalarFunction noise6 = null, IScalarFunction noise7 = null, IScalarFunction noise8 = null, IScalarFunction noise9 = null)
type IScalarFunction
params noise0 [not-null] The noise function to blend at index 0.
  noise1 [not-null] The noise function to blend at index 1.
  noise2 The noise function to blend at index 2 or null.
  noise3 The noise function to blend at index 3 or null.
  noise4 The noise function to blend at index 4 or null.
  noise5 The noise function to blend at index 5 or null.
  noise6 The noise function to blend at index 6 or null.
  noise7 The noise function to blend at index 7 or null.
  noise8 The noise function to blend at index 8 or null.
  noise9 The noise function to blend at index 9 or null.
returns [not-null] The resulting noise function.

SubD

Returns a noise function that subtracts the given scalar value from the noise values returned by this noise function.

[Pure]
method SubD (float64 value)
type IScalarFunction
params value The scalar value to subtract.
returns [not-null] The resulting noise function.

Remarks:

result := this - value

SubInvD

Returns a noise function that subtracts the noise values returned by this noise function from the given scalar value.

[Pure]
method SubInvD (float64 value)
type IScalarFunction
params value The scalar value to subtract from.
returns [not-null] The resulting noise function.

Remarks:

result := value - this

Whirl

Returns a noise function that computes offset vector for perturbing the input coordinates of other noise functions.

method Whirl ()
type IVectorFunction
returns [not-null] The resulting noise function.