You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: meta/3rd/lovr/library/callback.lua
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -51,15 +51,21 @@ lovr.conf = nil
51
51
lovr.draw=nil
52
52
53
53
---
54
-
---The "lovr.errhand" callback is run whenever an error occurs.
54
+
---The `lovr.errhand` callback is run whenever an error occurs.
55
55
---
56
-
---It receives two parameters. The first is a string containing the error message. The second is either nil, or a string containing a traceback (as returned by "debug.traceback()"); if nil, this means "lovr.errhand" is being called in the stack where the error occurred, and it can call "debug.traceback()" itself.
56
+
---It receives a parameter containing the error message.
57
57
---
58
-
---"lovr.errhand" should return a handler function to run in a loop to show the error screen. This handler function is of the same type as the one returned by "lovr.run" and has the same requirements (such as pumping events). If an error occurs while this handler is running, the program will terminate immediately-- "lovr.errhand" will not be given a second chance. Errors which occur inside "lovr.errhand" or in the handler it returns may not be cleanly reported, so be careful.
58
+
---It should return a handler function that will run in a loop to render the error screen.
59
+
---
60
+
---This handler function is of the same type as the one returned by `lovr.run` and has the same requirements (such as pumping events).
61
+
---
62
+
---If an error occurs while this handler is running, the program will terminate immediately -- `lovr.errhand` will not be given a second chance.
63
+
---
64
+
---Errors which occur in the error handler or in the handler it returns may not be cleanly reported, so be careful.
59
65
---
60
66
---A default error handler is supplied that renders the error message as text to the headset and to the window.
---For example, a stereo view could be drawn instead of a single eye or a 2D HUD could be rendered.
125
131
---
126
-
---@typefun()
132
+
---@typefun(pass: lovr.Pass):boolean
127
133
lovr.mirror=nil
128
134
129
135
---
@@ -196,7 +202,7 @@ lovr.run = nil
196
202
---### NOTE:
197
203
---Some characters in UTF-8 unicode take multiple bytes to encode.
198
204
---
199
-
---Due to the way Lua works, the length of these strings will be bigger than 1 even though they are just a single character. `lovr.graphics.print` is compatible with UTF-8 but doing other string processing on these strings may require a library.
205
+
---Due to the way Lua works, the length of these strings will be bigger than 1 even though they are just a single character. `Pass:text` is compatible with UTF-8 but doing other string processing on these strings may require a library.
200
206
---
201
207
---Lua 5.3+ has support for working with UTF-8 strings.
Copy file name to clipboardExpand all lines: meta/3rd/lovr/library/lovr/graphics.lua
+5-8Lines changed: 5 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2080,19 +2080,17 @@ function Pass:setMeshMode(mode) end
2080
2080
---
2081
2081
---Alternatively, a projection matrix can be used for other types of projections like orthographic, oblique, etc.
2082
2082
---
2083
-
---There is also a shorthand string "orthographic" that can be used to configure an orthographic projection.
2084
-
---
2085
2083
---Up to 6 views are supported.
2086
2084
---
2087
-
---When rendering to the headset, both projections are changed to match the ones used by the headset.
2088
-
---
2089
-
---This is also available by calling `lovr.headset.getViewAngles`.
2085
+
---The Pass returned by `lovr.headset.getPass` will have its views automatically configured to match the headset.
2090
2086
---
2091
2087
---
2092
2088
---### NOTE:
2093
2089
---A far clipping plane of 0.0 can be used for an infinite far plane with reversed Z range.
2094
2090
---
2095
-
---This is the default.
2091
+
---This is the default because it improves depth precision and reduces Z fighting.
2092
+
---
2093
+
---Using a non-infinite far plane requires the depth buffer to be cleared to 1.0 instead of 0.0 and the default depth test to be changed to `lequal` instead of `gequal`.
Copy file name to clipboardExpand all lines: meta/3rd/lovr/library/lovr/math.lua
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -398,7 +398,7 @@ function Mat4:equals(n) end
398
398
---@paramupnumber # The top half-angle of the projection, in radians.
399
399
---@paramdownnumber # The bottom half-angle of the projection, in radians.
400
400
---@paramnearnumber # The near plane of the projection.
401
-
---@paramfarnumber # The far plane of the projection.
401
+
---@paramfar?number # The far plane. Zero is a special value that will set an infinite far plane with a reversed Z range, which improves depth buffer precision and is the default.
402
402
---@returnlovr.Mat4 m # The original matrix.
403
403
functionMat4:fov(left, right, up, down, near, far) end
404
404
@@ -411,7 +411,7 @@ function Mat4:identity() end
411
411
---
412
412
---Inverts the matrix, causing it to represent the opposite of its old transform.
413
413
---
414
-
---@returnlovr.Mat4 m # The original matrix.
414
+
---@returnlovr.Mat4 m # The original matrix, with its values inverted.
415
415
functionMat4:invert() end
416
416
417
417
---
@@ -467,7 +467,7 @@ function Mat4:orthographic(left, right, bottom, top, near, far) end
467
467
---@paramfovnumber # The vertical field of view (in radians).
468
468
---@paramaspectnumber # The horizontal aspect ratio of the projection (width / height).
469
469
---@paramnearnumber # The near plane.
470
-
---@paramfarnumber # The far plane.
470
+
---@paramfar?number # The far plane. Zero is a special value that will set an infinite far plane with a reversed Z range, which improves depth buffer precision and is the default.
471
471
---@returnlovr.Mat4 m # The original matrix.
472
472
functionMat4:perspective(fov, aspect, near, far) end
0 commit comments