import { addTo } from '../../addTo';
import { getGroup } from '../../getGroup';
import { getMoving } from '../../getMoving';
import { getPrefab } from '../../getPrefab';
import { rsd } from '../../utils/randomSeed';
import { spinIt } from '../getVortex';
export const sciFiTunnelVortex = {
    onEach: (info) => {
        const spinDuration = rsd(info.seed).randomFromArray([4, 8, 16]);
        const spinning = true;
        const wrapper = getGroup({ p: [0, 0, 0], s: [7, 7, 2] });
        const box = getPrefab({ id: 'tron_o1_green', p: [0, 0, 0] }); // tron_q1_blue tron_q2_blue
        addTo(wrapper, [box]);
        if (info.index % 2 === 0) {
            const circle = getPrefab({ id: 'tron_q3_blue', p: [0, -2, 0] });
            addTo(wrapper, getMoving(circle, {
                p: [0, 0, 10],
                to: [0, 0, -20],
                progress: rsd(info.seed).getValue(),
                duration: rsd(info.seed).randomFromArray([2, 4, 8]),
            }));
        }
        else {
            const circle = getPrefab({ id: 'tron_q2_blue', p: [0, -2, 100], r: [90, 0, 0] });
            addTo(wrapper, getMoving(circle, {
                to: [0, 0, -100],
                easing: 'LINEAR',
                loopBehaviour: 'REVERSE',
                progress: rsd(info.seed).getValue(),
                duration: rsd(info.seed).randomFromArray([1, 2]),
            }));
        }
        // Place objects in wrapper
        return spinning ? spinIt(wrapper, spinDuration, info) : wrapper;
    },
    depth: 10,
    repeats: 20,
    duration: 32,
};
//# sourceMappingURL=sciFiTunnelVortex.js.map