/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
*/

import * as THREE from 'three'
import React, { useRef } from 'react'
import { useGLTF } from '@react-three/drei/useGLTF'

import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader'

type GLTFResult = GLTF & {
  nodes: {
    park_ground_mesh: THREE.Mesh
    park_ground_mesh_1: THREE.Mesh
  }
  materials: {
    grass: THREE.MeshStandardMaterial
    dirt: THREE.MeshStandardMaterial
  }
}

export default function Model(props: JSX.IntrinsicElements['group']) {
  const group = useRef<THREE.Group>()
  const { scene } = useGLTF('/model/terrain.glb') as GLTFResult
  return (
    <group ref={group} {...props} dispose={null}>
      <primitive object={scene} dispose={null} matrixAutoUpdate={false} />
    </group>
  )
}

useGLTF.preload('/model/terrain.glb')
