import { scaleToVec3 } from '@hiberworld/code-kit';
import { getPrefab } from '.';
/**
 * Get a flat surface with an image.
 * @example
 * ```
const img = getImage({ src: 'https://cdn.hibervr.com/demo/img/Lunch.jpg', ratio: 1000 / 750 });
addTo(root, img);
 * ```
 */
export const getImage = (opt = {}) => {
    const sx = scaleToVec3(opt?.s)?.[0] ?? 1;
    const prefab = getPrefab({
        ...opt,
        s: [(opt?.ratio ?? 1) * sx, 1 * sx, 0.001],
    });
    const node = {
        ...prefab,
        remoteTexture: { textureUrl: opt.src ?? '' },
    };
    return node;
};
//# sourceMappingURL=getImage.js.map