diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-07 20:31:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-07 20:31:46 +0800 |
commit | 85d497ac617dcb629b991defc23540e9bfa34cbc (patch) | |
tree | 13a6f56fe09de0163ff94506c392e5d07de03f53 /meta | |
parent | 67815046d2345924123d290e2b0c01fb15a9a6bb (diff) | |
download | lua-language-server-85d497ac617dcb629b991defc23540e9bfa34cbc.zip |
build 3rd metas
Diffstat (limited to 'meta')
-rw-r--r-- | meta/3rd/lovr/library/lovr.headset.lua | 19 | ||||
-rw-r--r-- | meta/3rd/lovr/library/lovr.math.lua | 86 | ||||
-rw-r--r-- | meta/3rd/lovr/library/lovr.physics.lua | 8 |
3 files changed, 98 insertions, 15 deletions
diff --git a/meta/3rd/lovr/library/lovr.headset.lua b/meta/3rd/lovr/library/lovr.headset.lua index 419a8180..fd6e9d63 100644 --- a/meta/3rd/lovr/library/lovr.headset.lua +++ b/meta/3rd/lovr/library/lovr.headset.lua @@ -7,7 +7,7 @@ --- ---Note that all units are reported in meters. --- ----Position `(0, 0, 0)` is the center of the play area. +---Position `(0, 0, 0)` is on the floor in the center of the play area. --- ---@class lovr.headset lovr.headset = {} @@ -123,6 +123,12 @@ function lovr.headset.getClipDistance() end function lovr.headset.getDisplayDimensions() end --- +---Returns a table with all the refresh rates supported by the headset display, in Hz. +--- +---@return table frequencies # A flat table of the refresh rates supported by the headset display, nil if not supported. +function lovr.headset.getDisplayFrequencies() end + +--- ---Returns the refresh rate of the headset display, in Hz. --- ---@return number frequency # The frequency of the display, or `nil` if I have no idea what it is. @@ -569,6 +575,17 @@ function lovr.headset.renderTo(callback) end function lovr.headset.setClipDistance(near, far) end --- +---Sets the display refresh rate, in Hz. +--- +--- +---### NOTE: +---Changing the display refresh-rate also changes the frequency of lovr.update() and lovr.draw() as they depend on the display frequency. +--- +---@param frequency number # The new refresh rate, in Hz. +---@return boolean success # Whether the display refresh rate was successfully set. +function lovr.headset.setDisplayFrequency(frequency) end + +--- ---Causes the device to vibrate with a custom strength, duration, and frequency, if possible. --- --- diff --git a/meta/3rd/lovr/library/lovr.math.lua b/meta/3rd/lovr/library/lovr.math.lua index c53ffac2..43a6004e 100644 --- a/meta/3rd/lovr/library/lovr.math.lua +++ b/meta/3rd/lovr/library/lovr.math.lua @@ -50,6 +50,12 @@ function lovr.math.linearToGamma(lr, lg, lb) end --- ---This function takes the same arguments as `Mat4:set`. --- +---@overload fun(n: lovr.mat4):lovr.Mat4 +---@overload fun(position?: lovr.Vec3, scale?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4 +---@overload fun(position?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4 +---@overload fun(...):lovr.Mat4 +---@overload fun(d: number):lovr.Mat4 +---@return lovr.Mat4 m # The new matrix. function lovr.math.mat4() end --- @@ -69,6 +75,12 @@ function lovr.math.newCurve(x, y, z, ...) end --- ---This function takes the same arguments as `Mat4:set`. --- +---@overload fun(n: lovr.mat4):lovr.Mat4 +---@overload fun(position?: lovr.Vec3, scale?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4 +---@overload fun(position?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4 +---@overload fun(...):lovr.Mat4 +---@overload fun(d: number):lovr.Mat4 +---@return lovr.Mat4 m # The new matrix. function lovr.math.newMat4() end --- @@ -76,7 +88,18 @@ function lovr.math.newMat4() end --- ---This function takes the same arguments as `Quat:set`. --- -function lovr.math.newQuat() end +---@overload fun(r: lovr.quat):lovr.quat +---@overload fun(v: lovr.vec3):lovr.quat +---@overload fun(v: lovr.vec3, u: lovr.vec3):lovr.quat +---@overload fun(m: lovr.mat4):lovr.quat +---@overload fun():lovr.quat +---@param angle? any # An angle to use for the rotation, in radians. +---@param ax? number # The x component of the axis of rotation. +---@param ay? number # The y component of the axis of rotation. +---@param az? number # The z component of the axis of rotation. +---@param raw? boolean # Whether the components should be interpreted as raw `(x, y, z, w)` components. +---@return lovr.quat q # The new quaternion. +function lovr.math.newQuat(angle, ax, ay, az, raw) end --- ---Creates a new `RandomGenerator`, which can be used to generate random numbers. If you just want some random numbers, you can use `lovr.math.random`. Individual RandomGenerator objects are useful if you need more control over the random sequence used or need a random generator isolated from other instances. @@ -91,21 +114,37 @@ function lovr.math.newRandomGenerator() end --- ---This function takes the same arguments as `Vec2:set`. --- -function lovr.math.newVec2() end +---@overload fun(u: lovr.Vec2):lovr.Vec2 +---@param x? number # The x value of the vector. +---@param y? number # The y value of the vector. +---@return lovr.Vec2 v # The new vector. +function lovr.math.newVec2(x, y) end --- ---Creates a new 3D vector. --- ---This function takes the same arguments as `Vec3:set`. --- -function lovr.math.newVec3() end +---@overload fun(u: lovr.Vec3):lovr.Vec3 +---@overload fun(m: lovr.Mat4):lovr.Vec3 +---@param x? number # The x value of the vector. +---@param y? number # The y value of the vector. +---@param z? number # The z value of the vector. +---@return lovr.Vec3 v # The new vector. +function lovr.math.newVec3(x, y, z) end --- ---Creates a new 4D vector. --- ---This function takes the same arguments as `Vec4:set`. --- -function lovr.math.newVec4() end +---@overload fun(u: lovr.Vec4):lovr.Vec4 +---@param x? number # The x value of the vector. +---@param y? number # The y value of the vector. +---@param z? number # The z value of the vector. +---@param w? number # The w value of the vector. +---@return lovr.Vec4 v # The new vector. +function lovr.math.newVec4(x, y, z, w) end --- ---Returns a 1D, 2D, 3D, or 4D perlin noise value. @@ -124,7 +163,18 @@ function lovr.math.noise(x) end --- ---This function takes the same arguments as `Quat:set`. --- -function lovr.math.quat() end +---@overload fun(r: lovr.quat):lovr.quat +---@overload fun(v: lovr.vec3):lovr.quat +---@overload fun(v: lovr.vec3, u: lovr.vec3):lovr.quat +---@overload fun(m: lovr.mat4):lovr.quat +---@overload fun():lovr.quat +---@param angle? any # An angle to use for the rotation, in radians. +---@param ax? number # The x component of the axis of rotation. +---@param ay? number # The y component of the axis of rotation. +---@param az? number # The z component of the axis of rotation. +---@param raw? boolean # Whether the components should be interpreted as raw `(x, y, z, w)` components. +---@return lovr.quat q # The new quaternion. +function lovr.math.quat(angle, ax, ay, az, raw) end --- ---Returns a uniformly distributed pseudo-random number. @@ -165,21 +215,37 @@ function lovr.math.setRandomSeed(seed) end --- ---This function takes the same arguments as `Vec2:set`. --- -function lovr.math.vec2() end +---@overload fun(u: lovr.Vec2):lovr.Vec2 +---@param x? number # The x value of the vector. +---@param y? number # The y value of the vector. +---@return lovr.Vec2 v # The new vector. +function lovr.math.vec2(x, y) end --- ---Creates a temporary 3D vector. --- ---This function takes the same arguments as `Vec3:set`. --- -function lovr.math.vec3() end +---@overload fun(u: lovr.Vec3):lovr.Vec3 +---@overload fun(m: lovr.Mat4):lovr.Vec3 +---@param x? number # The x value of the vector. +---@param y? number # The y value of the vector. +---@param z? number # The z value of the vector. +---@return lovr.Vec3 v # The new vector. +function lovr.math.vec3(x, y, z) end --- ---Creates a temporary 4D vector. --- ---This function takes the same arguments as `Vec4:set`. --- -function lovr.math.vec4() end +---@overload fun(u: lovr.Vec4):lovr.Vec4 +---@param x? number # The x value of the vector. +---@param y? number # The y value of the vector. +---@param z? number # The z value of the vector. +---@param w? number # The w value of the vector. +---@return lovr.Vec4 v # The new vector. +function lovr.math.vec4(x, y, z, w) end --- ---A Curve is an object that represents a Bézier curve in three dimensions. @@ -434,7 +500,7 @@ function Mat4:set() end --- ---Sets a model transform matrix that moves to `from` and orients model towards `to` point. --- ----This is used when rendered model should always point torwards a point of interest. The resulting Mat4 object can be used as model pose. +---This is used when rendered model should always point towards a point of interest. The resulting Mat4 object can be used as model pose. --- ---The target() function produces same result as lookAt() after matrix inversion. --- @@ -1004,7 +1070,7 @@ function Vec4:equals(u) end ---### NOTE: ---The length is equivalent to this: --- ---- math.sqrt(v.x * v.x + v.y * v.y * v.z + v.z + v.w * v.w) +--- math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w) --- ---@return number length # The length of the vector. function Vec4:length() end diff --git a/meta/3rd/lovr/library/lovr.physics.lua b/meta/3rd/lovr/library/lovr.physics.lua index d081d2f4..3373ceba 100644 --- a/meta/3rd/lovr/library/lovr.physics.lua +++ b/meta/3rd/lovr/library/lovr.physics.lua @@ -292,7 +292,7 @@ function Collider:applyForce(x, y, z) end --- --- ---### NOTE: ----If the Collider is asleep, it will need to be woken up with `Collider:setAwake` for this function to have any affect. +---If the Collider is asleep, it will need to be woken up with `Collider:setAwake` for this function to have any effect. --- ---@param x number # The x component of the torque. ---@param y number # The y component of the torque. @@ -1253,13 +1253,13 @@ local SphereShape = {} ---Returns the radius of the SphereShape. --- ---@return number radius # The radius of the sphere, in meters. -function SphereShape:getDimensions() end +function SphereShape:getRadius() end --- ---Sets the radius of the SphereShape. --- ---@param radius number # The radius of the sphere, in meters. -function SphereShape:setDimensions(radius) end +function SphereShape:setRadius(radius) end --- ---A World is an object that holds the colliders, joints, and shapes in a physics simulation. @@ -1524,7 +1524,7 @@ function World:newSphereCollider(x, y, z, radius) end --- ---Returns an iterator that can be used to iterate over "overlaps", or potential collisions between pairs of shapes in the World. --- ----This should be called after using `World:detectOverlaps` to compute the list of overlaps. Usually this is called automatically by `World:update`. +---This should be called after using `World:computeOverlaps` to compute the list of overlaps. Usually this is called automatically by `World:update`. --- ---@return function iterator # A Lua iterator, usable in a for loop. function World:overlaps() end |