import { BoundValueWriter } from "./BoundValueWriter.js";

export class BoundQuaternionWriter extends BoundValueWriter {
    /**
     *
     * @type {Quaternion|null}
     */
    #quaternion = null

    /**
     *
     * @param {Quaternion} quaternion
     */
    constructor(quaternion) {
        super();

        this.#quaternion = quaternion;
    }

    write(data) {
        this.#quaternion.fromArray(data);
        this.#quaternion.normalize();
    }
}