diff options
Diffstat (limited to 'meta/3rd/lovr/library')
-rw-r--r-- | meta/3rd/lovr/library/lovr.audio.lua | 56 | ||||
-rw-r--r-- | meta/3rd/lovr/library/lovr.data.lua | 35 | ||||
-rw-r--r-- | meta/3rd/lovr/library/lovr.event.lua | 173 | ||||
-rw-r--r-- | meta/3rd/lovr/library/lovr.graphics.lua | 333 | ||||
-rw-r--r-- | meta/3rd/lovr/library/lovr.headset.lua | 94 | ||||
-rw-r--r-- | meta/3rd/lovr/library/lovr.math.lua | 35 | ||||
-rw-r--r-- | meta/3rd/lovr/library/lovr.physics.lua | 18 | ||||
-rw-r--r-- | meta/3rd/lovr/library/lovr.system.lua | 2 |
8 files changed, 378 insertions, 368 deletions
diff --git a/meta/3rd/lovr/library/lovr.audio.lua b/meta/3rd/lovr/library/lovr.audio.lua index e948e0d4..22106b30 100644 --- a/meta/3rd/lovr/library/lovr.audio.lua +++ b/meta/3rd/lovr/library/lovr.audio.lua @@ -183,8 +183,8 @@ function lovr.audio.isStarted(type) end --- ---Creates a new Source from an ogg, wav, or mp3 file. --- ----@overload fun(blob: lovr.Blob, options: table):lovr.Source ----@overload fun(sound: lovr.Sound, options: table):lovr.Source +---@overload fun(blob: lovr.Blob, options?: table):lovr.Source +---@overload fun(sound: lovr.Sound, options?: table):lovr.Source ---@param filename string # The filename of the sound to load. ---@param options? {decode: boolean, effects: table} # Optional options. ---@return lovr.Source source # The new Source. @@ -263,7 +263,7 @@ function lovr.audio.setDevice(type, id, sink, mode) end --- ---The triangles must use counterclockwise winding. --- ----@overload fun(model: lovr.Model, material: lovr.AudioMaterial):boolean +---@overload fun(model: lovr.Model, material?: lovr.AudioMaterial):boolean ---@param vertices table # A flat table of vertices. Each vertex is 3 numbers representing its x, y, and z position. The units used for audio coordinates are up to you, but meters are recommended. ---@param indices table # A list of indices, indicating how the vertices are connected into triangles. Indices are 1-indexed and are 32 bits (they can be bigger than 65535). ---@param material? lovr.AudioMaterial # The acoustic material to use. @@ -672,35 +672,35 @@ function Source:tell(unit) end --- ---Generic default audio material. --- ----| '"generic"' +---| "generic" --- ---Brick. --- ----| '"brick"' +---| "brick" --- ---Carpet. --- ----| '"carpet"' +---| "carpet" --- ---Ceramic. --- ----| '"ceramic"' +---| "ceramic" --- ---Concrete. --- ----| '"concrete"' +---| "concrete" ----| '"glass"' +---| "glass" ----| '"gravel"' +---| "gravel" ----| '"metal"' +---| "metal" ----| '"plaster"' +---| "plaster" ----| '"rock"' +---| "rock" ----| '"wood"' +---| "wood" --- ---Audio devices can be created in shared mode or exclusive mode. @@ -711,11 +711,11 @@ function Source:tell(unit) end --- ---Shared mode. --- ----| '"shared"' +---| "shared" --- ---Exclusive mode. --- ----| '"exclusive"' +---| "exclusive" --- ---When referencing audio devices, this indicates whether it's the playback or capture device. @@ -724,11 +724,11 @@ function Source:tell(unit) end --- ---The playback device (speakers, headphones). --- ----| '"playback"' +---| "playback" --- ---The capture device (microphone). --- ----| '"capture"' +---| "capture" --- ---Different types of effects that can be applied with `Source:setEffectEnabled`. @@ -747,27 +747,27 @@ function Source:tell(unit) end --- ---Models absorption as sound travels through the air, water, etc. --- ----| '"absorption"' +---| "absorption" --- ---Decreases audio volume with distance (1 / max(distance, 1)). --- ----| '"falloff"' +---| "falloff" --- ---Causes audio to drop off when the Source is occluded by geometry. --- ----| '"occlusion"' +---| "occlusion" --- ---Models reverb caused by audio bouncing off of geometry. --- ----| '"reverb"' +---| "reverb" --- ---Spatializes the Source using either simple panning or an HRTF. --- ----| '"spatialization"' +---| "spatialization" --- ---Causes audio to be heard through walls when occluded, based on audio materials. --- ----| '"transmission"' +---| "transmission" --- ---When figuring out how long a Source is or seeking to a specific position in the sound file, units can be expressed in terms of seconds or in terms of frames. @@ -778,11 +778,11 @@ function Source:tell(unit) end --- ---Seconds. --- ----| '"seconds"' +---| "seconds" --- ---Frames. --- ----| '"frames"' +---| "frames" --- ---When accessing the volume of Sources or the audio listener, this can be done in linear units with a 0 to 1 range, or in decibels with a range of -∞ to 0. @@ -791,8 +791,8 @@ function Source:tell(unit) end --- ---Linear volume range. --- ----| '"linear"' +---| "linear" --- ---Decibels. --- ----| '"db"' +---| "db" diff --git a/meta/3rd/lovr/library/lovr.data.lua b/meta/3rd/lovr/library/lovr.data.lua index 04276439..9c53bab0 100644 --- a/meta/3rd/lovr/library/lovr.data.lua +++ b/meta/3rd/lovr/library/lovr.data.lua @@ -9,8 +9,8 @@ lovr.data = {} --- ---Creates a new Blob. --- ----@overload fun(contents: string, name: string):lovr.Blob ----@overload fun(source: lovr.Blob, name: string):lovr.Blob +---@overload fun(contents: string, name?: string):lovr.Blob +---@overload fun(source: lovr.Blob, name?: string):lovr.Blob ---@param size number # The amount of data to allocate for the Blob, in bytes. All of the bytes will be filled with zeroes. ---@param name? string # A name for the Blob (used in error messages) ---@return lovr.Blob blob # The new Blob. @@ -29,9 +29,9 @@ function lovr.data.newBlob(size, name) end --- ---Currently textures loaded as KTX need to be in DXT/ASTC formats. --- ----@overload fun(width: number, height: number, format: lovr.TextureFormat, data: lovr.Blob):lovr.Image +---@overload fun(width: number, height: number, format?: lovr.TextureFormat, data?: lovr.Blob):lovr.Image ---@overload fun(source: lovr.Image):lovr.Image ----@overload fun(blob: lovr.Blob, flip: boolean):lovr.Image +---@overload fun(blob: lovr.Blob, flip?: boolean):lovr.Image ---@param filename string # The filename of the image to load. ---@param flip? boolean # Whether to vertically flip the image on load. This should be true for normal textures, and false for textures that are going to be used in a cubemap. ---@return lovr.Image image # The new Image. @@ -50,8 +50,8 @@ function lovr.data.newModelData(filename) end --- ---Creates a new Rasterizer from a TTF file. --- ----@overload fun(filename: string, size: number):lovr.Rasterizer ----@overload fun(blob: lovr.Blob, size: number):lovr.Rasterizer +---@overload fun(filename: string, size?: number):lovr.Rasterizer +---@overload fun(blob: lovr.Blob, size?: number):lovr.Rasterizer ---@param size? number # The resolution to render the fonts at, in pixels. Higher resolutions use more memory and processing power but may provide better quality results for some fonts/situations. ---@return lovr.Rasterizer rasterizer # The new Rasterizer. function lovr.data.newRasterizer(size) end @@ -325,8 +325,9 @@ function Rasterizer:getLineHeight() end --- ---Check if the Rasterizer can rasterize a set of glyphs. --- +---@vararg any # Strings (sets of characters) or numbers (character codes) to check for. ---@return boolean hasGlyphs # true if the Rasterizer can rasterize all of the supplied characters, false otherwise. -function Rasterizer:hasGlyphs() end +function Rasterizer:hasGlyphs(...) end --- ---A Sound stores the data for a sound. @@ -469,9 +470,9 @@ function Sound:getFrameCount() end --- ---Reads frames from the Sound into a table, Blob, or another Sound. --- ----@overload fun(self: lovr.Sound, t: table, count: number, srcOffset: number, dstOffset: number):table, number ----@overload fun(self: lovr.Sound, blob: lovr.Blob, count: number, srcOffset: number, dstOffset: number):number ----@overload fun(self: lovr.Sound, sound: lovr.Sound, count: number, srcOffset: number, dstOffset: number):number +---@overload fun(self: lovr.Sound, t: table, count?: number, srcOffset?: number, dstOffset?: number):table, number +---@overload fun(self: lovr.Sound, blob: lovr.Blob, count?: number, srcOffset?: number, dstOffset?: number):number +---@overload fun(self: lovr.Sound, sound: lovr.Sound, count?: number, srcOffset?: number, dstOffset?: number):number ---@param count? number # The number of frames to read. If nil, reads as many frames as possible. Compressed sounds will automatically be decoded. @@ -523,8 +524,8 @@ function Sound:isStream() end --- ---Writes frames to the Sound. --- ----@overload fun(self: lovr.Sound, blob: lovr.Blob, count: number, dstOffset: number, srcOffset: number):number ----@overload fun(self: lovr.Sound, sound: lovr.Sound, count: number, dstOffset: number, srcOffset: number):number +---@overload fun(self: lovr.Sound, blob: lovr.Blob, count?: number, dstOffset?: number, srcOffset?: number):number +---@overload fun(self: lovr.Sound, sound: lovr.Sound, count?: number, dstOffset?: number, srcOffset?: number):number ---@param t table # A table containing frames to write. ---@param count? number # How many frames to write. If nil, writes as many as possible. ---@param dstOffset? number # A frame offset to apply when writing the frames. @@ -539,13 +540,13 @@ function Sound:setFrames(t, count, dstOffset, srcOffset) end --- ---1 channel. --- ----| '"mono"' +---| "mono" --- ---2 channels. --- ---The first channel is for the left speaker and the second is for the right. --- ----| '"stereo"' +---| "stereo" --- ---4 channels. --- @@ -553,7 +554,7 @@ function Sound:setFrames(t, count, dstOffset, srcOffset) end --- ---Currently, ambisonic sounds can only be loaded, not played. --- ----| '"ambisonic"' +---| "ambisonic" --- ---Sounds can store audio samples as 16 bit integers or 32 bit floats. @@ -562,8 +563,8 @@ function Sound:setFrames(t, count, dstOffset, srcOffset) end --- ---32 bit floating point samples (between -1.0 and 1.0). --- ----| '"f32"' +---| "f32" --- ---16 bit integer samples (between -32768 and 32767). --- ----| '"i16"' +---| "i16" diff --git a/meta/3rd/lovr/library/lovr.event.lua b/meta/3rd/lovr/library/lovr.event.lua index f2e9509d..a515c1ab 100644 --- a/meta/3rd/lovr/library/lovr.event.lua +++ b/meta/3rd/lovr/library/lovr.event.lua @@ -48,7 +48,8 @@ function lovr.event.pump() end ---Only nil, booleans, numbers, strings, and LÖVR objects are supported types for event data. --- ---@param name string # The name of the event. -function lovr.event.push(name) end +---@vararg any # The arguments for the event. Currently, up to 4 are supported. +function lovr.event.push(name, ...) end --- ---Pushes an event to quit. @@ -90,340 +91,340 @@ function lovr.event.restart() end --- ---The A key. --- ----| '"a"' +---| "a" --- ---The B key. --- ----| '"b"' +---| "b" --- ---The C key. --- ----| '"c"' +---| "c" --- ---The D key. --- ----| '"d"' +---| "d" --- ---The E key. --- ----| '"e"' +---| "e" --- ---The F key. --- ----| '"f"' +---| "f" --- ---The G key. --- ----| '"g"' +---| "g" --- ---The H key. --- ----| '"h"' +---| "h" --- ---The I key. --- ----| '"i"' +---| "i" --- ---The J key. --- ----| '"j"' +---| "j" --- ---The K key. --- ----| '"k"' +---| "k" --- ---The L key. --- ----| '"l"' +---| "l" --- ---The M key. --- ----| '"m"' +---| "m" --- ---The N key. --- ----| '"n"' +---| "n" --- ---The O key. --- ----| '"o"' +---| "o" --- ---The P key. --- ----| '"p"' +---| "p" --- ---The Q key. --- ----| '"q"' +---| "q" --- ---The R key. --- ----| '"r"' +---| "r" --- ---The S key. --- ----| '"s"' +---| "s" --- ---The T key. --- ----| '"t"' +---| "t" --- ---The U key. --- ----| '"u"' +---| "u" --- ---The V key. --- ----| '"v"' +---| "v" --- ---The W key. --- ----| '"w"' +---| "w" --- ---The X key. --- ----| '"x"' +---| "x" --- ---The Y key. --- ----| '"y"' +---| "y" --- ---The Z key. --- ----| '"z"' +---| "z" --- ---The 0 key. --- ----| '"0"' +---| "0" --- ---The 1 key. --- ----| '"1"' +---| "1" --- ---The 2 key. --- ----| '"2"' +---| "2" --- ---The 3 key. --- ----| '"3"' +---| "3" --- ---The 4 key. --- ----| '"4"' +---| "4" --- ---The 5 key. --- ----| '"5"' +---| "5" --- ---The 6 key. --- ----| '"6"' +---| "6" --- ---The 7 key. --- ----| '"7"' +---| "7" --- ---The 8 key. --- ----| '"8"' +---| "8" --- ---The 9 key. --- ----| '"9"' +---| "9" --- ---The space bar. --- ----| '"space"' +---| "space" --- ---The enter key. --- ----| '"return"' +---| "return" --- ---The tab key. --- ----| '"tab"' +---| "tab" --- ---The escape key. --- ----| '"escape"' +---| "escape" --- ---The backspace key. --- ----| '"backspace"' +---| "backspace" --- ---The up arrow key. --- ----| '"up"' +---| "up" --- ---The down arrow key. --- ----| '"down"' +---| "down" --- ---The left arrow key. --- ----| '"left"' +---| "left" --- ---The right arrow key. --- ----| '"right"' +---| "right" --- ---The home key. --- ----| '"home"' +---| "home" --- ---The end key. --- ----| '"end"' +---| "end" --- ---The page up key. --- ----| '"pageup"' +---| "pageup" --- ---The page down key. --- ----| '"pagedown"' +---| "pagedown" --- ---The insert key. --- ----| '"insert"' +---| "insert" --- ---The delete key. --- ----| '"delete"' +---| "delete" --- ---The F1 key. --- ----| '"f1"' +---| "f1" --- ---The F2 key. --- ----| '"f2"' +---| "f2" --- ---The F3 key. --- ----| '"f3"' +---| "f3" --- ---The F4 key. --- ----| '"f4"' +---| "f4" --- ---The F5 key. --- ----| '"f5"' +---| "f5" --- ---The F6 key. --- ----| '"f6"' +---| "f6" --- ---The F7 key. --- ----| '"f7"' +---| "f7" --- ---The F8 key. --- ----| '"f8"' +---| "f8" --- ---The F9 key. --- ----| '"f9"' +---| "f9" --- ---The F10 key. --- ----| '"f10"' +---| "f10" --- ---The F11 key. --- ----| '"f11"' +---| "f11" --- ---The F12 key. --- ----| '"f12"' +---| "f12" --- ---The backtick/backquote/grave accent key. --- ----| '"`"' +---| "`" --- ---The dash/hyphen/minus key. --- ----| '"-"' +---| "-" --- ---The equal sign key. --- ----| '"="' +---| "=" --- ---The left bracket key. --- ----| '"["' +---| "[" --- ---The right bracket key. --- ----| '"]"' +---| "]" --- ---The backslash key. --- ----| '"\\"' +---| "\\" --- ---The semicolon key. --- ----| '";"' +---| ";" --- ---The single quote key. --- ----| '"\'"' +---| "'" --- ---The comma key. --- ----| '","' +---| "," --- ---The period key. --- ----| '"."' +---| "." --- ---The slash key. --- ----| '"/"' +---| "/" --- ---The left control key. --- ----| '"lctrl"' +---| "lctrl" --- ---The left shift key. --- ----| '"lshift"' +---| "lshift" --- ---The left alt key. --- ----| '"lalt"' +---| "lalt" --- ---The left OS key (windows, command, super). --- ----| '"lgui"' +---| "lgui" --- ---The right control key. --- ----| '"rctrl"' +---| "rctrl" --- ---The right shift key. --- ----| '"rshift"' +---| "rshift" --- ---The right alt key. --- ----| '"ralt"' +---| "ralt" --- ---The right OS key (windows, command, super). --- ----| '"rgui"' +---| "rgui" --- ---The caps lock key. --- ----| '"capslock"' +---| "capslock" --- ---The scroll lock key. --- ----| '"scrolllock"' +---| "scrolllock" --- ---The numlock key. --- ----| '"numlock"' +---| "numlock" diff --git a/meta/3rd/lovr/library/lovr.graphics.lua b/meta/3rd/lovr/library/lovr.graphics.lua index 658bf2b3..88dd378b 100644 --- a/meta/3rd/lovr/library/lovr.graphics.lua +++ b/meta/3rd/lovr/library/lovr.graphics.lua @@ -15,13 +15,13 @@ lovr.graphics = {} ---### NOTE: ---The local normal vector of the circle is `(0, 0, 1)`. --- ----@overload fun(material: lovr.Material, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number, start: number, end: number, segments: number) ----@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4, start: number, end: number, segments: number) ----@overload fun(material: lovr.Material, transform: lovr.mat4, start: number, end: number, segments: number) ----@overload fun(mode: lovr.DrawStyle, arcmode: lovr.ArcMode, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number, start: number, end: number, segments: number) ----@overload fun(material: lovr.Material, arcmode: lovr.ArcMode, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number, start: number, end: number, segments: number) ----@overload fun(mode: lovr.DrawStyle, arcmode: lovr.ArcMode, transform: lovr.mat4, start: number, end: number, segments: number) ----@overload fun(material: lovr.Material, arcmode: lovr.ArcMode, transform: lovr.mat4, start: number, end: number, segments: number) +---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number, start?: number, end?: number, segments?: number) +---@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4, start?: number, end?: number, segments?: number) +---@overload fun(material: lovr.Material, transform: lovr.mat4, start?: number, end?: number, segments?: number) +---@overload fun(mode: lovr.DrawStyle, arcmode?: lovr.ArcMode, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number, start?: number, end?: number, segments?: number) +---@overload fun(material: lovr.Material, arcmode?: lovr.ArcMode, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number, start?: number, end?: number, segments?: number) +---@overload fun(mode: lovr.DrawStyle, arcmode?: lovr.ArcMode, transform: lovr.mat4, start?: number, end?: number, segments?: number) +---@overload fun(material: lovr.Material, arcmode?: lovr.ArcMode, transform: lovr.mat4, start?: number, end?: number, segments?: number) ---@param mode lovr.DrawStyle # Whether the arc is filled or outlined. ---@param x? number # The x coordinate of the center of the arc. ---@param y? number # The y coordinate of the center of the arc. @@ -41,7 +41,7 @@ function lovr.graphics.arc(mode, x, y, z, radius, angle, ax, ay, az, start, end, --- ---This is similar to `lovr.graphics.cube` except you can have different values for the width, height, and depth of the box. --- ----@overload fun(material: lovr.Material, x: number, y: number, z: number, width: number, height: number, depth: number, angle: number, ax: number, ay: number, az: number) +---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, width?: number, height?: number, depth?: number, angle?: number, ax?: number, ay?: number, az?: number) ---@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4) ---@overload fun(material: lovr.Material, transform: lovr.mat4) ---@param mode lovr.DrawStyle # How to draw the box. @@ -64,9 +64,9 @@ function lovr.graphics.box(mode, x, y, z, width, height, depth, angle, ax, ay, a ---### NOTE: ---The local normal vector of the circle is `(0, 0, 1)`. --- ----@overload fun(material: lovr.Material, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number, segments: number) ----@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4, segments: number) ----@overload fun(material: lovr.Material, transform: lovr.mat4, segments: number) +---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number, segments?: number) +---@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4, segments?: number) +---@overload fun(material: lovr.Material, transform: lovr.mat4, segments?: number) ---@param mode lovr.DrawStyle # Whether the circle is filled or outlined. ---@param x? number # The x coordinate of the center of the circle. ---@param y? number # The y coordinate of the center of the circle. @@ -90,7 +90,7 @@ function lovr.graphics.circle(mode, x, y, z, radius, angle, ax, ay, az, segments --- ---If you are using `lovr.graphics.setStencilTest`, it will not affect how the screen gets cleared. Instead, you can use `lovr.graphics.fill` to draw a fullscreen quad, which will get masked by the active stencil. --- ----@overload fun(r: number, g: number, b: number, a: number, z: number, s: number) +---@overload fun(r: number, g: number, b: number, a: number, z?: number, s?: number) ---@overload fun(hex: number) ---@param color? boolean # Whether or not to clear color information on the screen. ---@param depth? boolean # Whether or not to clear the depth information on the screen. @@ -135,7 +135,7 @@ function lovr.graphics.createWindow(flags) end --- ---Draws a cube. --- ----@overload fun(material: lovr.Material, x: number, y: number, z: number, size: number, angle: number, ax: number, ay: number, az: number) +---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, size?: number, angle?: number, ax?: number, ay?: number, az?: number) ---@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4) ---@overload fun(material: lovr.Material, transform: lovr.mat4) ---@param mode lovr.DrawStyle # How to draw the cube. @@ -156,7 +156,7 @@ function lovr.graphics.cube(mode, x, y, z, size, angle, ax, ay, az) end ---### NOTE: ---Currently, cylinders don't have UVs. --- ----@overload fun(material: lovr.Material, x: number, y: number, z: number, length: number, angle: number, ax: number, ay: number, az: number, r1: number, r2: number, capped: boolean, segments: number) +---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, length?: number, angle?: number, ax?: number, ay?: number, az?: number, r1?: number, r2?: number, capped?: boolean, segments?: number) ---@param x? number # The x coordinate of the center of the cylinder. ---@param y? number # The y coordinate of the center of the cylinder. ---@param z? number # The z coordinate of the center of the cylinder. @@ -533,7 +533,8 @@ function lovr.graphics.isWireframe() end ---@param x2 number # The x coordinate of the second point. ---@param y2 number # The y coordinate of the second point. ---@param z2 number # The z coordinate of the second point. -function lovr.graphics.line(x1, y1, z1, x2, y2, z2) end +---@vararg number # More points. +function lovr.graphics.line(x1, y1, z1, x2, y2, z2, ...) end --- ---Creates a new Canvas. @@ -548,8 +549,8 @@ function lovr.graphics.line(x1, y1, z1, x2, y2, z2) end --- ---Stereo Canvases will either have their width doubled or use array textures for their attachments, depending on their implementation. --- ----@overload fun(..., flags: table):lovr.Canvas ----@overload fun(attachments: table, flags: table):lovr.Canvas +---@overload fun(..., flags?: table):lovr.Canvas +---@overload fun(attachments: table, flags?: table):lovr.Canvas ---@param width number # The width of the canvas, in pixels. ---@param height number # The height of the canvas, in pixels. ---@param flags? {format: lovr.TextureFormat, depth: lovr.TextureFormat, stereo: boolean, msaa: number, mipmaps: boolean} # Optional settings for the Canvas. @@ -585,8 +586,8 @@ function lovr.graphics.newComputeShader(source, options) end ---### NOTE: ---Larger font sizes will lead to more detailed curves at the cost of performance. --- ----@overload fun(size: number, padding: number, spread: number):lovr.Font ----@overload fun(rasterizer: lovr.Rasterizer, padding: number, spread: number):lovr.Font +---@overload fun(size?: number, padding?: number, spread?: number):lovr.Font +---@overload fun(rasterizer: lovr.Rasterizer, padding?: number, spread?: number):lovr.Font ---@param filename string # The filename of the font file. ---@param size? number # The size of the font, in pixels. ---@param padding? number # The number of pixels of padding around each glyph. @@ -608,10 +609,10 @@ function lovr.graphics.newFont(filename, size, padding, spread) end --- default to `(0.0, 0.0, 0.0, 0.0)`. ---- Textures will default to `nil` (a single 1x1 white pixel will be used for them). --- ----@overload fun(texture: lovr.Texture, r: number, g: number, b: number, a: number):lovr.Material ----@overload fun(canvas: lovr.Canvas, r: number, g: number, b: number, a: number):lovr.Material ----@overload fun(r: number, g: number, b: number, a: number):lovr.Material ----@overload fun(hex: number, a: number):lovr.Material +---@overload fun(texture: lovr.Texture, r?: number, g?: number, b?: number, a?: number):lovr.Material +---@overload fun(canvas: lovr.Canvas, r?: number, g?: number, b?: number, a?: number):lovr.Material +---@overload fun(r?: number, g?: number, b?: number, a?: number):lovr.Material +---@overload fun(hex?: number, a?: number):lovr.Material ---@return lovr.Material material # The new Material. function lovr.graphics.newMaterial() end @@ -638,11 +639,11 @@ function lovr.graphics.newMaterial() end --- { 'lovrTexCoord', 'float', 2 } --- } --- ----@overload fun(vertices: table, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh ----@overload fun(blob: lovr.Blob, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh ----@overload fun(format: table, size: number, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh ----@overload fun(format: table, vertices: table, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh ----@overload fun(format: table, blob: lovr.Blob, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh +---@overload fun(vertices: table, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh +---@overload fun(blob: lovr.Blob, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh +---@overload fun(format: table, size: number, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh +---@overload fun(format: table, vertices: table, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh +---@overload fun(format: table, blob: lovr.Blob, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh ---@param size number # The maximum number of vertices the Mesh can store. ---@param mode? lovr.DrawMode # How the Mesh will connect its vertices into triangles. ---@param usage? lovr.MeshUsage # An optimization hint indicating how often the data in the Mesh will be updated. @@ -758,7 +759,7 @@ function lovr.graphics.newModel(filename) end --- ---Currently on Android, only stereo shaders can be used with stereo Canvases, and mono Shaders can only be used with mono Canvases. --- ----@overload fun(default: lovr.DefaultShader, options: table):lovr.Shader +---@overload fun(default: lovr.DefaultShader, options?: table):lovr.Shader ---@param vertex string # The code or filename of the vertex shader. If nil, the default vertex shader is used. ---@param fragment string # The code or filename of the fragment shader. If nil, the default fragment shader is used. ---@param options? {flags: table, stereo: boolean} # Optional settings for the Shader. @@ -791,10 +792,10 @@ function lovr.graphics.newShaderBlock(type, uniforms, flags) end --- ---Right now the supported image file formats are png, jpg, hdr, dds (DXT1, DXT3, DXT5), ktx, and astc. --- ----@overload fun(images: table, flags: table):lovr.Texture ----@overload fun(width: number, height: number, depth: number, flags: table):lovr.Texture ----@overload fun(blob: lovr.Blob, flags: table):lovr.Texture ----@overload fun(image: lovr.Image, flags: table):lovr.Texture +---@overload fun(images: table, flags?: table):lovr.Texture +---@overload fun(width: number, height: number, depth: number, flags?: table):lovr.Texture +---@overload fun(blob: lovr.Blob, flags?: table):lovr.Texture +---@overload fun(image: lovr.Image, flags?: table):lovr.Texture ---@param filename string # The filename of the image to load. ---@param flags? {linear: boolean, mipmaps: boolean, type: lovr.TextureType, format: lovr.TextureFormat, msaa: number} # Optional settings for the texture. ---@return lovr.Texture texture # The new Texture. @@ -818,7 +819,7 @@ function lovr.graphics.origin() end --- ---One efficient technique for rendering many planes with different textures is to pack all of the textures into a single image, and then use the uv arguments to select a sub-rectangle to use for each plane. --- ----@overload fun(material: lovr.Material, x: number, y: number, z: number, width: number, height: number, angle: number, ax: number, ay: number, az: number, u: number, v: number, w: number, h: number) +---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, width?: number, height?: number, angle?: number, ax?: number, ay?: number, az?: number, u?: number, v?: number, w?: number, h?: number) ---@param mode lovr.DrawStyle # How to draw the plane. ---@param x? number # The x coordinate of the center of the plane. ---@param y? number # The y coordinate of the center of the plane. @@ -842,7 +843,8 @@ function lovr.graphics.plane(mode, x, y, z, width, height, angle, ax, ay, az, u, ---@param x number # The x coordinate of the point. ---@param y number # The y coordinate of the point. ---@param z number # The z coordinate of the point. -function lovr.graphics.points(x, y, z) end +---@vararg number # More points. +function lovr.graphics.points(x, y, z, ...) end --- ---Pops the current transform from the stack, returning to the transformation that was applied before `lovr.graphics.push` was called. @@ -970,7 +972,7 @@ function lovr.graphics.setAlphaSampling(enabled) end ---### NOTE: ---The default background color is `(0.0, 0.0, 0.0, 1.0)`. --- ----@overload fun(hex: number, a: number) +---@overload fun(hex: number, a?: number) ---@overload fun(color: table) ---@param r number # The red component of the background color. ---@param g number # The green component of the background color. @@ -1013,7 +1015,7 @@ function lovr.graphics.setCanvas(canvas) end ---### NOTE: ---The default color is `(1.0, 1.0, 1.0, 1.0)`. --- ----@overload fun(hex: number, a: number) +---@overload fun(hex: number, a?: number) ---@overload fun(color: table) ---@param r number # The red component of the color. ---@param g number # The green component of the color. @@ -1259,7 +1261,7 @@ function lovr.graphics.skybox(texture) end --- ---Draws a sphere. --- ----@overload fun(material: lovr.Material, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number) +---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number) ---@param x? number # The x coordinate of the center of the sphere. ---@param y? number # The y coordinate of the center of the sphere. ---@param z? number # The z coordinate of the center of the sphere. @@ -1277,7 +1279,7 @@ function lovr.graphics.sphere(x, y, z, radius, angle, ax, ay, az) end ---### NOTE: ---Stencil values are between 0 and 255. --- ----@overload fun(callback: function, action: lovr.StencilAction, value: number, initial: number) +---@overload fun(callback: function, action?: lovr.StencilAction, value?: number, initial?: number) ---@param callback function # The function that will be called to render to the stencil buffer. ---@param action? lovr.StencilAction # How to modify the stencil value of pixels that are rendered to. ---@param value? number # If `action` is "replace", this is the value that pixels are replaced with. @@ -1474,7 +1476,8 @@ function Canvas:newImage(index) end ---If you plan on modifying the transform stack inside your callback it may be a good idea to use `lovr.graphics.push` and `lovr.graphics.pop` so you can revert to the previous transform afterwards. --- ---@param callback function # The function to use to render to the Canvas. -function Canvas:renderTo(callback) end +---@vararg any # Additional arguments to pass to the callback. +function Canvas:renderTo(callback, ...) end --- ---Attaches one or more Textures to the Canvas. @@ -1494,7 +1497,8 @@ function Canvas:renderTo(callback) end --- ---You can also optionally wrap them in a table. --- -function Canvas:setTexture() end +---@vararg any # One or more Textures to attach to the Canvas. +function Canvas:setTexture(...) end --- ---A Font is an object created from a TTF file. @@ -1592,8 +1596,9 @@ function Font:getWidth(text, wrap) end ---### NOTE: ---It is a good idea to use this function when you're rendering an unknown or user-supplied string to avoid utterly embarrassing crashes. --- +---@vararg any # Strings or numbers to test. ---@return boolean has # Whether the Font has the glyphs. -function Font:hasGlyphs() end +function Font:hasGlyphs(...) end --- ---Sets the line height of the Font, which controls how far lines apart lines are vertically separated. @@ -1677,9 +1682,9 @@ function Material:getTransform() end --- ---Colors default to `(1.0, 1.0, 1.0, 1.0)` and are gamma corrected. --- ----@overload fun(self: lovr.Material, r: number, g: number, b: number, a: number) ----@overload fun(self: lovr.Material, colorType: lovr.MaterialColor, hex: number, a: number) ----@overload fun(self: lovr.Material, hex: number, a: number) +---@overload fun(self: lovr.Material, r: number, g: number, b: number, a?: number) +---@overload fun(self: lovr.Material, colorType?: lovr.MaterialColor, hex: number, a?: number) +---@overload fun(self: lovr.Material, hex: number, a?: number) ---@param colorType? lovr.MaterialColor # The type of color to set. ---@param r number # The red component of the color. ---@param g number # The green component of the color. @@ -1811,8 +1816,8 @@ local Mesh = {} --- ---To prevent cycles, it is not possible to attach attributes onto a Mesh that already has attributes attached to a different Mesh. --- ----@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, divisor: number, ...) ----@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, divisor: number, attributes: table) +---@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, divisor?: number, ...) +---@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, divisor?: number, attributes: table) ---@param mesh lovr.Mesh # The Mesh to attach attributes from. ---@param divisor? number # The attribute divisor for all attached attributes. function Mesh:attachAttributes(mesh, divisor) end @@ -1828,7 +1833,7 @@ function Mesh:detachAttributes(mesh) end --- ---Draws the contents of the Mesh. --- ----@overload fun(self: lovr.Mesh, transform: lovr.mat4, instances: number) +---@overload fun(self: lovr.Mesh, transform: lovr.mat4, instances?: number) ---@param x? number # The x coordinate to draw the Mesh at. ---@param y? number # The y coordinate to draw the Mesh at. ---@param z? number # The z coordinate to draw the Mesh at. @@ -1962,7 +1967,8 @@ function Mesh:setMaterial(material) end ---Any unspecified components will be set to 0. --- ---@param index number # The index of the vertex to set. -function Mesh:setVertex(index) end +---@vararg number # The attributes of the vertex. +function Mesh:setVertex(index, ...) end --- ---Set the components of a specific attribute of a vertex in the Mesh. @@ -1973,7 +1979,8 @@ function Mesh:setVertex(index) end --- ---@param index number # The index of the vertex to update. ---@param attribute number # The index of the attribute to update. -function Mesh:setVertexAttribute(index, attribute) end +---@vararg number # The new components for the attribute. +function Mesh:setVertexAttribute(index, attribute, ...) end --- ---Sets the vertex map. @@ -1982,7 +1989,7 @@ function Mesh:setVertexAttribute(index, attribute) end --- ---Often, a vertex map is used to improve performance, since it usually requires less data to specify the index of a vertex than it does to specify all of the data for a vertex. --- ----@overload fun(self: lovr.Mesh, blob: lovr.Blob, size: number) +---@overload fun(self: lovr.Mesh, blob: lovr.Blob, size?: number) ---@param map table # The new vertex map. Each element of the table is an index of a vertex. function Mesh:setVertexMap(map) end @@ -1993,7 +2000,7 @@ function Mesh:setVertexMap(map) end ---### NOTE: ---The start index plus the number of vertices in the table should not exceed the maximum size of the Mesh. --- ----@overload fun(self: lovr.Mesh, blob: lovr.Blob, start: number, count: number) +---@overload fun(self: lovr.Mesh, blob: lovr.Blob, start?: number, count?: number) ---@param vertices table # The new set of vertices. ---@param start? number # The index of the vertex to start replacing at. ---@param count? number # The number of vertices to replace. If nil, all vertices will be used. @@ -2022,7 +2029,7 @@ local Model = {} --- ---To clear the pose of a Model to the default, use `Model:pose(nil)`. --- ----@overload fun(self: lovr.Model, index: number, time: number, alpha: number) +---@overload fun(self: lovr.Model, index: number, time: number, alpha?: number) ---@param name string # The name of an animation. ---@param time number # The timestamp to evaluate the keyframes at, in seconds. ---@param alpha? number # How much of the animation to mix in, from 0 to 1. @@ -2031,7 +2038,7 @@ function Model:animate(name, time, alpha) end --- ---Draw the Model. --- ----@overload fun(self: lovr.Model, transform: lovr.mat4, instances: number) +---@overload fun(self: lovr.Model, transform: lovr.mat4, instances?: number) ---@param x? number # The x coordinate to draw the Model at. ---@param y? number # The y coordinate to draw the Model at. ---@param z? number # The z coordinate to draw the Model at. @@ -2120,7 +2127,7 @@ function Model:getNodeName(index) end --- ---See `lovr.graphics.newShader` for more. --- ----@overload fun(self: lovr.Model, index: number, space: lovr.CoordinateSpace):number, number, number, number, number, number, number +---@overload fun(self: lovr.Model, index: number, space?: lovr.CoordinateSpace):number, number, number, number, number, number, number ---@param name string # The name of the node. ---@param space? lovr.CoordinateSpace # Whether the pose should be returned relative to the node's parent or relative to the root node of the Model. ---@return number x # The x position of the node. @@ -2174,7 +2181,7 @@ function Model:hasJoints() end --- ---See `lovr.graphics.newShader` for more. --- ----@overload fun(self: lovr.Model, index: number, x: number, y: number, z: number, angle: number, ax: number, ay: number, az: number, alpha: number) +---@overload fun(self: lovr.Model, index: number, x: number, y: number, z: number, angle: number, ax: number, ay: number, az: number, alpha?: number) ---@overload fun(self: lovr.Model) ---@param name string # The name of the node. ---@param x number # The x position. @@ -2436,7 +2443,7 @@ function Shader:sendBlock(name, block, access) end --- ---The normal `Shader:send` function accepts Textures and should be used most of the time. --- ----@overload fun(self: lovr.Shader, name: string, index: number, texture: lovr.Texture, slice: number, mipmap: number, access: lovr.UniformAccess) +---@overload fun(self: lovr.Shader, name: string, index: number, texture: lovr.Texture, slice?: number, mipmap?: number, access?: lovr.UniformAccess) ---@param name string # The name of the image uniform. ---@param texture lovr.Texture # The Texture to assign. ---@param slice? number # The slice of a cube, array, or volume texture to use, or `nil` for all slices. @@ -2533,7 +2540,7 @@ function ShaderBlock:read(name) end --- ---`Blob`s can also be used to pass arbitrary binary data to individual variables. --- ----@overload fun(self: lovr.ShaderBlock, blob: lovr.Blob, srcOffset: number, dstOffset: number, extent: number):number +---@overload fun(self: lovr.ShaderBlock, blob: lovr.Blob, srcOffset?: number, dstOffset?: number, extent?: number):number ---@param variable string # The name of the variable to update. ---@param value any # The new value of the uniform. function ShaderBlock:send(variable, value) end @@ -2673,15 +2680,15 @@ function Texture:setWrap(horizontal, vertical) end --- ---The arc is drawn with the center of its circle included in the list of points (default). --- ----| '"pie"' +---| "pie" --- ---The curve of the arc is drawn as a single line. --- ----| '"open"' +---| "open" --- ---The starting and ending points of the arc's curve are connected. --- ----| '"closed"' +---| "closed" --- ---Here are the different data types available for vertex attributes in a Mesh. @@ -2694,31 +2701,31 @@ function Texture:setWrap(horizontal, vertical) end --- ---A signed 8 bit number, from -128 to 127. --- ----| '"byte"' +---| "byte" --- ---An unsigned 8 bit number, from 0 to 255. --- ----| '"ubyte"' +---| "ubyte" --- ---A signed 16 bit number, from -32768 to 32767. --- ----| '"short"' +---| "short" --- ---An unsigned 16 bit number, from 0 to 65535. --- ----| '"ushort"' +---| "ushort" --- ---A signed 32 bit number, from -2147483648 to 2147483647. --- ----| '"int"' +---| "int" --- ---An unsigned 32 bit number, from 0 to 4294967295. --- ----| '"uint"' +---| "uint" --- ---A 32 bit floating-point number (large range, but can start to lose precision). --- ----| '"float"' +---| "float" --- ---Different ways the alpha channel of pixels affects blending. @@ -2733,13 +2740,13 @@ function Texture:setWrap(horizontal, vertical) end --- ---Color channel values are multiplied by the alpha channel during blending. --- ----| '"alphamultiply"' +---| "alphamultiply" --- ---Color channels are not multiplied by the alpha channel. --- ---This should be used if the pixels being drawn have already been blended, or "pre-multiplied", by the alpha channel. --- ----| '"premultiplied"' +---| "premultiplied" --- ---Blend modes control how overlapping pixels are blended together, similar to layers in Photoshop. @@ -2748,31 +2755,31 @@ function Texture:setWrap(horizontal, vertical) end --- ---Normal blending where the alpha value controls how the colors are blended. --- ----| '"alpha"' +---| "alpha" --- ---The incoming pixel color is added to the destination pixel color. --- ----| '"add"' +---| "add" --- ---The incoming pixel color is subtracted from the destination pixel color. --- ----| '"subtract"' +---| "subtract" --- ---The color channels from the two pixel values are multiplied together to produce a result. --- ----| '"multiply"' +---| "multiply" --- ---The maximum value from each color channel is used, resulting in a lightening effect. --- ----| '"lighten"' +---| "lighten" --- ---The minimum value from each color channel is used, resulting in a darkening effect. --- ----| '"darken"' +---| "darken" --- ---The opposite of multiply: The pixel values are inverted, multiplied, and inverted again, resulting in a lightening effect. --- ----| '"screen"' +---| "screen" --- ---There are two types of ShaderBlocks that can be used: `uniform` and `compute`. @@ -2785,11 +2792,11 @@ function Texture:setWrap(horizontal, vertical) end --- ---A uniform block. --- ----| '"uniform"' +---| "uniform" --- ---A compute block. --- ----| '"compute"' +---| "compute" --- ---This acts as a hint to the graphics driver about what kinds of data access should be optimized for. @@ -2798,15 +2805,15 @@ function Texture:setWrap(horizontal, vertical) end --- ---A buffer that you intend to create once and never modify. --- ----| '"static"' +---| "static" --- ---A buffer which is modified occasionally. --- ----| '"dynamic"' +---| "dynamic" --- ---A buffer which is entirely replaced on the order of every frame. --- ----| '"stream"' +---| "stream" --- ---The method used to compare z values when deciding how to overlap rendered objects. @@ -2821,27 +2828,27 @@ function Texture:setWrap(horizontal, vertical) end --- ---The depth test passes when the depth values are equal. --- ----| '"equal"' +---| "equal" --- ---The depth test passes when the depth values are not equal. --- ----| '"notequal"' +---| "notequal" --- ---The depth test passes when the new depth value is less than the existing one. --- ----| '"less"' +---| "less" --- ---The depth test passes when the new depth value is less than or equal to the existing one. --- ----| '"lequal"' +---| "lequal" --- ---The depth test passes when the new depth value is greater than or equal to the existing one. --- ----| '"gequal"' +---| "gequal" --- ---The depth test passes when the new depth value is greater than the existing one. --- ----| '"greater"' +---| "greater" --- ---Different coordinate spaces for nodes in a Model. @@ -2850,11 +2857,11 @@ function Texture:setWrap(horizontal, vertical) end --- ---The coordinate space relative to the node's parent. --- ----| '"local"' +---| "local" --- ---The coordinate space relative to the root node of the Model. --- ----| '"global"' +---| "global" --- ---The following shaders are built in to LÖVR, and can be used as an argument to `lovr.graphics.newShader` instead of providing raw GLSL shader code. @@ -2867,27 +2874,27 @@ function Texture:setWrap(horizontal, vertical) end --- ---A simple shader without lighting, using only colors and a diffuse texture. --- ----| '"unlit"' +---| "unlit" --- ---A physically-based rendering (PBR) shader, using advanced material properties. --- ----| '"standard"' +---| "standard" --- ---A shader that renders a cubemap texture. --- ----| '"cube"' +---| "cube" --- ---A shader that renders a 2D equirectangular texture with spherical coordinates. --- ----| '"pano"' +---| "pano" --- ---A shader that renders font glyphs. --- ----| '"font"' +---| "font" --- ---A shader that passes its vertex coordinates unmodified to the fragment shader, used to render view-independent fixed geometry like fullscreen quads. --- ----| '"fill"' +---| "fill" --- ---Meshes are lists of arbitrary vertices. @@ -2898,35 +2905,35 @@ function Texture:setWrap(horizontal, vertical) end --- ---Draw each vertex as a single point. --- ----| '"points"' +---| "points" --- ---The vertices represent a list of line segments. Each pair of vertices will have a line drawn between them. --- ----| '"lines"' +---| "lines" --- ---The first two vertices have a line drawn between them, and each vertex after that will be connected to the previous vertex with a line. --- ----| '"linestrip"' +---| "linestrip" --- ---Similar to linestrip, except the last vertex is connected back to the first. --- ----| '"lineloop"' +---| "lineloop" --- ---The first three vertices define a triangle. --- ---Each vertex after that creates a triangle using the new vertex and last two vertices. --- ----| '"strip"' +---| "strip" --- ---Each set of three vertices represents a discrete triangle. --- ----| '"triangles"' +---| "triangles" --- ---Draws a set of triangles. --- ---Each one shares the first vertex as a common point, leading to a fan-like shape. --- ----| '"fan"' +---| "fan" --- ---Most graphics primitives can be drawn in one of two modes: a filled mode and a wireframe mode. @@ -2935,11 +2942,11 @@ function Texture:setWrap(horizontal, vertical) end --- ---The shape is drawn as a filled object. --- ----| '"fill"' +---| "fill" --- ---The shape is drawn as a wireframe object. --- ----| '"line"' +---| "line" --- ---The method used to downsample (or upsample) a texture. @@ -2954,15 +2961,15 @@ function Texture:setWrap(horizontal, vertical) end --- ---Leads to a pixelated style. --- ----| '"nearest"' +---| "nearest" --- ---Smooth pixel sampling. --- ----| '"bilinear"' +---| "bilinear" --- ---Smooth pixel sampling, with smooth sampling across mipmap levels. --- ----| '"trilinear"' +---| "trilinear" --- ---Different ways to horizontally align text when using `lovr.graphics.print`. @@ -2971,15 +2978,15 @@ function Texture:setWrap(horizontal, vertical) end --- ---Left aligned lines of text. --- ----| '"left"' +---| "left" --- ---Centered aligned lines of text. --- ----| '"center"' +---| "center" --- ---Right aligned lines of text. --- ----| '"right"' +---| "right" --- ---The different types of color parameters `Material`s can hold. @@ -2988,11 +2995,11 @@ function Texture:setWrap(horizontal, vertical) end --- ---The diffuse color. --- ----| '"diffuse"' +---| "diffuse" --- ---The emissive color. --- ----| '"emissive"' +---| "emissive" --- ---The different types of float parameters `Material`s can hold. @@ -3001,11 +3008,11 @@ function Texture:setWrap(horizontal, vertical) end --- ---The constant metalness factor. --- ----| '"metalness"' +---| "metalness" --- ---The constant roughness factor. --- ----| '"roughness"' +---| "roughness" --- ---The different types of texture parameters `Material`s can hold. @@ -3014,31 +3021,31 @@ function Texture:setWrap(horizontal, vertical) end --- ---The diffuse texture. --- ----| '"diffuse"' +---| "diffuse" --- ---The emissive texture. --- ----| '"emissive"' +---| "emissive" --- ---The metalness texture. --- ----| '"metalness"' +---| "metalness" --- ---The roughness texture. --- ----| '"roughness"' +---| "roughness" --- ---The ambient occlusion texture. --- ----| '"occlusion"' +---| "occlusion" --- ---The normal map. --- ----| '"normal"' +---| "normal" --- ---The environment map, should be specified as a cubemap texture. --- ----| '"environment"' +---| "environment" --- ---Meshes can have a usage hint, describing how they are planning on being updated. @@ -3049,15 +3056,15 @@ function Texture:setWrap(horizontal, vertical) end --- ---The Mesh contents will rarely change. --- ----| '"static"' +---| "static" --- ---The Mesh contents will change often. --- ----| '"dynamic"' +---| "dynamic" --- ---The Mesh contents will change constantly, potentially multiple times each frame. --- ----| '"stream"' +---| "stream" --- ---Shaders can be used for either rendering operations or generic compute tasks. @@ -3070,11 +3077,11 @@ function Texture:setWrap(horizontal, vertical) end --- ---A graphics shader. --- ----| '"graphics"' +---| "graphics" --- ---A compute shader. --- ----| '"compute"' +---| "compute" --- ---How to modify pixels in the stencil buffer when using `lovr.graphics.stencil`. @@ -3083,27 +3090,27 @@ function Texture:setWrap(horizontal, vertical) end --- ---Stencil values will be replaced with a custom value. --- ----| '"replace"' +---| "replace" --- ---Stencil values will increment every time they are rendered to. --- ----| '"increment"' +---| "increment" --- ---Stencil values will decrement every time they are rendered to. --- ----| '"decrement"' +---| "decrement" --- ---Similar to `increment`, but the stencil value will be set to 0 if it exceeds 255. --- ----| '"incrementwrap"' +---| "incrementwrap" --- ---Similar to `decrement`, but the stencil value will be set to 255 if it drops below 0. --- ----| '"decrementwrap"' +---| "decrementwrap" --- ---Stencil values will be bitwise inverted every time they are rendered to. --- ----| '"invert"' +---| "invert" --- ---Textures can store their pixels in different formats. @@ -3114,63 +3121,63 @@ function Texture:setWrap(horizontal, vertical) end --- ---Each pixel is 24 bits, or 8 bits for each channel. --- ----| '"rgb"' +---| "rgb" --- ---Each pixel is 32 bits, or 8 bits for each channel (including alpha). --- ----| '"rgba"' +---| "rgba" --- ---An rgba format where the colors occupy 4 bits instead of the usual 8. --- ----| '"rgba4"' +---| "rgba4" --- ---Each pixel is 64 bits. Each channel is a 16 bit floating point number. --- ----| '"rgba16f"' +---| "rgba16f" --- ---Each pixel is 128 bits. Each channel is a 32 bit floating point number. --- ----| '"rgba32f"' +---| "rgba32f" --- ---A 16-bit floating point format with a single color channel. --- ----| '"r16f"' +---| "r16f" --- ---A 32-bit floating point format with a single color channel. --- ----| '"r32f"' +---| "r32f" --- ---A 16-bit floating point format with two color channels. --- ----| '"rg16f"' +---| "rg16f" --- ---A 32-bit floating point format with two color channels. --- ----| '"rg32f"' +---| "rg32f" --- ---A 16 bit format with 5-bit color channels and a single alpha bit. --- ----| '"rgb5a1"' +---| "rgb5a1" --- ---A 32 bit format with 10-bit color channels and two alpha bits. --- ----| '"rgb10a2"' +---| "rgb10a2" --- ---Each pixel is 32 bits, and packs three color channels into 10 or 11 bits each. --- ----| '"rg11b10f"' +---| "rg11b10f" --- ---A 16 bit depth buffer. --- ----| '"d16"' +---| "d16" --- ---A 32 bit floating point depth buffer. --- ----| '"d32f"' +---| "d32f" --- ---A depth buffer with 24 bits for depth and 8 bits for stencil. --- ----| '"d24s8"' +---| "d24s8" --- ---Different types of Textures. @@ -3179,19 +3186,19 @@ function Texture:setWrap(horizontal, vertical) end --- ---A 2D texture. --- ----| '"2d"' +---| "2d" --- ---A 2D array texture with multiple independent 2D layers. --- ----| '"array"' +---| "array" --- ---A cubemap texture with 6 2D faces. --- ----| '"cube"' +---| "cube" --- ---A 3D volumetric texture consisting of multiple 2D layers. --- ----| '"volume"' +---| "volume" --- ---When binding writable resources to shaders using `Shader:sendBlock` and `Shader:sendImage`, an access pattern can be specified as a hint that says whether you plan to read or write to the resource (or both). @@ -3202,15 +3209,15 @@ function Texture:setWrap(horizontal, vertical) end --- ---The Shader will use the resource in a read-only fashion. --- ----| '"read"' +---| "read" --- ---The Shader will use the resource in a write-only fashion. --- ----| '"write"' +---| "write" --- ---The resource will be available for reading and writing. --- ----| '"readwrite"' +---| "readwrite" --- ---Different ways to vertically align text when using `lovr.graphics.print`. @@ -3219,15 +3226,15 @@ function Texture:setWrap(horizontal, vertical) end --- ---Align the top of the text to the origin. --- ----| '"top"' +---| "top" --- ---Vertically center the text. --- ----| '"middle"' +---| "middle" --- ---Align the bottom of the text to the origin. --- ----| '"bottom"' +---| "bottom" --- ---Whether the points on triangles are specified in a clockwise or counterclockwise order. @@ -3236,11 +3243,11 @@ function Texture:setWrap(horizontal, vertical) end --- ---Triangle vertices are specified in a clockwise order. --- ----| '"clockwise"' +---| "clockwise" --- ---Triangle vertices are specified in a counterclockwise order. --- ----| '"counterclockwise"' +---| "counterclockwise" --- ---The method used to render textures when texture coordinates are outside of the 0-1 range. @@ -3249,12 +3256,12 @@ function Texture:setWrap(horizontal, vertical) end --- ---The texture will be clamped at its edges. --- ----| '"clamp"' +---| "clamp" --- ---The texture repeats. --- ----| '"repeat"' +---| "repeat" --- ---The texture will repeat, mirroring its appearance each time it repeats. --- ----| '"mirroredrepeat"' +---| "mirroredrepeat" diff --git a/meta/3rd/lovr/library/lovr.headset.lua b/meta/3rd/lovr/library/lovr.headset.lua index 0b70a3ba..419a8180 100644 --- a/meta/3rd/lovr/library/lovr.headset.lua +++ b/meta/3rd/lovr/library/lovr.headset.lua @@ -86,7 +86,7 @@ function lovr.headset.getBoundsDimensions() end --- ---Returns a list of points representing the boundaries of the play area, or `nil` if the current headset driver does not expose this information. --- ----@param t? table # A table to fill with the points. If `nil`, a new table will be created. +---@param t table # A table to fill with the points. If `nil`, a new table will be created. ---@return table points # A flat table of 3D points representing the play area boundaries. function lovr.headset.getBoundsGeometry(t) end @@ -627,95 +627,95 @@ function lovr.headset.wasReleased(device, button) end --- ---The headset. --- ----| '"head"' +---| "head" --- ---The left controller. --- ----| '"hand/left"' +---| "hand/left" --- ---The right controller. --- ----| '"hand/right"' +---| "hand/right" --- ---A shorthand for hand/left. --- ----| '"left"' +---| "left" --- ---A shorthand for hand/right. --- ----| '"right"' +---| "right" --- ---A device tracking the left elbow. --- ----| '"elbow/left"' +---| "elbow/left" --- ---A device tracking the right elbow. --- ----| '"elbow/right"' +---| "elbow/right" --- ---A device tracking the left shoulder. --- ----| '"shoulder/left"' +---| "shoulder/left" --- ---A device tracking the right shoulder. --- ----| '"shoulder/right"' +---| "shoulder/right" --- ---A device tracking the chest. --- ----| '"chest"' +---| "chest" --- ---A device tracking the waist. --- ----| '"waist"' +---| "waist" --- ---A device tracking the left knee. --- ----| '"knee/left"' +---| "knee/left" --- ---A device tracking the right knee. --- ----| '"knee/right"' +---| "knee/right" --- ---A device tracking the left foot or ankle. --- ----| '"foot/left"' +---| "foot/left" --- ---A device tracking the right foot or ankle. --- ----| '"foot/right"' +---| "foot/right" --- ---A camera device, often used for recording "mixed reality" footage. --- ----| '"camera"' +---| "camera" --- ---A tracked keyboard. --- ----| '"keyboard"' +---| "keyboard" --- ---The left eye. --- ----| '"eye/left"' +---| "eye/left" --- ---The right eye. --- ----| '"eye/right"' +---| "eye/right" --- ---The first tracking device (i.e. lighthouse). --- ----| '"beacon/1"' +---| "beacon/1" --- ---The second tracking device (i.e. lighthouse). --- ----| '"beacon/2"' +---| "beacon/2" --- ---The third tracking device (i.e. lighthouse). --- ----| '"beacon/3"' +---| "beacon/3" --- ---The fourth tracking device (i.e. lighthouse). --- ----| '"beacon/4"' +---| "beacon/4" --- ---Axes on an input device. @@ -724,19 +724,19 @@ function lovr.headset.wasReleased(device, button) end --- ---A trigger (1D). --- ----| '"trigger"' +---| "trigger" --- ---A thumbstick (2D). --- ----| '"thumbstick"' +---| "thumbstick" --- ---A touchpad (2D). --- ----| '"touchpad"' +---| "touchpad" --- ---A grip button or grab gesture (1D). --- ----| '"grip"' +---| "grip" --- ---Buttons on an input device. @@ -745,43 +745,43 @@ function lovr.headset.wasReleased(device, button) end --- ---The trigger button. --- ----| '"trigger"' +---| "trigger" --- ---The thumbstick. --- ----| '"thumbstick"' +---| "thumbstick" --- ---The touchpad. --- ----| '"touchpad"' +---| "touchpad" --- ---The grip button. --- ----| '"grip"' +---| "grip" --- ---The menu button. --- ----| '"menu"' +---| "menu" --- ---The A button. --- ----| '"a"' +---| "a" --- ---The B button. --- ----| '"b"' +---| "b" --- ---The X button. --- ----| '"x"' +---| "x" --- ---The Y button. --- ----| '"y"' +---| "y" --- ---The proximity sensor on a headset. --- ----| '"proximity"' +---| "proximity" --- ---These are all of the supported VR APIs that LÖVR can use to power the lovr.headset module. @@ -800,31 +800,31 @@ function lovr.headset.wasReleased(device, button) end --- ---A VR simulator using keyboard/mouse. --- ----| '"desktop"' +---| "desktop" --- ---Oculus Desktop SDK. --- ----| '"oculus"' +---| "oculus" --- ---OpenVR. --- ----| '"openvr"' +---| "openvr" --- ---OpenXR. --- ----| '"openxr"' +---| "openxr" --- ---Oculus Mobile SDK. --- ----| '"vrapi"' +---| "vrapi" --- ---Pico. --- ----| '"pico"' +---| "pico" --- ---WebXR. --- ----| '"webxr"' +---| "webxr" --- ---Represents the different types of origins for coordinate spaces. @@ -837,8 +837,8 @@ function lovr.headset.wasReleased(device, button) end --- ---The origin is at the head. --- ----| '"head"' +---| "head" --- ---The origin is on the floor. --- ----| '"floor"' +---| "floor" diff --git a/meta/3rd/lovr/library/lovr.math.lua b/meta/3rd/lovr/library/lovr.math.lua index 2b3d3059..c53ffac2 100644 --- a/meta/3rd/lovr/library/lovr.math.lua +++ b/meta/3rd/lovr/library/lovr.math.lua @@ -60,8 +60,9 @@ function lovr.math.mat4() end ---@param x number # The x coordinate of the first control point. ---@param y number # The y coordinate of the first control point. ---@param z number # The z coordinate of the first control point. +---@vararg any # Additional control points. ---@return lovr.Curve curve # The new Curve. -function lovr.math.newCurve(x, y, z) end +function lovr.math.newCurve(x, y, z, ...) end --- ---Creates a new 4D matrix. @@ -406,7 +407,7 @@ function Mat4:perspective(near, far, fov, aspect) end --- ---Rotates the matrix using a quaternion or an angle/axis rotation. --- ----@overload fun(self: lovr.Mat4, angle: number, ax: number, ay: number, az: number):lovr.Mat4 +---@overload fun(self: lovr.Mat4, angle: number, ax?: number, ay?: number, az?: number):lovr.Mat4 ---@param q lovr.Quat # The rotation to apply to the matrix. ---@return lovr.Mat4 m # The original matrix. function Mat4:rotate(q) end @@ -414,7 +415,7 @@ function Mat4:rotate(q) end --- ---Scales the matrix. --- ----@overload fun(self: lovr.Mat4, sx: number, sy: number, sz: number):lovr.Mat4 +---@overload fun(self: lovr.Mat4, sx: number, sy?: number, sz?: number):lovr.Mat4 ---@param scale lovr.Vec3 # The 3D scale to apply. ---@return lovr.Mat4 m # The original matrix. function Mat4:scale(scale) end @@ -423,8 +424,8 @@ function Mat4:scale(scale) end ---Sets the components of the matrix from separate position, rotation, and scale arguments or an existing matrix. --- ---@overload fun(self: lovr.Mat4, n: lovr.mat4):lovr.Mat4 ----@overload fun(self: lovr.Mat4, position: lovr.Vec3, scale: lovr.Vec3, rotation: lovr.Quat):lovr.Mat4 ----@overload fun(self: lovr.Mat4, position: lovr.Vec3, rotation: lovr.Quat):lovr.Mat4 +---@overload fun(self: lovr.Mat4, position?: lovr.Vec3, scale?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4 +---@overload fun(self: lovr.Mat4, position?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4 ---@overload fun(self: lovr.Mat4, ...):lovr.Mat4 ---@overload fun(self: lovr.Mat4, d: number):lovr.Mat4 ---@return lovr.Mat4 m # The input matrix. @@ -652,7 +653,7 @@ local Vec2 = {} --- ---Adds a vector or a number to the vector. --- ----@overload fun(self: lovr.Vec2, x: number, y: number):lovr.Vec2 +---@overload fun(self: lovr.Vec2, x: number, y?: number):lovr.Vec2 ---@param u lovr.Vec2 # The other vector. ---@return lovr.Vec2 v # The original vector. function Vec2:add(u) end @@ -682,7 +683,7 @@ function Vec2:distance(u) end --- ---Divides the vector by a vector or a number. --- ----@overload fun(self: lovr.Vec2, x: number, y: number):lovr.Vec2 +---@overload fun(self: lovr.Vec2, x: number, y?: number):lovr.Vec2 ---@param u lovr.Vec2 # The other vector to divide the components by. ---@return lovr.Vec2 v # The original vector. function Vec2:div(u) end @@ -739,7 +740,7 @@ function Vec2:lerp() end --- ---Multiplies the vector by a vector or a number. --- ----@overload fun(self: lovr.Vec2, x: number, y: number):lovr.Vec2 +---@overload fun(self: lovr.Vec2, x: number, y?: number):lovr.Vec2 ---@param u lovr.Vec2 # The other vector to multiply the components by. ---@return lovr.Vec2 v # The original vector. function Vec2:mul(u) end @@ -762,7 +763,7 @@ function Vec2:set(x, y) end --- ---Subtracts a vector or a number from the vector. --- ----@overload fun(self: lovr.Vec2, x: number, y: number):lovr.Vec2 +---@overload fun(self: lovr.Vec2, x: number, y?: number):lovr.Vec2 ---@param u lovr.Vec2 # The other vector. ---@return lovr.Vec2 v # The original vector. function Vec2:sub(u) end @@ -783,7 +784,7 @@ local Vec3 = {} --- ---Adds a vector or a number to the vector. --- ----@overload fun(self: lovr.Vec3, x: number, y: number, z: number):lovr.Vec3 +---@overload fun(self: lovr.Vec3, x: number, y?: number, z?: number):lovr.Vec3 ---@param u lovr.Vec3 # The other vector. ---@return lovr.Vec3 v # The original vector. function Vec3:add(u) end @@ -827,7 +828,7 @@ function Vec3:distance(u) end --- ---Divides the vector by a vector or a number. --- ----@overload fun(self: lovr.Vec3, x: number, y: number, z: number):lovr.Vec3 +---@overload fun(self: lovr.Vec3, x: number, y?: number, z?: number):lovr.Vec3 ---@param u lovr.Vec3 # The other vector to divide the components by. ---@return lovr.Vec3 v # The original vector. function Vec3:div(u) end @@ -886,7 +887,7 @@ function Vec3:lerp(u, t) end --- ---Multiplies the vector by a vector or a number. --- ----@overload fun(self: lovr.Vec3, x: number, y: number, z: number):lovr.Vec3 +---@overload fun(self: lovr.Vec3, x: number, y?: number, z?: number):lovr.Vec3 ---@param u lovr.Vec3 # The other vector to multiply the components by. ---@return lovr.Vec3 v # The original vector. function Vec3:mul(u) end @@ -911,7 +912,7 @@ function Vec3:set(x, y, z) end --- ---Subtracts a vector or a number from the vector. --- ----@overload fun(self: lovr.Vec3, x: number, y: number, z: number):lovr.Vec3 +---@overload fun(self: lovr.Vec3, x: number, y?: number, z?: number):lovr.Vec3 ---@param u lovr.Vec3 # The other vector. ---@return lovr.Vec3 v # The original vector. function Vec3:sub(u) end @@ -933,7 +934,7 @@ local Vec4 = {} --- ---Adds a vector or a number to the vector. --- ----@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):lovr.Vec4 +---@overload fun(self: lovr.Vec4, x: number, y?: number, z?: number, w?: number):lovr.Vec4 ---@param u lovr.Vec4 # The other vector. ---@return lovr.Vec4 v # The original vector. function Vec4:add(u) end @@ -963,7 +964,7 @@ function Vec4:distance(u) end --- ---Divides the vector by a vector or a number. --- ----@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):lovr.Vec4 +---@overload fun(self: lovr.Vec4, x: number, y?: number, z?: number, w?: number):lovr.Vec4 ---@param u lovr.Vec4 # The other vector to divide the components by. ---@return lovr.Vec4 v # The original vector. function Vec4:div(u) end @@ -1022,7 +1023,7 @@ function Vec4:lerp(u, t) end --- ---Multiplies the vector by a vector or a number. --- ----@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):lovr.Vec4 +---@overload fun(self: lovr.Vec4, x: number, y?: number, z?: number, w?: number):lovr.Vec4 ---@param u lovr.Vec4 # The other vector to multiply the components by. ---@return lovr.Vec4 v # The original vector. function Vec4:mul(u) end @@ -1047,7 +1048,7 @@ function Vec4:set(x, y, z, w) end --- ---Subtracts a vector or a number from the vector. --- ----@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):lovr.Vec4 +---@overload fun(self: lovr.Vec4, x: number, y?: number, z?: number, w?: number):lovr.Vec4 ---@param u lovr.Vec4 # The other vector. ---@return lovr.Vec4 v # The original vector. function Vec4:sub(u) end diff --git a/meta/3rd/lovr/library/lovr.physics.lua b/meta/3rd/lovr/library/lovr.physics.lua index b2fb22f4..d081d2f4 100644 --- a/meta/3rd/lovr/library/lovr.physics.lua +++ b/meta/3rd/lovr/library/lovr.physics.lua @@ -139,7 +139,7 @@ function lovr.physics.newSphereShape(radius) end ---@param yg? number # The y component of the gravity force. ---@param zg? number # The z component of the gravity force. ---@param allowSleep? boolean # Whether or not colliders will automatically be put to sleep. ----@param tags? table # A list of collision tags colliders can be assigned to. +---@param tags table # A list of collision tags colliders can be assigned to. ---@return lovr.World world # A whole new World. function lovr.physics.newWorld(xg, yg, zg, allowSleep, tags) end @@ -1676,19 +1676,19 @@ function World:update(dt, resolver) end --- ---A BallJoint. --- ----| '"ball"' +---| "ball" --- ---A DistanceJoint. --- ----| '"distance"' +---| "distance" --- ---A HingeJoint. --- ----| '"hinge"' +---| "hinge" --- ---A SliderJoint. --- ----| '"slider"' +---| "slider" --- ---Represents the different types of physics Shapes available. @@ -1697,16 +1697,16 @@ function World:update(dt, resolver) end --- ---A BoxShape. --- ----| '"box"' +---| "box" --- ---A CapsuleShape. --- ----| '"capsule"' +---| "capsule" --- ---A CylinderShape. --- ----| '"cylinder"' +---| "cylinder" --- ---A SphereShape. --- ----| '"sphere"' +---| "sphere" diff --git a/meta/3rd/lovr/library/lovr.system.lua b/meta/3rd/lovr/library/lovr.system.lua index 35161332..b3be6d49 100644 --- a/meta/3rd/lovr/library/lovr.system.lua +++ b/meta/3rd/lovr/library/lovr.system.lua @@ -37,4 +37,4 @@ function lovr.system.requestPermission(permission) end --- ---Requests microphone access. --- ----| '"audiocapture"' +---| "audiocapture" |