import '../../globals.js';
// Copyright 2021-2024, University of Colorado Boulder
/**
 * PhET-iO Type for three.js Quaternion type
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import IOType from '../../tandem/js/types/IOType.js';
import NumberIO from '../../tandem/js/types/NumberIO.js';
import mobius from './mobius.js';
const ThreeQuaternionIO = new IOType('ThreeQuaternionIO', {
    valueType: THREE.Quaternion,
    documentation: 'A numerical object representing a quaternion',
    toStateObject: (quaternion) => {
        return {
            x: quaternion.x,
            y: quaternion.y,
            z: quaternion.z,
            w: quaternion.w
        };
    },
    stateSchema: {
        x: NumberIO,
        y: NumberIO,
        z: NumberIO,
        w: NumberIO
    },
    fromStateObject: (stateObject) => {
        return new THREE.Quaternion(stateObject.x, stateObject.y, stateObject.z, stateObject.w);
    },
    applyState: (quaternion, obj) => {
        quaternion.set(obj.x, obj.y, obj.z, obj.w);
    },
    stateObjectToCreateElementArguments: (obj) => [obj.x, obj.y, obj.z, obj.w]
});
mobius.register('ThreeQuaternionIO', ThreeQuaternionIO);
export default ThreeQuaternionIO;
//# sourceMappingURL=ThreeQuaternionIO.js.map