/**
 * Add particles to an object.
 * @example
 * ```
const ball = getPrefab({ id: 'sphere_01', p: [0, 1, 3], s: pop3(0.3) });
addParticles(ball);
addTo(root, ball);
 * ```
 */
export const addParticles = (node, props) => {
    props = {
        particleCountMax: 1000,
        shape: 'BOX',
        spawnRate: 100.0,
        velocity: [0.0, 0.0, 0.0],
        randomVelocity: [1.0, 1.0, 1.0],
        size: [0, 0, 0],
        offset: [0.0, 0.0, 0.0],
        inheritVelocity: 0.0,
        traceGround: false,
        continuous: true,
        lifetime: 2.0,
        lifeRandom: 0.0,
        sizeStart: 0.05,
        sizeEnd: 0.01,
        sizeRandom: 0.0,
        randomRotation: 0.0,
        rotationSpeed: 0.0,
        randomRotationSpeed: 0.0,
        rotationWobbleAmount: 0.0,
        rotationWobbleFrequency: 10.0,
        billboardAlign: 'VIEW',
        particleTexture: 'particle_dust_albedo',
        colorStart: [1.0, 1.0, 1.0, 1.0],
        colorEnd: [0.0, 0.0, 0.0, 0.0],
        linearColorRandom: 0.0,
        gradientTexture: '',
        gradientColorRandom: 0.0,
        blendMode: 'ALPHA_BLEND',
        depthSort: false,
        forceGravity: 0.0,
        forceAirRes: 0.0,
        wobbleVelocity: [0.0, 0.0, 0.0],
        wobbleFrequency: [0.1, 0.1, 0.11],
        collisionMode: 'NONE',
        collisionBounceFactor: 0.5,
        ...props,
    };
    // node.transform = {};
    node.particleSystemParticleMaterial = {
        particleTexture: props.particleTexture,
        colorStart: props.colorStart,
        colorEnd: props.colorEnd,
        linearColorRandom: props.linearColorRandom,
        gradientTexture: props.gradientTexture,
        gradientColorRandom: props.gradientColorRandom,
        blendMode: props.blendMode,
        depthSort: props.depthSort,
    };
    node.particleSystemParticle = {
        lifetime: props.lifetime,
        lifeRandom: props.lifeRandom,
        sizeStart: props.sizeStart,
        sizeEnd: props.sizeEnd,
        sizeRandom: props.sizeRandom,
        randomRotation: props.randomRotation,
        rotationSpeed: props.rotationSpeed,
        randomRotationSpeed: props.randomRotationSpeed,
        rotationWobbleAmount: props.rotationWobbleAmount,
        rotationWobbleFrequency: props.rotationWobbleFrequency,
        billboardAlign: props.billboardAlign,
    };
    node.particleSystemVelocityModifiers = {
        forceGravity: props.forceGravity,
        forceAirRes: props.forceAirRes,
        wobbleVelocity: props.wobbleVelocity,
        wobbleFrequency: props.wobbleFrequency,
        collisionMode: props.collisionMode,
        collisionBounceFactor: props.collisionBounceFactor,
    };
    node.particleSystemEmitter = {
        particleCountMax: props.particleCountMax,
        shape: props.shape,
        traceGround: props.traceGround,
        continuous: props.continuous,
        spawnRate: props.spawnRate,
        velocity: props.velocity,
        randomVelocity: props.randomVelocity,
        size: props.size,
        offset: props.offset,
        inheritVelocity: props.inheritVelocity,
        emitterLifeTime: props.emitterLifeTime,
        emitterMesh: props.emitterMesh,
    };
    return node;
};
export const PARTICLE_GRADIENT = {
    gradient1: 'particle_gradient1_albedo',
    gradient_in_out_01: 'particle_gradient_in_out_01_albedo',
    radial_gradient_01: 'particle_radial_gradient_01_albedo',
};
//# sourceMappingURL=addParticles.js.map