Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyoshiaki committed Jun 16, 2019
2 parents c04d342 + 8608757 commit a858fa4
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 11 deletions.
Binary file added public/textures/Space/space_back.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/textures/Space/space_down.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/textures/Space/space_front.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/textures/Space/space_left.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/textures/Space/space_right.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/textures/Space/space_up.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 21 additions & 3 deletions src/domain/babylon/vr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import React, {
createContext
} from "react";
import { SceneContext } from "../scene";
import { Color3 } from "@babylonjs/core";
import {
Color3,
MeshBuilder,
StandardMaterial,
CubeTexture,
Texture
} from "@babylonjs/core";
import Event from "rx.mini";
import { ControllerAction, VrPosition } from "./model";

Expand All @@ -31,10 +37,22 @@ const VR: FC<{

const { scene } = context;

const files = [
`${process.env.PUBLIC_URL}/textures/Space/space_left.jpg`,
`${process.env.PUBLIC_URL}/textures/Space/space_up.jpg`,
`${process.env.PUBLIC_URL}/textures/Space/space_front.jpg`,
`${process.env.PUBLIC_URL}/textures/Space/space_right.jpg`,
`${process.env.PUBLIC_URL}/textures/Space/space_down.jpg`,
`${process.env.PUBLIC_URL}/textures/Space/space_back.jpg`
];
const texture = CubeTexture.CreateFromImages(files, scene);

const environment = scene.createDefaultEnvironment({
groundYBias: 1
groundYBias: 1,
createSkybox: true,
skyboxSize: 150,
skyboxTexture: texture
})!;
environment!.setMainColor(Color3.FromHexString("#74b9ff"));

const vrHelper = scene.createDefaultVRExperience({
createDeviceOrientationCamera: false
Expand Down
6 changes: 1 addition & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ const store = createStore();

ReactDOM.render(
<Provider store={store}>
<HashRouter>
<div>
<Route exact path="/" component={App} />
</div>
</HashRouter>
<App />
</Provider>,
document.getElementById("root")
);
Expand Down
13 changes: 10 additions & 3 deletions src/pages/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import React, { useRef, useState, FC, useEffect } from "react";
import React, { useRef, useState, FC } from "react";

import SceneCreate, { SceneEventArgs } from "../domain/babylon/scene";
import { Vector3, HemisphericLight, FreeCamera } from "@babylonjs/core";
import {
Vector3,
HemisphericLight,
FreeCamera,
MeshBuilder,
StandardMaterial,
CubeTexture,
Texture
} from "@babylonjs/core";
import useInput from "../hooks/useInput";
import { webrtcService } from "../services/webrtc";
import Desktop, { OnDesktopMountProps } from "../domain/babylon/desktop";
import VR, { OnMountProps } from "../domain/babylon/vr";
import Keyboard, { OnKeyboardMountProps } from "../domain/babylon/keyboard";
import { useSelector } from "react-redux";
import { ReduxState } from "../redux";
import useSelectorRef from "../hooks/useSelectorRef";

Expand Down

0 comments on commit a858fa4

Please sign in to comment.