export class ForceModule {
    name = "ForceModule";
    force;
    constructor(force) {
        this.force = force;
    }
    update(particle, context) {
        const force = typeof this.force === "function" ? this.force(particle, context) : this.force;
        particle.velocity.x += force.x * context.deltaTime;
        particle.velocity.y += force.y * context.deltaTime;
        particle.velocity.z += force.z * context.deltaTime;
    }
}
export function gravityForce(gravity = -9.81) {
    return new ForceModule({ x: 0, y: gravity, z: 0 });
}
//# sourceMappingURL=ForceModule.js.map