From fed9ca47b87bac4a6c277be4894215f4b5e6b023 Mon Sep 17 00:00:00 2001 From: Vanic Date: Sun, 5 Oct 2025 15:06:04 +0300 Subject: [PATCH] Noises: minor params changes --- classes/ValueNoise.lua | 4 ++-- classes/ValueNoiseMap.lua | 16 ++++++++-------- definitions/NoiseParams.lua | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/classes/ValueNoise.lua b/classes/ValueNoise.lua index efb0c4e..717c83c 100644 --- a/classes/ValueNoise.lua +++ b/classes/ValueNoise.lua @@ -14,11 +14,11 @@ ValueNoise = {} --- Returns 2D noise value at `pos={x=,y=}` ---- @param pos vector +--- @param pos vector|{x:number,y:number} --- @return number function ValueNoise:get_2d(pos) end --- Returns 3D noise value at `pos={x=,y=,z=}` ---- @param pos vector +--- @param pos vector|{x:number,y:number,z:number} --- @return number function ValueNoise:get_3d(pos) end \ No newline at end of file diff --git a/classes/ValueNoiseMap.lua b/classes/ValueNoiseMap.lua index 48d7253..8254c8d 100644 --- a/classes/ValueNoiseMap.lua +++ b/classes/ValueNoiseMap.lua @@ -20,37 +20,37 @@ ValueNoiseMap = {} --- Returns a `` times `` 2D array of 2D noise --- with values starting at `pos={x=,y=}` ---- @param pos vector +--- @param pos vector|{x:number,y:number} --- @return table function ValueNoiseMap:get_2d_map(pos) end --- Returns a `` times `` times `` --- 3D array of 3D noise with values starting at `pos={x=,y=,z=}` ---- @param pos vector +--- @param pos vector|{x:number,y:number,z:number} --- @return table function ValueNoiseMap:get_3d_map(pos) end --- Returns a flat `` element --- array of 2D noise with values starting at `pos={x=,y=}` ---- @param pos vector +--- @param pos vector|{x:number,y:number} --- @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 function ValueNoiseMap:get_2d_map_flat(pos, buffer) end --- Same as `get2dMap_flat`, but 3D noise ---- @param pos vector +--- @param pos vector|{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. --- @return table function ValueNoiseMap:get_3d_map_flat(pos, buffer) end --- Calculates the 2d noise map starting at `pos`. The result --- is stored internally. ---- @param pos vector +--- @param pos vector|{x:number,y:number} function ValueNoiseMap:calc_2d_map(pos) end --- Calculates the 3d noise map starting at `pos`. The result --- is stored internally. ---- @param pos vector +--- @param pos vector|{x:number,y:number,z:number} function ValueNoiseMap:calc_3d_map(pos) end --- 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}) --- noisevals = noise:get_map_slice({x=24, z=1}, {x=1, z=1}) --- ``` ---- @param slice_offset vector ---- @param slice_size vector +--- @param slice_offset vector|{x:number?,y:number?,z:number?} +--- @param slice_size vector|{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. --- @return table function ValueNoiseMap:get_map_slice(slice_offset, slice_size, buffer) end \ No newline at end of file diff --git a/definitions/NoiseParams.lua b/definitions/NoiseParams.lua index 93d7460..7580588 100644 --- a/definitions/NoiseParams.lua +++ b/definitions/NoiseParams.lua @@ -38,8 +38,8 @@ local NoiseParams = { --- `spread` is a vector with values for x, y, z to allow the noise variation to be --- stretched or compressed in the desired axes. --- Values are positive numbers. - --- @type vector - spread = vector(1,1,1), + --- @type vector|{x:number,y:number,z:number} + spread = vector.new(1,1,1), --- This is a whole number that determines the entire pattern of the noise --- variation. Altering it enables different noise patterns to be created.