aboutsummaryrefslogtreecommitdiff
path: root/src/components/ground.jsx
blob: 40425382196d8638d70de06d9a06bd8efd457ed9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { useRef } from 'react';
import * as everforest from '../_everforest.module.scss'
import { RigidBody } from '@react-three/rapier';
import { DoubleSide } from 'three';
import { useGLTF } from '@react-three/drei';

export default function Ground() {
    const meshRef = useRef();
    const { nodes } = useGLTF('../assets/terrain.glb');
    return (
        <RigidBody type='fixed' colliders="trimesh">
            <mesh ref={meshRef} position={[0, 0, 0]} rotation={[-Math.PI / 2, 0, 0]} receiveShadow geometry={nodes.Plane.geometry}>
                <meshStandardMaterial color={everforest.yellow} side={DoubleSide}/>
            </mesh>
        </RigidBody>
    );
}