/*
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: {
    entry_windows_mesh: THREE.Mesh
    entry_windows_mesh_1: THREE.Mesh
    dome_ground_mesh027: THREE.Mesh
    ['dome_ground_mesh.027_1']: THREE.Mesh
    dome_ground_mesh011: THREE.Mesh
    ['dome_ground_mesh.011_1']: THREE.Mesh
    dome_ground_mesh021: THREE.Mesh
    ['dome_ground_mesh.021_1']: THREE.Mesh
  }
  materials: {
    dome_glass: THREE.MeshStandardMaterial
    metal_glass: THREE.MeshStandardMaterial
    marble: THREE.MeshStandardMaterial
    wooden_floor: THREE.MeshStandardMaterial
    painting: THREE.MeshStandardMaterial
    wood: THREE.MeshStandardMaterial
  }
}

export default function Model(props: JSX.IntrinsicElements['group']) {
  const group = useRef<THREE.Group>()
  const { scene } = useGLTF('/model/museum.glb') as GLTFResult

  return (
    <group ref={group} {...props} dispose={null}>
      <primitive object={scene} dispose={null} matrixAutoUpdate={false} />
    </group>
  )
}

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