Skip to content

Commit 85d497a

Browse files
committed
build 3rd metas
1 parent 6781504 commit 85d497a

File tree

3 files changed

+98
-15
lines changed

3 files changed

+98
-15
lines changed

meta/3rd/lovr/library/lovr.headset.lua

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
---
88
---Note that all units are reported in meters.
99
---
10-
---Position `(0, 0, 0)` is the center of the play area.
10+
---Position `(0, 0, 0)` is on the floor in the center of the play area.
1111
---
1212
---@class lovr.headset
1313
lovr.headset = {}
@@ -122,6 +122,12 @@ function lovr.headset.getClipDistance() end
122122
---@return number height # The height of the display.
123123
function lovr.headset.getDisplayDimensions() end
124124

125+
---
126+
---Returns a table with all the refresh rates supported by the headset display, in Hz.
127+
---
128+
---@return table frequencies # A flat table of the refresh rates supported by the headset display, nil if not supported.
129+
function lovr.headset.getDisplayFrequencies() end
130+
125131
---
126132
---Returns the refresh rate of the headset display, in Hz.
127133
---
@@ -568,6 +574,17 @@ function lovr.headset.renderTo(callback) end
568574
---@param far number # The distance to the far clipping plane, in meters.
569575
function lovr.headset.setClipDistance(near, far) end
570576

577+
---
578+
---Sets the display refresh rate, in Hz.
579+
---
580+
---
581+
---### NOTE:
582+
---Changing the display refresh-rate also changes the frequency of lovr.update() and lovr.draw() as they depend on the display frequency.
583+
---
584+
---@param frequency number # The new refresh rate, in Hz.
585+
---@return boolean success # Whether the display refresh rate was successfully set.
586+
function lovr.headset.setDisplayFrequency(frequency) end
587+
571588
---
572589
---Causes the device to vibrate with a custom strength, duration, and frequency, if possible.
573590
---

meta/3rd/lovr/library/lovr.math.lua

