/*
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 { nodes, materials } = useGLTF('/museum.glb') as GLTFResult
  return (
    <group ref={group} {...props} dispose={null}>
      <group position={[-5.44, 3.26, -141.11]}>
        <group position={[0, 11.49, 0]} scale={[2.41, 1.5, 2.41]}>
          <mesh material={materials.dome_glass} geometry={nodes.entry_windows_mesh.geometry} />
          <mesh material={materials.metal_glass} geometry={nodes.entry_windows_mesh_1.geometry} />
        </group>
        <group position={[0, 0, 0]} scale={[12.83, 7.98, 12.83]}>
          <mesh material={materials.metal_glass} geometry={nodes.dome_ground_mesh027.geometry} />
          <mesh material={materials.dome_glass} geometry={nodes['dome_ground_mesh.027_1'].geometry} />
        </group>
        <group position={[0, 0, 0]} scale={[12.83, 7.98, 12.83]}>
          <mesh material={materials.marble} geometry={nodes.dome_ground_mesh011.geometry} />
          <mesh material={materials.wooden_floor} geometry={nodes['dome_ground_mesh.011_1'].geometry} />
        </group>
        <group position={[0, 2.43, 0]} scale={[12.83, 7.98, 12.83]}>
          <mesh material={materials.painting} geometry={nodes.dome_ground_mesh021.geometry} />
          <mesh material={materials.wood} geometry={nodes['dome_ground_mesh.021_1'].geometry} />
        </group>
      </group>
    </group>
  )
}

useGLTF.preload('/museum.glb')
