diff --git a/packages/client/public/model/plaza.glb b/packages/client/public/model/plaza.glb index 5d6d59b..365ad85 100644 --- a/packages/client/public/model/plaza.glb +++ b/packages/client/public/model/plaza.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5331920875cb4cc0ca50db48372c1d60d8c6b0802c679ca0ce05ff38cab9ca01 -size 1838292 +oid sha256:1770e3a01ca3b6b71c83dbee17e965f401713d508aaf6dd2660037fc26bd36c3 +size 2282788 diff --git a/packages/client/public/model/plaza_collision.glb b/packages/client/public/model/plaza_collision.glb index 8052e4b..8108049 100644 --- a/packages/client/public/model/plaza_collision.glb +++ b/packages/client/public/model/plaza_collision.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6ccd4532e8d1d43c5db2568c3065345b3988edfe923e84b9b837e101df4e837 -size 14896 +oid sha256:6d64884c7be632cec6138aeba218a50a742ac8f436ceedcc4a4f5626474bf30d +size 27108 diff --git a/packages/client/src/components/Museo.tsx b/packages/client/src/components/Museo.tsx index 1c662a5..ff438c9 100644 --- a/packages/client/src/components/Museo.tsx +++ b/packages/client/src/components/Museo.tsx @@ -1,7 +1,6 @@ import { Box } from '@chakra-ui/core' import { Physics } from '@react-three/cannon' import { PointerLockControls, Sky } from '@react-three/drei' -import { Environment } from '@react-three/drei/Environment' import { Bloom, DepthOfField, @@ -24,11 +23,10 @@ const Museo: React.FC = () => { { rayleigh={2.9} /> - + diff --git a/packages/client/src/components/Player.tsx b/packages/client/src/components/Player.tsx index 8475e6c..fc61096 100644 --- a/packages/client/src/components/Player.tsx +++ b/packages/client/src/components/Player.tsx @@ -71,7 +71,7 @@ const Player = (props: SphereProps) => { .applyEuler(camera.rotation) if (forward || backward || left || right) { - api.velocity.set(direction.x, -2, direction.z) + api.velocity.set(direction.x, -SPEED / 2, direction.z) } else { api.velocity.set(0, 0, 0) } diff --git a/packages/client/src/models/Plaza.js b/packages/client/src/models/Plaza.js index 3dcfbc4..922b484 100644 --- a/packages/client/src/models/Plaza.js +++ b/packages/client/src/models/Plaza.js @@ -1,13 +1,10 @@ -/* -auto-generated by: https://github.com/pmndrs/gltfjsx -*/ import React, { useRef } from 'react' import { useGLTF } from '@react-three/drei/useGLTF' import { useCubeTexture } from '@react-three/drei' export default function Model(props) { const group = useRef() - const { nodes, materials } = useGLTF('/model/plaza.glb') + const { nodes, materials, scene, ...rest } = useGLTF('/model/plaza.glb') const envMap = useCubeTexture( ['px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png'], @@ -16,845 +13,9 @@ export default function Model(props) { materials.metal_glass.envMap = envMap return ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + ) } diff --git a/packages/client/src/models/Plaza_collision.tsx b/packages/client/src/models/Plaza_collision.tsx index 9249e20..3556b14 100644 --- a/packages/client/src/models/Plaza_collision.tsx +++ b/packages/client/src/models/Plaza_collision.tsx @@ -4,13 +4,13 @@ auto-generated by: https://github.com/pmndrs/gltfjsx import React, { useRef } from 'react' import { useGLTF } from '@react-three/drei/useGLTF' import * as THREE from 'three' +import { useTrimesh } from '@react-three/cannon' import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader' -import { useTrimesh } from '@react-three/cannon' type GLTFResult = GLTF & { nodes: { - collision_mesh_park: THREE.Mesh + collision_mesh: THREE.Mesh } materials: { collision: THREE.MeshStandardMaterial @@ -21,9 +21,12 @@ export default function Model(props: JSX.IntrinsicElements['group']) { const group = useRef() const { nodes } = useGLTF('/model/plaza_collision.glb') as GLTFResult - const material = new THREE.MeshBasicMaterial({ wireframe: true, color: 0xffff00 }) + const material = new THREE.MeshBasicMaterial({ + wireframe: true, + color: 0xffff00, + }) - const geometry = nodes.collision_mesh_park.geometry as THREE.BufferGeometry + const geometry = nodes.collision_mesh.geometry as THREE.BufferGeometry if (geometry.index === null) return null @@ -33,20 +36,20 @@ export default function Model(props: JSX.IntrinsicElements['group']) { // @ts-ignore const [ref] = useTrimesh(() => ({ type: 'Static', - position: [1.75, 1.5, 8.2], + position: [1.73, 1.23, 8.19], args: [vertices, indices], })) return ( - + ) } -useGLTF.preload('/model/plaza_collision.glb') +useGLTF.preload('/model/collision_mesh.glb')