<!--
Auto-generated by: https://github.com/threlte/threlte/tree/main/packages/gltf
Command: npx @threlte/gltf@3.0.7 ../../../../static/models/moon.glb -T
-->

<script lang="ts">
  import { T } from "@threlte/core";
  import { useGltf, useDraco } from "@threlte/extras";
  import type { Snippet } from "svelte";

  interface Props {
    fallback?: Snippet;
    error?: Snippet<[any]>;
    children?: Snippet<[any]>;
    [key: string]: any;
  }

  let {
    fallback,
    error,
    children,
    ref = $bindable(),
    ...props
  }: Props = $props();

  const gltf = useGltf("/models/moon.glb", { dracoLoader: useDraco() });
</script>

<T.Group bind:ref dispose={false} {...props}>
  {#await gltf}
    {@render fallback?.()}
  {:then gltf}
    <T.Mesh geometry={gltf.nodes.Moon.geometry} material={gltf.materials.DD9944}
      ><T.PointLight position={[0.5, 5, 0.5]} color="#a2cbf5" intensity={7}
      ></T.PointLight>
    </T.Mesh>
  {:catch err}
    {@render error?.({ error: err })}
  {/await}

  {@render children?.({ ref })}
</T.Group>
