/*
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: {
    Cube001: THREE.Mesh
    ['Cube.001_1']: THREE.Mesh
    ['Cube.001_2']: THREE.Mesh
  }
  materials: {
    plastic: THREE.MeshStandardMaterial
    projection_light: THREE.MeshStandardMaterial
    projection: THREE.MeshStandardMaterial
  }
}

export default function Model(props: JSX.IntrinsicElements['group']) {
  const group = useRef<THREE.Group>()
  const { nodes, materials } = useGLTF('/proyector_wide.glb') as GLTFResult
  return (
    <group ref={group} {...props} dispose={null}>
      <mesh material={materials.plastic} geometry={nodes.Cube001.geometry} />
      <mesh material={materials.projection_light} geometry={nodes['Cube.001_1'].geometry} />
      <mesh material={materials.projection} geometry={nodes['Cube.001_2'].geometry} />
    </group>
  )
}

useGLTF.preload('/proyector_wide.glb')
