mirror of https://github.com/bjornbytes/lovr.git
Update README;
This commit is contained in:
parent
fde1124529
commit
549eb4143c
31
README.md
31
README.md
|
@ -76,20 +76,17 @@ end
|
|||
Audio is spatialized using HRTFs, and the virtual audio listener is synchronized with the pose of
|
||||
the HMD.
|
||||
|
||||
For more examples, check out the [`examples`](examples) folder.
|
||||
For more examples, see <http://lovr.org/examples>.
|
||||
|
||||
Hardware Support
|
||||
---
|
||||
|
||||
- HTC Vive (full support via OpenVR)
|
||||
- Oculus Touch (partial support via OpenVR)
|
||||
- WebVR (partial support, see `webvr` branch)
|
||||
- Mobile VR (no support currently)
|
||||
LÖVR supports headsets compatible with OpenVR or WebVR. Notably, the HTC Vive is well tested.
|
||||
|
||||
Documentation
|
||||
---
|
||||
|
||||
See <http://lovr.org/docs> for examples and API reference. The documentation is open source
|
||||
See <http://lovr.org/docs> for guides and API reference. The documentation is open source
|
||||
and can be found [here](https://github.com/bjornbytes/lovr-docs).
|
||||
|
||||
Compiling
|
||||
|
@ -108,6 +105,7 @@ a custom build.
|
|||
- PhysicsFS
|
||||
- OpenAL (1.17+ recommended for HRTF support)
|
||||
- FreeType
|
||||
- Emscripten (optional, for compiling for web)
|
||||
|
||||
See [lovr-deps](https://github.com/bjornbytes/lovr-deps) for a GitHub repo containing all of these
|
||||
as submodules.
|
||||
|
@ -180,6 +178,27 @@ The `lovr` executable should exist in `lovr/build` now. You can run a game like
|
|||
You can also copy or symlink LÖVR into a directory on your `PATH` environment variable (e.g.
|
||||
`/usr/local/bin`) and run games from anywhere by just typing `lovr`.
|
||||
|
||||
#### WebVR
|
||||
|
||||
First, install the Emscripten SDK. Make sure you're running [this
|
||||
branch](https://github.com/bjornbytes/emscripten/tree/lovr) of Emscripten.
|
||||
|
||||
```sh
|
||||
mkdir build
|
||||
cd build
|
||||
emcmake cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
emmake make -j2
|
||||
```
|
||||
|
||||
The above commands will output `lovr.html`, `lovr.js`, and `lovr.js.mem`. To package a game, run:
|
||||
|
||||
```
|
||||
python /path/to/emscripten/tools/file_packager.py game.data --preload /path/to/game@/ --js-output=game.js
|
||||
```
|
||||
|
||||
Which will output `game.js` and `game.data`. The `lovr.html` file will need to be modified to
|
||||
include `game.js` in a script tag.
|
||||
|
||||
License
|
||||
---
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
-- Draws a rectangle on the floor, coloring it red
|
||||
-- when the player is close to the virtual boundary.
|
||||
|
||||
function lovr.load()
|
||||
if not lovr.headset.isPresent() then
|
||||
error('This example needs a headset')
|
||||
end
|
||||
|
||||
bounds = lovr.graphics.newMesh(lovr.headset.getBounds())
|
||||
end
|
||||
|
||||
function lovr.draw()
|
||||
if lovr.headset.isBoundsVisible() then
|
||||
lovr.graphics.setColor(255, 0, 0)
|
||||
else
|
||||
lovr.graphics.setColor(255, 255, 255)
|
||||
end
|
||||
|
||||
bounds:draw()
|
||||
end
|
|
@ -1,36 +0,0 @@
|
|||
-- Vibrates controllers when their triggers are pressed, draws 3D
|
||||
-- models for each controller, and keeps track of controllers when
|
||||
-- they are connected and disconnected.
|
||||
|
||||
local controllerModels = {}
|
||||
|
||||
function lovr.load()
|
||||
print('There are ' .. lovr.headset.getControllerCount() .. ' controllers.')
|
||||
end
|
||||
|
||||
function lovr.update(dt)
|
||||
local controllers = lovr.headset.getControllers()
|
||||
|
||||
for i, controller in ipairs(controllers) do
|
||||
if controller:getAxis('trigger') > .5 then
|
||||
controller:vibrate(.0035)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function lovr.draw()
|
||||
for controller, model in pairs(controllerModels) do
|
||||
local x, y, z = controller:getPosition()
|
||||
model:draw(x, y, z, 1, controller:getOrientation())
|
||||
end
|
||||
end
|
||||
|
||||
function lovr.controlleradded(controller)
|
||||
print('A controller was connected!')
|
||||
controllerModels[controller] = controller:newModel()
|
||||
end
|
||||
|
||||
function lovr.controllerremoved(controller)
|
||||
print('A controller was disconnected!')
|
||||
controllerModels[controller] = nil
|
||||
end
|
|
@ -1,8 +0,0 @@
|
|||
-- Draws a spinning cube
|
||||
|
||||
function lovr.draw()
|
||||
local x, y, z = 0, 0, -1
|
||||
local size = .5
|
||||
local angle = lovr.timer.getTime()
|
||||
lovr.graphics.cube('line', x, y, z, size, angle)
|
||||
end
|
Loading…
Reference in New Issue