Created
December 3, 2017 21:31
-
-
Save kikill95/5cd4faa88a7b40fbc2a34c5f7e9f801c to your computer and use it in GitHub Desktop.
Example of simple-raycaster usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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