import { create, renderScene } from '@hiberworld/code-kit';
import { PARTICLE_PRESETS, addParticles, addTo, draw, getGround, getGroup, getHovering, getPrefab, } from './helpers';
import { getOrbiting } from './helpers/getOrbiting';
import { getAsteroidSpin } from './helpers/getAsteroidSpin';
import { getSpinningWheels } from './helpers/getSpinningWheels';
const world = create();
addTo(world, getGround());
// First a container for the car
let car = getGroup({ p: [0, 5, 5], r: [0, 90, 0] });
// Then add the car body
addTo(car, getPrefab({ id: 'cube_01', s: [4, 0.4, 1], material: 't_plank_wall_01' }));
let rock = getPrefab({ id: 'rock_01_t3', p: [-1, 5, 0], r: [0, 0, 0] });
addParticles(rock, PARTICLE_PRESETS.starDust);
rock = getHovering(rock, { magnitude: 2, speedMultiplier: 2 });
rock = getAsteroidSpin(rock, { seed: 2 });
addTo(car, rock);
// Then add the wheels
const speedMultiplier = 1;
const wheelR = getSpinningWheels({
    p: [2, 0, -1.7],
    speedMultiplier,
    wheelScale: [8, 2, 2],
    wheelMaterial: 't_metal_01',
    numWheels: 2,
    wheelDistance: 4,
});
addTo(car, wheelR);
const wheelL = getSpinningWheels({
    p: [2, 0, 1.7],
    speedMultiplier,
    wheelScale: [8, 2, 2],
    wheelMaterial: 't_metal_01',
    numWheels: 2,
    wheelDistance: 4,
});
addTo(car, wheelL);
const radius = 10;
const duration = 4;
car = getOrbiting(car, { radius, duration });
car = getHovering(car, { magnitude: 8, speedMultiplier: 5 });
addTo(world, car);
renderScene(draw(world, 'midday_01'));
//# sourceMappingURL=car.js.map