import { useRef } from 'react';
import * as everforest from '../_everforest.module.scss'
import { RigidBody } from '@react-three/rapier';
import { useGLTF } from '@react-three/drei';
import terrainModelURL from '../assets/terrain.glb';

export default function Ground() {
    const { nodes, materials } = useGLTF(terrainModelURL);
    return (
        <RigidBody type='fixed' colliders="trimesh">
            <mesh position={[0, 0, 0]} geometry={nodes.ground.geometry} name='ground'>
                <meshStandardMaterial color={everforest.yellow}/>
            </mesh>
            <mesh geometry={nodes.pyramid.geometry} name='ground'>
                <meshStandardMaterial color={everforest.bg2}/>
            </mesh>
        </RigidBody>
    );
}
