Noise
Abstract base class for noise generators.
Noise.swift:16class Noise
This class defines the interface for noise generation libraries to inherit from.
A default getSeamlessImage(width:height:invert:in3dSpace:skirt:normalize:)
implementation is provided for libraries that do not provide seamless noise. This function requests a larger image from the getImage(width:height:invert:in3dSpace:normalize:)
method, reverses the quadrants of the image, then uses the strips of extra width to blend over the seams.
Inheriting noise classes can optionally override this function to provide a more optimal algorithm.
Superclasses
class Resource
Base class for serializable objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
func getImage(width: Int32, height: Int32, invert: Bool, in3dSpace: Bool, normalize: Bool
) -> Image? Returns an
Image
containing 2D noise values.func getImage3d(width: Int32, height: Int32, depth: Int32, invert: Bool, normalize: Bool
) -> ObjectCollection<Image> Returns an
GArray
ofImage
s containing 3D noise values for use withcreate(format:width:height:depth:useMipmaps:data:)
.func getNoise1d(x: Double
) -> Double Returns the 1D noise value at the given (x) coordinate.
func getNoise2d(x: Double, y: Double
) -> Double Returns the 2D noise value at the given position.
func getNoise2dv(v: Vector2
) -> Double Returns the 2D noise value at the given position.
func getNoise3d(x: Double, y: Double, z: Double
) -> Double Returns the 3D noise value at the given position.
func getNoise3dv(v: Vector3
) -> Double Returns the 3D noise value at the given position.
func getSeamlessImage(width: Int32, height: Int32, invert: Bool, in3dSpace: Bool, skirt: Double, normalize: Bool
) -> Image? Returns an
Image
containing seamless 2D noise values.func getSeamlessImage3d(width: Int32, height: Int32, depth: Int32, invert: Bool, skirt: Double, normalize: Bool
) -> ObjectCollection<Image> Returns an
GArray
ofImage
s containing seamless 3D noise values for use withcreate(format:width:height:depth:useMipmaps:data:)
.
Subclasses
class FastNoiseLite
Generates noise using the FastNoiseLite library.