Skip to content

Commit 11fc916

Browse files
committed
simple
1 parent 34c8ddd commit 11fc916

File tree

10 files changed

+2376
-2406
lines changed

10 files changed

+2376
-2406
lines changed

package-lock.json

Lines changed: 2320 additions & 1711 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,23 @@
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12-
"@emotion/react": "^11.11.4",
13-
"@emotion/styled": "^11.11.0",
14-
"@react-three/drei": "^9.102.6",
15-
"@react-three/fiber": "^8.15.19",
16-
"@react-three/rapier": "^1.3.0",
17-
"@react-three/xr": "^5.7.1",
12+
"@emotion/react": "^11.13.3",
13+
"@emotion/styled": "^11.13.0",
14+
"@react-three/drei": "^9.112.0",
15+
"@react-three/fiber": "^8.17.7",
1816
"leva": "^0.9.35",
19-
"nipplejs": "^0.10.1",
20-
"react": "^18.2.0",
21-
"react-dom": "^18.2.0",
22-
"three": "^0.162.0"
17+
"react": "^18.3.1",
18+
"react-dom": "^18.3.1",
19+
"three": "^0.168.0"
2320
},
2421
"devDependencies": {
25-
"@types/react": "^18.2.69",
26-
"@types/react-dom": "^18.2.22",
27-
"@types/three": "^0.162.0",
28-
"@vitejs/plugin-react": "^4.2.1",
29-
"eslint": "^8.57.0",
22+
"@types/react": "^18.3.7",
23+
"@types/react-dom": "^18.3.0",
24+
"@types/three": "^0.168.0",
25+
"@vitejs/plugin-react": "^4.3.1",
26+
"eslint": "^8.57.1",
3027
"eslint-config-react-app": "^7.0.1",
31-
"typescript": "^5.4.3",
32-
"vite": "^5.2.3"
28+
"typescript": "^5.6.2",
29+
"vite": "^5.4.6"
3330
}
3431
}

src/App.tsx

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
import { useEffect, useState } from "react";
1+
import { useState } from "react";
22
import styled from "@emotion/styled";
3-
import { Canvas, useThree } from "@react-three/fiber";
4-
import { useKeyboardControls } from "@react-three/drei";
5-
import { Physics } from "@react-three/rapier";
6-
import { XR, Controllers, Hands, VRButton, Interactive } from "@react-three/xr";
3+
import { Canvas } from "@react-three/fiber";
74

85
import Layout from "./Layout";
96
import Cube from "./components/Cube";
10-
import Ball from "./components/Ball";
117
import Ground from "./components/Ground";
12-
import { Rope } from "./components/Rope";
138

149
function App() {
1510
return (
1611
<Styled>
17-
<VRButton />
1812
<Canvas
1913
shadows
2014
// camera={{
@@ -23,21 +17,9 @@ function App() {
2317
// }}
2418
//
2519
>
26-
<XR>
27-
<Controllers />
28-
<Hands />
29-
30-
<Physics
31-
debug
32-
gravity={[0, -60, 0]}
33-
// timeStep={1 / 60}
34-
//
35-
>
36-
<Layout>
37-
<Scene />
38-
</Layout>
39-
</Physics>
40-
</XR>
20+
<Layout>
21+
<Scene />
22+
</Layout>
4123
</Canvas>
4224
</Styled>
4325
);
@@ -49,34 +31,9 @@ export const Styled = styled.div`
4931
export default App;
5032

5133
function Scene() {
52-
const [clr, setClr] = useState<string | undefined>(undefined);
53-
//
54-
// ESC key to exit XR
55-
//
56-
57-
const gl = useThree((state) => state.gl);
58-
// gl.xr.setFramebufferScaleFactor(2.0);
59-
60-
const escPressed = useKeyboardControls((state) => state.esc);
61-
useEffect(() => {
62-
gl.xr.getSession()?.end(); // https://stackoverflow.com/a/71566927/133327
63-
}, [escPressed, gl.xr]);
64-
6534
return (
6635
<>
67-
<Interactive
68-
onHover={(e) => {
69-
console.log("hover");
70-
setClr("brown");
71-
}}
72-
onBlur={(e) => setClr(undefined)}
73-
>
74-
<Cube position-y={1} color={clr} />
75-
</Interactive>
76-
<Ball />
77-
78-
<Rope length={5} position={[3, 1, 0]} />
79-
36+
<Cube position-y={1} />
8037
<Ground />
8138
</>
8239
);

src/Gamepads.tsx

Lines changed: 0 additions & 235 deletions
This file was deleted.

0 commit comments

Comments
 (0)