Skip to content

Commit

Permalink
0.4.0 documentation;
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornbytes committed Feb 18, 2017
1 parent 518041f commit 83dabe4
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 3 deletions.
27 changes: 24 additions & 3 deletions docs/Buffer:draw.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,34 @@ category: reference
Buffer:draw
===

Draws the contents of the buffer.
Draws the contents of the Buffer.

buffer:draw()
buffer:draw(x, y, z, scale, angle, ax, ay, az)

### Arguments

None
- `number x (0)` The x coordinate to translate the vertices by.
- `number y (0)` The y coordinate to translate the vertices by.
- `number z (0)` The z coordinate to translate the vertices by.
- `number scale (1)` The amount to scale the vertex positions by.
- `number angle (0)` The number of radians to rotate the vertices around their axis of rotation.
- `number ax (0)` The x component of the axis of rotation.
- `number ay (1)` The y component of the axis of rotation.
- `number az (0)` The z component of the axis of rotation.

### Returns

Nothing

---

Draws the contents of the Buffer.

buffer:draw(transform)

### Arguments

- `Transform transform` The Transform to apply to the vertices.

### Returns

Expand Down
20 changes: 20 additions & 0 deletions docs/Buffer:getVertexFormat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
category: reference
-->

Buffer:getVertexFormat
===

Get the format table of the Buffer's vertices.

format = buffer:getVertexFormat()

### Arguments

None

### Returns

- `table format` The table of vertex attributes. Each attribute is a table containing the name
of the attribute (string), the data type (string), and the number of components of the attribute
(number).
20 changes: 20 additions & 0 deletions docs/HeadsetEye.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
category: reference
-->

HeadsetEye
===

Represents either the left or right eye.

Values
---

- `left` The left eye.
- `right` The right eye.

See also
---

- `lovr.headset.getEyePosition`
- `lovr.draw`
14 changes: 14 additions & 0 deletions docs/Model:draw.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,17 @@ Draws a model.
### Returns

Nothing

---

Draws a model using a transform.

model:draw(transform)

### Arguments

- `Transform transform` The Transform to apply to the model.

### Returns

Nothing
1 change: 1 addition & 0 deletions docs/lovr.draw.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ See also
---

- `lovr.headset.renderTo`
- `HeadsetEye`
18 changes: 18 additions & 0 deletions docs/lovr.graphics.cube.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,21 @@ Draw a textured cube
### Returns

Nothing

---

Draw a cube using a `Transform`.

lovr.graphics.cube(mode, transform)

- `DrawMode mode` How to draw the cube.
- `Transform transform` The Transform to apply to the cube.

---

Draw a textured cube using a `Transform`.

lovr.graphics.cube(texture, transform)

- `Texture texture` The Texture to apply to the cube.
- `Transform transform` The Transform to apply to the cube.
5 changes: 5 additions & 0 deletions docs/lovr.graphics.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ how objects in the game world are mapped onto the screen.
<td>Push a copy of the current coordinate transform onto the stack.</td>
</tr>

<tr>
<td class="pre">lovr.graphics.transform</td>
<td>Transform the coordinate system using a <code>Transform</code> object.</td>
</tr>

<tr>
<td class="pre">lovr.graphics.rotate</td>
<td>Rotate the coordinate system around an axis.</td>
Expand Down
15 changes: 15 additions & 0 deletions docs/lovr.graphics.newModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,18 @@ Creates a new Model from a file. Most 3D file formats are supported.
### Returns

- `Model model` The new Model.

---

Create a new Model with a Texture applied.

model = lovr.graphics.newModel(filename, texture)

### Arguments

- `string filename` The filename of the model.
- `string texture` The filename of the texture to apply to the model.

### Returns

- `Model model` The new Model.
28 changes: 28 additions & 0 deletions docs/lovr.graphics.transform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
category: reference
-->

lovr.graphics.transform
===

Transform the coordinate system using a `Transform` object. Transforms provide a convenient way
to represent translations, rotations, and scales in a single object. All coordinates used in
drawing operations will be transformed by the specified Transform until the coordinate system is
popped off the stack.

Note that order matters when transforming the coordinate system.

lovr.graphics.transform(transform)

### Arguments

- `Transform transform` The Transform to apply to the coordinate system.

### Returns

Nothing

See also
---

- `Transform`
20 changes: 20 additions & 0 deletions docs/lovr.headset.getEyePosition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
category: reference
-->

lovr.headset.getEyePosition
===

Returns the current position of one the headset's eyes in 3d space.

x, y, z = lovr.headset.getEyePosition(eye)

### Arguments

- `HeadsetEye eye` The eye to return the position of.

### Returns

- `number x` The x position of the headset.
- `number y` The y position of the headset.
- `number z` The y position of the headset.

0 comments on commit 83dabe4

Please sign in to comment.