This repository was archived by the owner on Jun 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathExperience.tsx
47 lines (44 loc) · 1.51 KB
/
Experience.tsx
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { OrbitControls } from "@react-three/drei"
import { extendControls } from "@react-three/editor"
import { Physics, RigidBody } from "@react-three/rapier"
import { BlockAxe } from "./components/BlockAxe.js"
import { BlockEnd } from "./components/BlockEnd.js"
import { BlockLimbo } from "./components/BlockLimbo.js"
import { BlockSpinner } from "./components/BlockSpinner.js"
import { BlockStart } from "./components/BlockStart.js"
import { Bounds } from "./components/Bounds.js"
import Lights from "./Lights.js"
import { Player } from "./Player.js"
extendControls(RigidBody, {
mass: { value: 1, min: 0, max: 100, step: 0.1, type: "number" },
friction: { value: 0.5, min: 0, max: 1, step: 0.01, type: "number" },
restitution: { value: 0.5, min: 0, max: 1, step: 0.01, type: "number" },
linearDamping: { value: 0.1, min: 0, max: 1, step: 0.01, type: "number" },
angularDamping: { value: 0.1, min: 0, max: 1, step: 0.01, type: "number" }
})
function Level() {
return (
<>
<BlockStart position={[0, 0.426, 0]} />
<BlockLimbo position={[0, -0.003, -4]} />
<BlockSpinner position={[0, 0, -8]} />
<BlockSpinner position={[0, 0, -12]} />
<BlockAxe position={[0, 0, -16]} />
<BlockEnd position={[0.0, 0, -20]} />
<Bounds length={6} name={"yo!"} />
</>
)
}
export default function Experience() {
return (
<>
<OrbitControls makeDefault />
<Physics>
<Level />
<Lights />
<Player />
{/* <gridHelper /> */}
</Physics>
</>
)
}