blob: 2e986cdda7c2fb0a21075879b7f51c43af456d33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import { useRef } from 'react';
import terrainModelURL from '../../assets/terrain.glb?url'
import * as everforest from '../_everforest.module.scss'
import { RigidBody } from '@react-three/rapier';
import { useGLTF } from '@react-three/drei';
export default function Ground() {
const meshRef = useRef();
const { nodes } = useGLTF(terrainModelURL);
return (
<RigidBody type='fixed' colliders="trimesh">
<mesh ref={meshRef} position={[0, 0, 0]} rotation={[-Math.PI / 2, 0, 0]} geometry={nodes.Plane.geometry} name='ground'>
<meshStandardMaterial color={everforest.yellow}/>
</mesh>
</RigidBody>
);
}
|