Skip to content

Commit 83dabe4

Browse files
committed
0.4.0 documentation;
1 parent 518041f commit 83dabe4

10 files changed

+165
-3
lines changed

docs/Buffer:draw.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,34 @@ category: reference
55
Buffer:draw
66
===
77

8-
Draws the contents of the buffer.
8+
Draws the contents of the Buffer.
99

10-
buffer:draw()
10+
buffer:draw(x, y, z, scale, angle, ax, ay, az)
1111

1212
### Arguments
1313

14-
None
14+
- `number x (0)` The x coordinate to translate the vertices by.
15+
- `number y (0)` The y coordinate to translate the vertices by.
16+
- `number z (0)` The z coordinate to translate the vertices by.
17+
- `number scale (1)` The amount to scale the vertex positions by.
18+
- `number angle (0)` The number of radians to rotate the vertices around their axis of rotation.
19+
- `number ax (0)` The x component of the axis of rotation.
20+
- `number ay (1)` The y component of the axis of rotation.
21+
- `number az (0)` The z component of the axis of rotation.
22+
23+
### Returns
24+
25+
Nothing
26+
27+
---
28+
29+
Draws the contents of the Buffer.
30+
31+
buffer:draw(transform)
32+
33+
### Arguments
34+
35+
- `Transform transform` The Transform to apply to the vertices.
1536

1637
### Returns
1738

docs/Buffer:getVertexFormat.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--
2+
category: reference
3+
-->
4+
5+
Buffer:getVertexFormat
6+
===
7+
8+
Get the format table of the Buffer's vertices.
9+
10+
format = buffer:getVertexFormat()
11+
12+
### Arguments
13+
14+
None
15+
16+
### Returns
17+
18+
- `table format` The table of vertex attributes. Each attribute is a table containing the name
19+
of the attribute (string), the data type (string), and the number of components of the attribute
20+
(number).

docs/HeadsetEye.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--
2+
category: reference
3+
-->
4+
5+
HeadsetEye
6+
===
7+
8+
Represents either the left or right eye.
9+
10+
Values
11+
---
12+
13+
- `left` The left eye.
14+
- `right` The right eye.
15+
16+
See also
17+
---
18+
19+
- `lovr.headset.getEyePosition`
20+
- `lovr.draw`

docs/Model:draw.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,17 @@ Draws a model.
2323
### Returns
2424

2525
Nothing
26+
27+
---
28+
29+
Draws a model using a transform.
30+
31+
model:draw(transform)
32+
33+
### Arguments
34+
35+
- `Transform transform` The Transform to apply to the model.
36+
37+
### Returns
38+
39+
Nothing

docs/lovr.draw.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ See also
1717
---
1818

1919
- `lovr.headset.renderTo`
20+
- `HeadsetEye`

docs/lovr.graphics.cube.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,21 @@ Draw a textured cube
4646
### Returns
4747

4848
Nothing
49+
50+
---
51+
52+
Draw a cube using a `Transform`.
53+
54+
lovr.graphics.cube(mode, transform)
55+
56+
- `DrawMode mode` How to draw the cube.
57+
- `Transform transform` The Transform to apply to the cube.
58+
59+
---
60+
61+
Draw a textured cube using a `Transform`.
62+
63+
lovr.graphics.cube(texture, transform)
64+
65+
- `Texture texture` The Texture to apply to the cube.
66+
- `Transform transform` The Transform to apply to the cube.

docs/lovr.graphics.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ how objects in the game world are mapped onto the screen.
7070
<td>Push a copy of the current coordinate transform onto the stack.</td>
7171
</tr>
7272

73+
<tr>
74+
<td class="pre">lovr.graphics.transform</td>
75+
<td>Transform the coordinate system using a <code>Transform</code> object.</td>
76+
</tr>
77+
7378
<tr>
7479
<td class="pre">lovr.graphics.rotate</td>
7580
<td>Rotate the coordinate system around an axis.</td>

docs/lovr.graphics.newModel.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,18 @@ Creates a new Model from a file. Most 3D file formats are supported.
1616
### Returns
1717

1818
- `Model model` The new Model.
19+
20+
---
21+
22+
Create a new Model with a Texture applied.
23+
24+
model = lovr.graphics.newModel(filename, texture)
25+
26+
### Arguments
27+
28+
- `string filename` The filename of the model.
29+
- `string texture` The filename of the texture to apply to the model.
30+
31+
### Returns
32+
33+
- `Model model` The new Model.

docs/lovr.graphics.transform.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
category: reference
3+
-->
4+
5+
lovr.graphics.transform
6+
===
7+
8+
Transform the coordinate system using a `Transform` object. Transforms provide a convenient way
9+
to represent translations, rotations, and scales in a single object. All coordinates used in
10+
drawing operations will be transformed by the specified Transform until the coordinate system is
11+
popped off the stack.
12+
13+
Note that order matters when transforming the coordinate system.
14+
15+
lovr.graphics.transform(transform)
16+
17+
### Arguments
18+
19+
- `Transform transform` The Transform to apply to the coordinate system.
20+
21+
### Returns
22+
23+
Nothing
24+
25+
See also
26+
---
27+
28+
- `Transform`
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--
2+
category: reference
3+
-->
4+
5+
lovr.headset.getEyePosition
6+
===
7+
8+
Returns the current position of one the headset's eyes in 3d space.
9+
10+
x, y, z = lovr.headset.getEyePosition(eye)
11+
12+
### Arguments
13+
14+
- `HeadsetEye eye` The eye to return the position of.
15+
16+
### Returns
17+
18+
- `number x` The x position of the headset.
19+
- `number y` The y position of the headset.
20+
- `number z` The y position of the headset.

0 commit comments

Comments
 (0)