import Vector3 from "../../../../core/geom/Vector3.js";

const v3_scratch_0 = new Vector3();
const v3_scratch_1 = new Vector3();

/**
 *
 * @param {Quaternion} output
 * @param {Quaternion} input
 */
export function quaternion_invert_orientation(output, input) {
    const forward = v3_scratch_0;
    const up = v3_scratch_1;

    forward.copy(Vector3.forward);
    up.copy(Vector3.up);

    forward.applyQuaternion(input);
    up.applyQuaternion(input);

    // point in the opposite direction
    forward.negate();

    output.lookRotation(
        forward, up
    );
}
