noise :: Noise :: amplitude=
Set the desired amplitude of the values returned by[]
noise :: Noise :: defaultinit
noise $ Noise :: core_serialize_to
Actual serialization ofself
to serializer
noise $ Noise :: from_deserializer
Create an instance of this class from thedeserializer
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
noise :: Noise :: amplitude=
Set the desired amplitude of the values returned by[]
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
noise :: Noise :: defaultinit
core :: Object :: defaultinit
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
serialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: output_class_name
Display class name on stdout (debug only).serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
Serializer::serialize
# 2D noise generator
abstract class Noise
# Get the noise value at `x`, `y`
#
# The coordinates `x`, `y` can be floats of any size.
#
# Returns a value between or equal to `min` and `max`.
fun [](x, y: Float): Float is abstract
# Lowest possible value returned by `[]`
#
# Default at `0.0`.
#
# Require: `min < max`
var min = 0.0 is writable
# Highest possible value returned by `[]`
#
# Default at `1.0`.
#
# Require: `min < max`
var max = 1.0 is writable
# Distance between reference points of the noise
#
# Higher values will result in smoother noise and
# lower values will result in steeper curves.
#
# Default at `1.0`.
var period = 1.0 is writable
# Amplitude of the values returned by `[]`
fun amplitude: Float do return max - min
# Set the desired amplitude of the values returned by `[]`
#
# Will only modify `max`, `min` stays the same.
fun amplitude=(value: Float) do max = min + value
# Frequency of this noise
fun frequency: Float do return 1.0/period
# Set the frequency if this noise
fun frequency=(value: Float) do period = 1.0/value
# Seed to the random number generator `gradient_vector`
#
# By default, `seed` has a random value created with `Int::rand`.
var seed: Int = 19511359.rand is lazy, writable
end
lib/noise/noise.nit:20,1--70,3