Noises: change vectors to Positions. Close #5
This commit is contained in:
@@ -14,11 +14,11 @@
|
|||||||
ValueNoise = {}
|
ValueNoise = {}
|
||||||
|
|
||||||
--- Returns 2D noise value at `pos={x=,y=}`
|
--- Returns 2D noise value at `pos={x=,y=}`
|
||||||
--- @param pos vector|{x:number,y:number}
|
--- @param pos Position2d
|
||||||
--- @return number
|
--- @return number
|
||||||
function ValueNoise:get_2d(pos) end
|
function ValueNoise:get_2d(pos) end
|
||||||
|
|
||||||
--- Returns 3D noise value at `pos={x=,y=,z=}`
|
--- Returns 3D noise value at `pos={x=,y=,z=}`
|
||||||
--- @param pos vector|{x:number,y:number,z:number}
|
--- @param pos Position
|
||||||
--- @return number
|
--- @return number
|
||||||
function ValueNoise:get_3d(pos) end
|
function ValueNoise:get_3d(pos) end
|
||||||
|
|||||||
@@ -20,37 +20,37 @@ ValueNoiseMap = {}
|
|||||||
|
|
||||||
--- Returns a `<size.x>` times `<size.y>` 2D array of 2D noise
|
--- Returns a `<size.x>` times `<size.y>` 2D array of 2D noise
|
||||||
--- with values starting at `pos={x=,y=}`
|
--- with values starting at `pos={x=,y=}`
|
||||||
--- @param pos vector|{x:number,y:number}
|
--- @param pos Position2d
|
||||||
--- @return table
|
--- @return table
|
||||||
function ValueNoiseMap:get_2d_map(pos) end
|
function ValueNoiseMap:get_2d_map(pos) end
|
||||||
|
|
||||||
--- Returns a `<size.x>` times `<size.y>` times `<size.z>`
|
--- Returns a `<size.x>` times `<size.y>` times `<size.z>`
|
||||||
--- 3D array of 3D noise with values starting at `pos={x=,y=,z=}`
|
--- 3D array of 3D noise with values starting at `pos={x=,y=,z=}`
|
||||||
--- @param pos vector|{x:number,y:number,z:number}
|
--- @param pos Position
|
||||||
--- @return table
|
--- @return table
|
||||||
function ValueNoiseMap:get_3d_map(pos) end
|
function ValueNoiseMap:get_3d_map(pos) end
|
||||||
|
|
||||||
--- Returns a flat `<size.x * size.y>` element
|
--- Returns a flat `<size.x * size.y>` element
|
||||||
--- array of 2D noise with values starting at `pos={x=,y=}`
|
--- array of 2D noise with values starting at `pos={x=,y=}`
|
||||||
--- @param pos vector|{x:number,y:number}
|
--- @param pos Position2d
|
||||||
--- @param buffer table If `buffer` is not nil, this table will be used to store the result instead of creating a new table.
|
--- @param buffer table If `buffer` is not nil, this table will be used to store the result instead of creating a new table.
|
||||||
--- @return table
|
--- @return table
|
||||||
function ValueNoiseMap:get_2d_map_flat(pos, buffer) end
|
function ValueNoiseMap:get_2d_map_flat(pos, buffer) end
|
||||||
|
|
||||||
--- Same as `get2dMap_flat`, but 3D noise
|
--- Same as `get2dMap_flat`, but 3D noise
|
||||||
--- @param pos vector|{x:number,y:number,z:number}
|
--- @param pos Position
|
||||||
--- @param buffer table If `buffer` is not nil, this table will be used to store the result instead of creating a new table.
|
--- @param buffer table If `buffer` is not nil, this table will be used to store the result instead of creating a new table.
|
||||||
--- @return table
|
--- @return table
|
||||||
function ValueNoiseMap:get_3d_map_flat(pos, buffer) end
|
function ValueNoiseMap:get_3d_map_flat(pos, buffer) end
|
||||||
|
|
||||||
--- Calculates the 2d noise map starting at `pos`. The result
|
--- Calculates the 2d noise map starting at `pos`. The result
|
||||||
--- is stored internally.
|
--- is stored internally.
|
||||||
--- @param pos vector|{x:number,y:number}
|
--- @param pos Position2d
|
||||||
function ValueNoiseMap:calc_2d_map(pos) end
|
function ValueNoiseMap:calc_2d_map(pos) end
|
||||||
|
|
||||||
--- Calculates the 3d noise map starting at `pos`. The result
|
--- Calculates the 3d noise map starting at `pos`. The result
|
||||||
--- is stored internally.
|
--- is stored internally.
|
||||||
--- @param pos vector|{x:number,y:number,z:number}
|
--- @param pos Position
|
||||||
function ValueNoiseMap:calc_3d_map(pos) end
|
function ValueNoiseMap:calc_3d_map(pos) end
|
||||||
|
|
||||||
--- In the form of an array,
|
--- In the form of an array,
|
||||||
@@ -70,8 +70,8 @@ function ValueNoiseMap:calc_3d_map(pos) end
|
|||||||
--- noise:calc_3d_map({x=1000, y=1000, z=1000})
|
--- noise:calc_3d_map({x=1000, y=1000, z=1000})
|
||||||
--- noisevals = noise:get_map_slice({x=24, z=1}, {x=1, z=1})
|
--- noisevals = noise:get_map_slice({x=24, z=1}, {x=1, z=1})
|
||||||
--- ```
|
--- ```
|
||||||
--- @param slice_offset vector|{x:number?,y:number?,z:number?}
|
--- @param slice_offset {x:number?,y:number?,z:number?}
|
||||||
--- @param slice_size vector|{x:number?,y:number?,z:number?}
|
--- @param slice_size {x:number?,y:number?,z:number?}
|
||||||
--- @param buffer table If `buffer` is not nil, this table will be used to store the result instead of creating a new table.
|
--- @param buffer table If `buffer` is not nil, this table will be used to store the result instead of creating a new table.
|
||||||
--- @return table
|
--- @return table
|
||||||
function ValueNoiseMap:get_map_slice(slice_offset, slice_size, buffer) end
|
function ValueNoiseMap:get_map_slice(slice_offset, slice_size, buffer) end
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ local NoiseParams = {
|
|||||||
--- `spread` is a vector with values for x, y, z to allow the noise variation to be
|
--- `spread` is a vector with values for x, y, z to allow the noise variation to be
|
||||||
--- stretched or compressed in the desired axes.
|
--- stretched or compressed in the desired axes.
|
||||||
--- Values are positive numbers.
|
--- Values are positive numbers.
|
||||||
--- @type vector|{x:number,y:number,z:number}
|
--- @type Position
|
||||||
spread = vector.new(1,1,1),
|
spread = {x=1,y=1,z=1},
|
||||||
|
|
||||||
--- This is a whole number that determines the entire pattern of the noise
|
--- This is a whole number that determines the entire pattern of the noise
|
||||||
--- variation. Altering it enables different noise patterns to be created.
|
--- variation. Altering it enables different noise patterns to be created.
|
||||||
|
|||||||
Reference in New Issue
Block a user