-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclient.js
28 lines (21 loc) · 824 Bytes
/
client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// This file contains the boilerplate to execute your React app.
// If you want to modify your application's content, start in "index.js"
import {ReactInstance, Location, Surface} from 'react-360-web';
import CustomRaycaster from "./src/controller/custom-raycaster";
function init(bundle, parent, options = {}) {
const r360 = new ReactInstance(bundle, parent, {
// Add custom options here
fullScreen: true,
...options,
});
const leftPanel = new Surface(1000, 600, Surface.SurfaceShape.Cylinder);
r360.renderToSurface(
r360.createRoot('Home', { /* initial props */ }),
leftPanel,
);
// Load the initial environment
r360.compositor.setBackground(r360.getAssetURL('Tatooine.jpg'));
r360.controls.clearRaycasters();
r360.controls.addRaycaster(CustomRaycaster);
}
window.React360 = {init};