<script setup lang="ts">
const props = defineProps(['koef'])
import Item from './item.vue';

const explosion_state = useState<boolean>('explosion_state')

const k = 1.5
const targetExplosion = {
    kosynka: [0 * k, 0 * k, 0.75 * k],
    krepleniye_planok: [0 * k, 0 * k, 0.5 * k],
    osnova_stolba: [0 * k, 0 * k, 0 * k],
    planki: [0 * k, 0 * k, -0.5 * k],
    stolb: [0 * k, 0 * k, 1 * k],
    verh: [0 * k, 0.25 * k, 0 * k],
}
</script>
<template>
    <TresMesh :position="[0, 0, 0]" :rotate-x="Math.PI * -0.5" receive-shadow cast-shadow v-if="false">
        <TresCircleGeometry :args="[8, 8, 1]" />
        <TresMeshStandardMaterial color="pink" />
    </TresMesh>
    <Suspense>
        <TresGroup :translate-y="-2" :scale="1.25">
            <Item model-url="/models/kosynka.glb" :target="explosion_state ? targetExplosion.kosynka : [0, 0, 0]" />
            <Item model-url="/models/krepleniye_planok.glb"
                :target="explosion_state ? targetExplosion.krepleniye_planok : [0, 0, 0]" />
            <Item model-url="/models/osnova_stolba.glb" />
            <Item model-url="/models/planki.glb" :target="explosion_state ? targetExplosion.planki : [0, 0, 0]" />
            <Item model-url="/models/stolb.glb" :target="explosion_state ? targetExplosion.stolb : [0, 0, 0]" />
            <Item model-url="/models/verh.glb" :target="explosion_state ? targetExplosion.verh : [0, 0, 0]" />
        </TresGroup>
    </Suspense>
</template>