Skip to content

Instantly share code, notes, and snippets.

@kikill95
Created December 3, 2017 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kikill95/5cd4faa88a7b40fbc2a34c5f7e9f801c to your computer and use it in GitHub Desktop.
Save kikill95/5cd4faa88a7b40fbc2a34c5f7e9f801c to your computer and use it in GitHub Desktop.
Example of simple-raycaster usage
import {VRInstance} from 'react-vr-web'
import * as SimpleRaycaster from 'simple-raycaster'
function init (bundle, parent, options) {
const vr = new VRInstance(bundle, 'gdg_reactvr', parent, {
raycasters: [
SimpleRaycaster // Add SimpleRaycaster to the options
],
cursorVisibility: 'visible', // Add cursorVisibility
...options
})
vr.render = function () {
// Any custom behavior you want to perform on each frame goes here
}
// Begin the animation loop
vr.start()
return vr
}
window.ReactVR = {init}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment