/*
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: {
    mirror_geometry003: THREE.Mesh
    ['mirror_geometry.003_1']: THREE.Mesh
    ['mirror_geometry.003_2']: THREE.Mesh
    ['mirror_geometry.003_3']: THREE.Mesh
  }
  materials: {
    ['Vidrio.001']: THREE.MeshStandardMaterial
    ['Madera.001']: THREE.MeshStandardMaterial
    ['VrHeadset cuerpo.001']: THREE.MeshStandardMaterial
    ['marble.001']: THREE.MeshStandardMaterial
  }
}

export default function Model(props: JSX.IntrinsicElements['group']) {
  const group = useRef<THREE.Group>()
  const { nodes, materials } = useGLTF('/model/obras/santiaga.glb') as GLTFResult
  return (
    <group ref={group} {...props} dispose={null} rotation={[0, 0.4619223, 0]}>
      <group>
        <mesh
          material={materials['Vidrio.001']}
          geometry={nodes.mirror_geometry003.geometry}
        />
        <mesh
          material={materials['Madera.001']}
          geometry={nodes['mirror_geometry.003_1'].geometry}
        />
        <mesh
          material={materials['VrHeadset cuerpo.001']}
          geometry={nodes['mirror_geometry.003_2'].geometry}
        />
        <mesh
          material={materials['marble.001']}
          geometry={nodes['mirror_geometry.003_3'].geometry}
        />
      </group>
    </group>
  )
}

useGLTF.preload('/model/obras/santiaga.glb')
