"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.animateSimulateTick = void 0;
const ANIMATION_C_1 = require("./ANIMATION_C");
const animateSimulateTick = (n0, n1, ff, tick) => {
    let ended = true;
    for (const [prop, threshold] of ff) {
        const tickProp = (n0, n, prop) => {
            const dp = n[prop] - n0[prop];
            if (Math.abs(dp) > threshold) {
                ended = false;
                n0[prop] += dp / (3 * ANIMATION_C_1.ANIMATION_C);
            }
            else {
                n0[prop] = n[prop];
            }
        };
        if (Array.isArray(n0[prop])) {
            for (let i = 0; i < n0[prop].length; i++) {
                tickProp(n0[prop], n1[prop], `${i}`);
            }
        }
        else {
            tickProp(n0, n1, prop);
        }
    }
    tick(n0);
    return ended;
};
exports.animateSimulateTick = animateSimulateTick;
//# sourceMappingURL=animateSimulateTick.js.map