Lines changed: 76 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ function lovr.math.linearToGamma(lr, lg, lb) end
5050
---
5151
---This function takes the same arguments as `Mat4:set`.
5252
---
53+
---@overload fun(n: lovr.mat4):lovr.Mat4
54+
---@overload fun(position?: lovr.Vec3, scale?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4
55+
---@overload fun(position?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4
56+
---@overload fun(...):lovr.Mat4
57+
---@overload fun(d: number):lovr.Mat4
58+
---@return lovr.Mat4 m # The new matrix.
5359
function lovr.math.mat4() end
5460

5561
---
@@ -69,14 +75,31 @@ function lovr.math.newCurve(x, y, z, ...) end
6975
---
7076
---This function takes the same arguments as `Mat4:set`.
7177
---
78+
---@overload fun(n: lovr.mat4):lovr.Mat4
79+
---@overload fun(position?: lovr.Vec3, scale?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4
80+
---@overload fun(position?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4
81+
---@overload fun(...):lovr.Mat4
82+
---@overload fun(d: number):lovr.Mat4
83+
---@return lovr.Mat4 m # The new matrix.
7284
function lovr.math.newMat4() end
7385

7486
---
7587
---Creates a new quaternion.
7688
---
7789
---This function takes the same arguments as `Quat:set`.
7890
---
79-
function lovr.math.newQuat() end
91+
---@overload fun(r: lovr.quat):lovr.quat
92+
---@overload fun(v: lovr.vec3):lovr.quat
93+
---@overload fun(v: lovr.vec3, u: lovr.vec3):lovr.quat
94+
---@overload fun(m: lovr.mat4):lovr.quat
95+
---@overload fun():lovr.quat
96+
---@param angle? any # An angle to use for the rotation, in radians.
97+
---@param ax? number # The x component of the axis of rotation.
98+
---@param ay? number # The y component of the axis of rotation.
99+
---@param az? number # The z component of the axis of rotation.
100+
---@param raw? boolean # Whether the components should be interpreted as raw `(x, y, z, w)` components.
101+
---@return lovr.quat q # The new quaternion.
102+
function lovr.math.newQuat(angle, ax, ay, az, raw) end
80103

81104
---
82105
---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
91114
---
92115
---This function takes the same arguments as `Vec2:set`.
93116
---
94-
function lovr.math.newVec2() end
117+
---@overload fun(u: lovr.Vec2):lovr.Vec2
118+
---@param x? number # The x value of the vector.
119+
---@param y? number # The y value of the vector.
120+
---@return lovr.Vec2 v # The new vector.
121+
function lovr.math.newVec2(x, y) end
95122

96123
---
97124
---Creates a new 3D vector.
98125
---
99126
---This function takes the same arguments as `Vec3:set`.
100127
---
101-
function lovr.math.newVec3() end
128+
---@overload fun(u: lovr.Vec3):lovr.Vec3
129+
---@overload fun(m: lovr.Mat4):lovr.Vec3
130+
---@param x? number # The x value of the vector.
131+
---@param y? number # The y value of the vector.
132+
---@param z? number # The z value of the vector.
133+
---@return lovr.Vec3 v # The new vector.
134+
function lovr.math.newVec3(x, y, z) end
102135

103136
---
104137
---Creates a new 4D vector.
105138
---
106139
---This function takes the same arguments as `Vec4:set`.
107140
---
108-
function lovr.math.newVec4() end
141+
---@overload fun(u: lovr.Vec4):lovr.Vec4
142+
---@param x? number # The x value of the vector.
143+
---@param y? number # The y value of the vector.
144+
---@param z? number # The z value of the vector.
145+
---@param w? number # The w value of the vector.
146+
---@return lovr.Vec4 v # The new vector.
147+
function lovr.math.newVec4(x, y, z, w) end
109148

110149
---
111150
---Returns a 1D, 2D, 3D, or 4D perlin noise value.
@@ -124,7 +163,18 @@ function lovr.math.noise(x) end
124163
---
125164
---This function takes the same arguments as `Quat:set`.
126165
---
127-
function lovr.math.quat() end
166+
---@overload fun(r: lovr.quat):lovr.quat
167+
---@overload fun(v: lovr.vec3):lovr.quat
168+
---@overload fun(v: lovr.vec3, u: lovr.vec3):lovr.quat
169+
---@overload fun(m: lovr.mat4):lovr.quat
170+
---@overload fun():lovr.quat
171+
---@param angle? any # An angle to use for the rotation, in radians.
172+
---@param ax? number # The x component of the axis of rotation.
173+
---@param ay? number # The y component of the axis of rotation.
174+
---@param az? number # The z component of the axis of rotation.
175+
---@param raw? boolean # Whether the components should be interpreted as raw `(x, y, z, w)` components.
176+
---@return lovr.quat q # The new quaternion.
177+
function lovr.math.quat(angle, ax, ay, az, raw) end
128178

129179
---
130180
---Returns a uniformly distributed pseudo-random number.
@@ -165,21 +215,37 @@ function lovr.math.setRandomSeed(seed) end
165215
---
166216
---This function takes the same arguments as `Vec2:set`.
167217
---
168-
function lovr.math.vec2() end
218+
---@overload fun(u: lovr.Vec2):lovr.Vec2
219+
---@param x? number # The x value of the vector.
220+
---@param y? number # The y value of the vector.
221+
---@return lovr.Vec2 v # The new vector.
222+
function lovr.math.vec2(x, y) end
169223

170224
---
171225
---Creates a temporary 3D vector.
172226
---
173227
---This function takes the same arguments as `Vec3:set`.
174228
---
175-
function lovr.math.vec3() end
229+
---@overload fun(u: lovr.Vec3):lovr.Vec3
230+
---@overload fun(m: lovr.Mat4):lovr.Vec3
231+
---@param x? number # The x value of the vector.
232+
---@param y? number # The y value of the vector.
233+
---@param z? number # The z value of the vector.
234+
---@return lovr.Vec3 v # The new vector.
235+
function lovr.math.vec3(x, y, z) end
176236

177237
---
178238
---Creates a temporary 4D vector.
179239
---
180240
---This function takes the same arguments as `Vec4:set`.
181241
---
182-
function lovr.math.vec4() end
242+
---@overload fun(u: lovr.Vec4):lovr.Vec4
243+
---@param x? number # The x value of the vector.
244+
---@param y? number # The y value of the vector.
245+
---@param z? number # The z value of the vector.
246+
---@param w? number # The w value of the vector.
247+
---@return lovr.Vec4 v # The new vector.
248+
function lovr.math.vec4(x, y, z, w) end
183249

184250
---
185251
---A Curve is an object that represents a Bézier curve in three dimensions.
@@ -434,7 +500,7 @@ function Mat4:set() end
434500
---
435501
---Sets a model transform matrix that moves to `from` and orients model towards `to` point.
436502
---
437-
---This is used when rendered model should always point torwards a point of interest. The resulting Mat4 object can be used as model pose.
503+
---This is used when rendered model should always point towards a point of interest. The resulting Mat4 object can be used as model pose.
438504
---
439505
---The target() function produces same result as lookAt() after matrix inversion.
440506
---
@@ -1004,7 +1070,7 @@ function Vec4:equals(u) end
10041070
---### NOTE:
10051071
---The length is equivalent to this:
10061072
---
1007-
--- math.sqrt(v.x * v.x + v.y * v.y * v.z + v.z + v.w * v.w)
1073+
--- math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w)
10081074
---
10091075
---@return number length # The length of the vector.
10101076
function Vec4:length() end

meta/3rd/lovr/library/lovr.physics.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function Collider:applyForce(x, y, z) end
292292
---
293293
---
294294
---### NOTE:
295-
---If the Collider is asleep, it will need to be woken up with `Collider:setAwake` for this function to have any affect.
295+
---If the Collider is asleep, it will need to be woken up with `Collider:setAwake` for this function to have any effect.
296296
---
297297
---@param x number # The x component of the torque.
298298
---@param y number # The y component of the torque.
@@ -1253,13 +1253,13 @@ local SphereShape = {}
12531253
---Returns the radius of the SphereShape.
12541254
---
12551255
---@return number radius # The radius of the sphere, in meters.
1256-
function SphereShape:getDimensions() end
1256+
function SphereShape:getRadius() end
12571257

12581258
---
12591259
---Sets the radius of the SphereShape.
12601260
---
12611261
---@param radius number # The radius of the sphere, in meters.
1262-
function SphereShape:setDimensions(radius) end
1262+
function SphereShape:setRadius(radius) end
12631263

12641264
---
12651265
---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
15241524
---
15251525
---Returns an iterator that can be used to iterate over "overlaps", or potential collisions between pairs of shapes in the World.
15261526
---
1527-
---This should be called after using `World:detectOverlaps` to compute the list of overlaps. Usually this is called automatically by `World:update`.
1527+
---This should be called after using `World:computeOverlaps` to compute the list of overlaps. Usually this is called automatically by `World:update`.
15281528
---
15291529
---@return function iterator # A Lua iterator, usable in a for loop.
15301530
function World:overlaps() end

0 commit comments

Comments
 (0)