{"version":3,"file":"trois.module.cdn.min.js","sources":["../src/tools.ts","../src/core/useRaycaster.ts","../src/core/usePointer.ts","../src/core/useThree.ts","../src/core/Renderer.ts","../src/core/Camera.ts","../src/core/OrthographicCamera.ts","../src/core/PerspectiveCamera.ts","../src/core/Scene.ts","../src/core/Object3D.ts","../src/core/Group.ts","../src/core/Raycaster.ts","../src/core/CubeCamera.ts","../src/meshes/Mesh.ts","../src/geometries/Geometry.ts","../src/geometries/BoxGeometry.ts","../src/geometries/CircleGeometry.ts","../src/geometries/ConeGeometry.ts","../src/geometries/CylinderGeometry.ts","../src/geometries/DodecahedronGeometry.ts","../src/geometries/IcosahedronGeometry.ts","../src/geometries/LatheGeometry.ts","../src/geometries/OctahedronGeometry.ts","../src/geometries/PlaneGeometry.ts","../src/geometries/PolyhedronGeometry.ts","../src/geometries/RingGeometry.ts","../src/geometries/SphereGeometry.ts","../src/geometries/TetrahedronGeometry.ts","../src/geometries/TorusGeometry.ts","../src/geometries/TorusKnotGeometry.ts","../src/geometries/TubeGeometry.ts","../src/lights/Light.ts","../src/lights/AmbientLight.ts","../src/lights/DirectionalLight.ts","../src/lights/HemisphereLight.ts","../src/lights/PointLight.ts","../src/lights/RectAreaLight.ts","../src/lights/SpotLight.ts","../src/materials/Material.ts","../src/materials/BasicMaterial.ts","../src/materials/LambertMaterial.ts","../src/materials/MatcapMaterial.ts","../src/materials/PhongMaterial.ts","../src/materials/StandardMaterial.ts","../src/materials/PhysicalMaterial.ts","../src/materials/ShaderMaterial.ts","../src/materials/SubsurfaceScatteringShader.ts","../src/materials/SubSurfaceMaterial.ts","../src/materials/ToonMaterial.ts","../src/materials/Texture.ts","../src/materials/CubeTexture.ts","../src/materials/PointsMaterial.ts","../src/meshes/Box.ts","../src/meshes/Circle.ts","../src/meshes/Cone.ts","../src/meshes/Cylinder.ts","../src/meshes/Dodecahedron.ts","../src/meshes/Icosahedron.ts","../src/meshes/Lathe.ts","../src/meshes/Octahedron.ts","../src/meshes/Plane.ts","../src/meshes/Polyhedron.ts","../src/meshes/Ring.ts","../src/meshes/Sphere.ts","../src/meshes/Tetrahedron.ts","../src/meshes/Text.ts","../src/meshes/Torus.ts","../src/meshes/TorusKnot.ts","../src/meshes/Tube.ts","../src/meshes/Image.ts","../src/meshes/InstancedMesh.ts","../src/meshes/Sprite.ts","../src/meshes/Points.ts","../src/models/Model.ts","../src/models/GLTF.ts","../src/models/FBX.ts","../src/effects/EffectComposer.ts","../src/effects/EffectPass.ts","../src/effects/RenderPass.ts","../src/effects/BokehPass.ts","../src/effects/FilmPass.ts","../src/effects/FXAAPass.ts","../src/effects/HalftonePass.ts","../src/effects/SMAAPass.ts","../src/effects/SSAOPass.ts","../src/shaders/default.ts","../src/shaders/TiltShift.ts","../src/effects/TiltShiftPass.ts","../src/effects/UnrealBloomPass.ts","../src/shaders/ZoomBlur.ts","../src/effects/ZoomBlurPass.ts","../src/plugin.ts","../src/use/useTextures.ts"],"sourcesContent":["import { toRef, watch } from 'vue'\n\nexport function setFromProp(o: Record, prop: Record): void {\n if (prop instanceof Object) {\n Object.entries(prop).forEach(([key, value]) => {\n o[key] = value\n })\n }\n}\n\nexport function bindProps(src: any, props: string[], dst: any): void {\n props.forEach(prop => {\n bindProp(src, prop, dst, prop)\n })\n}\n\nexport function bindProp(src: any, srcProp: string, dst: any, dstProp?: string): void {\n const _dstProp = dstProp || srcProp\n const ref = toRef(src, srcProp)\n if (ref.value instanceof Object) {\n setFromProp(dst[_dstProp], ref.value)\n watch(ref, (value) => { setFromProp(dst[_dstProp], value) }, { deep: true })\n } else {\n if (ref.value) dst[_dstProp] = src[srcProp]\n watch(ref, (value) => { dst[_dstProp] = value })\n }\n}\n\nexport function propsValues(props: Record, exclude: string[] = []): Record {\n const values: Record = {}\n Object.entries(props).forEach(([key, value]) => {\n if (!exclude || (exclude && !exclude.includes(key))) {\n values[key] = value\n }\n })\n return values\n}\n\nexport function lerp(value1: number, value2: number, amount: number): number {\n amount = amount < 0 ? 0 : amount\n amount = amount > 1 ? 1 : amount\n return value1 + (value2 - value1) * amount\n}\n\nexport function limit(val: number, min: number, max: number): number {\n return val < min ? min : (val > max ? max : val)\n}\n\n// from https://github.com/pmndrs/drei/blob/master/src/useMatcapTexture.tsx\nconst MATCAP_ROOT = 'https://rawcdn.githack.com/emmelleppi/matcaps/9b36ccaaf0a24881a39062d05566c9e92be4aa0d'\nconst DEFAULT_MATCAP = '0404E8_0404B5_0404CB_3333FC'\n\nexport function getMatcapUrl(hash = DEFAULT_MATCAP, format = 1024): string {\n const fileName = `${hash}${getMatcapFormatString(format)}.png`\n return `${MATCAP_ROOT}/${format}/${fileName}`\n}\n\nfunction getMatcapFormatString(format: number) {\n switch (format) {\n case 64:\n return '-64px'\n case 128:\n return '-128px'\n case 256:\n return '-256px'\n case 512:\n return '-512px'\n default:\n return ''\n }\n}\n","import { Camera, Intersection, Plane, Raycaster, Vector2, Vector3 } from 'three'\nimport { IntersectObject } from './usePointer'\n\nexport interface RaycasterInterface {\n position: Vector3\n updatePosition(coords: Vector2): void\n intersect(coords: Vector2, objects: IntersectObject[]): Intersection[],\n}\n\nexport interface RaycasterConfigInterface {\n camera: Camera\n resetPosition?: Vector3\n}\n\nexport default function useRaycaster(options: RaycasterConfigInterface): RaycasterInterface {\n const {\n camera,\n resetPosition = new Vector3(0, 0, 0),\n } = options\n\n const raycaster = new Raycaster()\n const position = resetPosition.clone()\n const plane = new Plane(new Vector3(0, 0, 1), 0)\n\n const updatePosition = (coords: Vector2) => {\n raycaster.setFromCamera(coords, camera)\n camera.getWorldDirection(plane.normal)\n raycaster.ray.intersectPlane(plane, position)\n }\n\n const intersect = (coords: Vector2, objects: IntersectObject[]) => {\n raycaster.setFromCamera(coords, camera)\n return raycaster.intersectObjects(objects)\n }\n\n return {\n position,\n updatePosition,\n intersect,\n }\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { Camera, InstancedMesh, Intersection, Mesh, Vector2, Vector3 } from 'three'\nimport useRaycaster from './useRaycaster'\n\nexport interface PointerEventInterface {\n type: 'pointerenter' | 'pointermove' | 'pointerleave' | 'click'\n position?: Vector2\n positionN?: Vector2\n positionV3?: Vector3\n}\n\nexport interface PointerIntersectEventInterface {\n type: 'pointerenter' | 'pointerover' | 'pointermove' | 'pointerleave' | 'click'\n component: any\n over?: boolean\n intersect?: Intersection\n}\n\nexport type PointerCallbackType = (e: PointerEventInterface) => void\nexport type PointerIntersectCallbackType = (e: PointerIntersectEventInterface) => void\nexport type IntersectObject = Mesh | InstancedMesh\n\nexport interface PointerPublicConfigInterface {\n intersectMode?: 'frame'\n touch?: boolean\n resetOnEnd?: boolean\n resetPosition?: Vector2\n resetPositionV3?: Vector3\n onEnter?: PointerCallbackType\n onMove?: PointerCallbackType\n onLeave?: PointerCallbackType\n onClick?: PointerCallbackType\n onIntersectEnter?: PointerIntersectCallbackType\n onIntersectOver?: PointerIntersectCallbackType\n onIntersectMove?: PointerIntersectCallbackType\n onIntersectLeave?: PointerIntersectCallbackType\n onIntersectClick?: PointerIntersectCallbackType\n}\n\nexport interface PointerConfigInterface extends PointerPublicConfigInterface {\n camera: Camera\n domElement: HTMLCanvasElement\n intersectObjects: IntersectObject[]\n}\n\nexport interface PointerInterface {\n position: Vector2\n positionN: Vector2\n positionV3: Vector3\n intersectObjects: IntersectObject[]\n listeners: boolean\n addListeners(cb: void): void\n removeListeners(cb: void): void\n intersect(): void\n}\n\nexport default function usePointer(options: PointerConfigInterface): PointerInterface {\n const {\n camera,\n domElement,\n intersectObjects,\n touch = true,\n resetOnEnd = false,\n resetPosition = new Vector2(0, 0),\n resetPositionV3 = new Vector3(0, 0, 0),\n onEnter = () => {},\n onMove = () => {},\n onLeave = () => {},\n onClick = () => {},\n onIntersectEnter = () => {},\n onIntersectOver = () => {},\n onIntersectMove = () => {},\n onIntersectLeave = () => {},\n onIntersectClick = () => {},\n } = options\n\n const position = resetPosition.clone()\n const positionN = new Vector2(0, 0)\n\n const raycaster = useRaycaster({ camera })\n const positionV3 = raycaster.position\n\n const obj: PointerInterface = {\n position,\n positionN,\n positionV3,\n intersectObjects,\n listeners: false,\n addListeners,\n removeListeners,\n intersect,\n }\n\n return obj\n\n function reset() {\n position.copy(resetPosition)\n positionV3.copy(resetPositionV3)\n }\n\n function updatePosition(event: TouchEvent | MouseEvent) {\n let x, y\n // @ts-ignore\n if (event.touches && event.touches.length > 0) {\n x = (event).touches[0].clientX\n y = (event).touches[0].clientY\n } else {\n x = (event).clientX\n y = (event).clientY\n }\n\n const rect = domElement.getBoundingClientRect()\n position.x = x - rect.left\n position.y = y - rect.top\n positionN.x = (position.x / rect.width) * 2 - 1\n positionN.y = -(position.y / rect.height) * 2 + 1\n raycaster.updatePosition(positionN)\n }\n\n function intersect() {\n if (intersectObjects.length) {\n const intersects = raycaster.intersect(positionN, intersectObjects)\n const offObjects: IntersectObject[] = [...intersectObjects]\n const iMeshes: InstancedMesh[] = []\n\n intersects.forEach(intersect => {\n const { object } = intersect\n const { component } = object.userData\n\n // only once for InstancedMesh\n if (object instanceof InstancedMesh) {\n if (iMeshes.indexOf(object) !== -1) return\n iMeshes.push(object)\n }\n\n if (!object.userData.over) {\n object.userData.over = true\n const overEvent: PointerIntersectEventInterface = { type: 'pointerover', over: true, component, intersect }\n const enterEvent: PointerIntersectEventInterface = { ...overEvent, type: 'pointerenter' }\n onIntersectOver(overEvent)\n onIntersectEnter(enterEvent)\n component.onPointerOver?.(overEvent)\n component.onPointerEnter?.(enterEvent)\n }\n\n const moveEvent: PointerIntersectEventInterface = { type: 'pointermove', component, intersect }\n onIntersectMove(moveEvent)\n component.onPointerMove?.(moveEvent)\n\n offObjects.splice(offObjects.indexOf((object)), 1)\n })\n\n offObjects.forEach(object => {\n const { component } = object.userData\n if (object.userData.over) {\n object.userData.over = false\n const overEvent: PointerIntersectEventInterface = { type: 'pointerover', over: false, component }\n const leaveEvent: PointerIntersectEventInterface = { ...overEvent, type: 'pointerleave' }\n onIntersectOver(overEvent)\n onIntersectLeave(leaveEvent)\n component.onPointerOver?.(overEvent)\n component.onPointerLeave?.(leaveEvent)\n }\n })\n }\n }\n\n function pointerEnter(event: TouchEvent | MouseEvent) {\n updatePosition(event)\n onEnter({ type: 'pointerenter', position, positionN, positionV3 })\n }\n\n function pointerMove(event: TouchEvent | MouseEvent) {\n updatePosition(event)\n onMove({ type: 'pointermove', position, positionN, positionV3 })\n intersect()\n }\n\n function pointerClick(event: TouchEvent | MouseEvent) {\n updatePosition(event)\n if (intersectObjects.length) {\n const intersects = raycaster.intersect(positionN, intersectObjects)\n const iMeshes: InstancedMesh[] = []\n intersects.forEach(intersect => {\n const { object } = intersect\n const { component } = object.userData\n\n // only once for InstancedMesh\n if (object instanceof InstancedMesh) {\n if (iMeshes.indexOf(object) !== -1) return\n iMeshes.push(object)\n }\n\n const event: PointerIntersectEventInterface = { type: 'click', component, intersect }\n onIntersectClick(event)\n component.onClick?.(event)\n })\n }\n onClick({ type: 'click', position, positionN, positionV3 })\n }\n\n function pointerLeave() {\n if (resetOnEnd) reset()\n onLeave({ type: 'pointerleave' })\n }\n\n function addListeners() {\n domElement.addEventListener('mouseenter', pointerEnter)\n domElement.addEventListener('mousemove', pointerMove)\n domElement.addEventListener('mouseleave', pointerLeave)\n domElement.addEventListener('click', pointerClick)\n if (touch) {\n domElement.addEventListener('touchstart', pointerEnter)\n domElement.addEventListener('touchmove', pointerMove)\n domElement.addEventListener('touchend', pointerLeave)\n }\n obj.listeners = true\n }\n\n function removeListeners() {\n domElement.removeEventListener('mouseenter', pointerEnter)\n domElement.removeEventListener('mousemove', pointerMove)\n domElement.removeEventListener('mouseleave', pointerLeave)\n domElement.removeEventListener('click', pointerClick)\n\n domElement.removeEventListener('touchstart', pointerEnter)\n domElement.removeEventListener('touchmove', pointerMove)\n domElement.removeEventListener('touchend', pointerLeave)\n obj.listeners = false\n }\n}\n","import { Camera, OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from 'three'\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'\nimport { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'\nimport usePointer, { IntersectObject, PointerConfigInterface, PointerPublicConfigInterface, PointerInterface } from './usePointer'\n\nexport interface SizeInterface {\n width: number\n height: number\n wWidth: number\n wHeight: number\n ratio: number\n}\n\nexport interface ThreeConfigInterface {\n canvas?: HTMLCanvasElement\n antialias: boolean\n alpha: boolean\n autoClear: boolean\n orbitCtrl: boolean | Record\n pointer: boolean | PointerPublicConfigInterface\n resize: boolean | string\n width?: number\n height?: number\n onResize?(size: SizeInterface): void\n [index:string]: any\n}\n\nexport interface ThreeInterface {\n config: ThreeConfigInterface\n renderer: WebGLRenderer\n composer?: EffectComposer\n camera?: Camera\n cameraCtrl?: OrbitControls\n scene?: Scene\n pointer?: PointerInterface\n size: SizeInterface\n init(): boolean\n dispose(): void\n render(): void\n renderC(): void\n setSize(width: number, height: number): void\n addIntersectObject(o: IntersectObject): void\n removeIntersectObject(o: IntersectObject): void\n}\n\n/**\n * Three.js helper\n */\nexport default function useThree(params: ThreeConfigInterface): ThreeInterface {\n // default config\n const config: ThreeConfigInterface = {\n antialias: true,\n alpha: false,\n autoClear: true,\n orbitCtrl: false,\n pointer: false,\n resize: false,\n width: 300,\n height: 150,\n }\n\n if (params) {\n Object.entries(params).forEach(([key, value]) => {\n config[key] = value\n })\n }\n\n // size\n const size: SizeInterface = {\n width: 1, height: 1,\n wWidth: 1, wHeight: 1,\n ratio: 1,\n }\n\n const beforeRenderCallbacks: {(): void}[] = []\n\n const intersectObjects: IntersectObject[] = []\n\n const renderer = createRenderer()\n\n // returned object\n const obj: ThreeInterface = {\n config,\n renderer,\n size,\n init,\n dispose,\n render,\n renderC,\n setSize,\n addIntersectObject, removeIntersectObject,\n }\n\n return obj\n\n /**\n * create WebGLRenderer\n */\n function createRenderer(): WebGLRenderer {\n const renderer = new WebGLRenderer({ canvas: config.canvas, antialias: config.antialias, alpha: config.alpha })\n renderer.autoClear = config.autoClear\n return renderer\n }\n\n /**\n * init three\n */\n function init() {\n if (!obj.scene) {\n console.error('Missing Scene')\n return false\n }\n\n if (!obj.camera) {\n console.error('Missing Camera')\n return false\n }\n\n if (config.resize) {\n onResize()\n window.addEventListener('resize', onResize)\n } else if (config.width && config.height) {\n setSize(config.width, config.height)\n }\n\n initPointer()\n\n if (config.orbitCtrl) {\n const cameraCtrl = new OrbitControls(obj.camera, obj.renderer.domElement)\n if (config.orbitCtrl instanceof Object) {\n Object.entries(config.orbitCtrl).forEach(([key, value]) => {\n // @ts-ignore\n cameraCtrl[key] = value\n })\n }\n onBeforeRender(() => { cameraCtrl.update() })\n obj.cameraCtrl = cameraCtrl\n }\n\n return true\n }\n\n /**\n * init pointer\n */\n function initPointer() {\n let pointerConf: PointerConfigInterface = {\n camera: obj.camera!,\n domElement: obj.renderer!.domElement,\n intersectObjects,\n }\n\n if (config.pointer && config.pointer instanceof Object) {\n pointerConf = { ...pointerConf, ...config.pointer }\n }\n\n const pointer = obj.pointer = usePointer(pointerConf)\n if (config.pointer || intersectObjects.length) {\n pointer.addListeners()\n if (pointerConf.intersectMode === 'frame') {\n onBeforeRender(pointer.intersect)\n }\n }\n }\n\n /**\n * add before render callback\n */\n function onBeforeRender(cb: {(): void}) {\n beforeRenderCallbacks.push(cb)\n }\n\n /**\n * default render\n */\n function render() {\n // if (obj.cameraCtrl) obj.cameraCtrl.update()\n beforeRenderCallbacks.forEach(c => c())\n obj.renderer!.render(obj.scene!, obj.camera!)\n }\n\n /**\n * composer render\n */\n function renderC() {\n // if (obj.cameraCtrl) obj.cameraCtrl.update()\n beforeRenderCallbacks.forEach(c => c())\n obj.composer!.render()\n }\n\n /**\n * add intersect object\n */\n function addIntersectObject(o: IntersectObject) {\n if (intersectObjects.indexOf(o) === -1) {\n intersectObjects.push(o)\n }\n // add listeners if needed\n if (obj.pointer && !obj.pointer.listeners) {\n obj.pointer.addListeners()\n }\n }\n\n /**\n * remove intersect object\n */\n function removeIntersectObject(o: IntersectObject) {\n const i = intersectObjects.indexOf(o)\n if (i !== -1) {\n intersectObjects.splice(i, 1)\n }\n // remove listeners if needed\n if (obj.pointer && !config.pointer && intersectObjects.length === 0) {\n obj.pointer.removeListeners()\n }\n }\n\n /**\n * remove listeners and dispose\n */\n function dispose() {\n // beforeRenderCallbacks = []\n window.removeEventListener('resize', onResize)\n if (obj.pointer) obj.pointer.removeListeners()\n if (obj.cameraCtrl) obj.cameraCtrl.dispose()\n if (obj.renderer) obj.renderer.dispose()\n }\n\n /**\n * resize listener\n */\n function onResize() {\n if (config.resize === 'window') {\n setSize(window.innerWidth, window.innerHeight)\n } else {\n const elt = obj.renderer!.domElement.parentNode as Element\n if (elt) setSize(elt.clientWidth, elt.clientHeight)\n }\n config.onResize?.(size)\n }\n\n /**\n * update renderer size and camera\n */\n function setSize(width: number, height: number) {\n size.width = width\n size.height = height\n size.ratio = width / height\n\n obj.renderer!.setSize(width, height, false)\n\n // already done in EffectComposer\n // if (obj.composer) {\n // obj.composer.setSize(width, height)\n // }\n\n const camera = (obj.camera!)\n if (camera.type === 'PerspectiveCamera') {\n const pCamera = (camera)\n pCamera.aspect = size.ratio\n pCamera.updateProjectionMatrix()\n }\n\n if (camera.type === 'OrthographicCamera') {\n const oCamera = (camera)\n size.wWidth = oCamera.right - oCamera.left\n size.wHeight = oCamera.top - oCamera.bottom\n } else {\n const wsize = getCameraSize()\n size.wWidth = wsize[0]\n size.wHeight = wsize[1]\n }\n }\n\n /**\n * calculate camera visible area size\n */\n function getCameraSize() {\n const camera = (obj.camera!)\n const vFOV = (camera.fov * Math.PI) / 180\n const h = 2 * Math.tan(vFOV / 2) * Math.abs(camera.position.z)\n const w = h * camera.aspect\n return [w, h]\n }\n}\n","/* eslint-disable no-use-before-define */\nimport { Camera, NoToneMapping, PCFShadowMap, Scene, WebGLRenderer } from 'three'\nimport { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer'\nimport { defineComponent, InjectionKey, PropType } from 'vue'\nimport { bindProp } from '../tools'\nimport { PointerPublicConfigInterface } from './usePointer'\nimport useThree, { SizeInterface, ThreeConfigInterface, ThreeInterface } from './useThree'\n\ntype CallbackType = (event: T) => void\n\n// type EventType = 'init' | 'mounted' | 'beforerender' | 'afterrender' | 'resize'\n\nexport interface EventInterface {\n type: 'init' | 'mounted'\n renderer: RendererInterface\n}\n\nexport interface RenderEventInterface {\n type: 'beforerender' | 'afterrender'\n renderer: RendererInterface\n time: number\n}\n\nexport interface ResizeEventInterface {\n type: 'resize'\n renderer: RendererInterface\n size: SizeInterface\n}\n\ntype InitCallbackType = CallbackType\ntype MountedCallbackType = CallbackType\ntype RenderCallbackType = CallbackType\ntype ResizeCallbackType = CallbackType\n// type CallbackTypes = InitCallbackType | MountedCallbackType | RenderCallbackType | ResizeCallbackType\n\n// interface EventMap {\n// 'init': EventInterface;\n// 'mounted': EventInterface;\n// 'beforerender': RenderEventInterface;\n// 'afterrender': RenderEventInterface;\n// 'resize': ResizeEventInterface;\n// }\n\ninterface EventCallbackMap {\n 'init': InitCallbackType;\n 'mounted': MountedCallbackType;\n 'beforerender': RenderCallbackType;\n 'afterrender': RenderCallbackType;\n 'resize': ResizeCallbackType;\n}\n\ninterface RenderFunctionEventInterface {\n renderer: RendererInterface\n time: number\n}\n\ninterface RendererSetupInterface {\n canvas: HTMLCanvasElement\n three: ThreeInterface\n renderer: WebGLRenderer\n size: SizeInterface\n renderFn(e: RenderFunctionEventInterface): void\n raf: boolean\n\n // pointerPosition?: Vector2\n // pointerPositionN?: Vector2\n // pointerPositionV3?: Vector3\n\n initCallbacks: InitCallbackType[]\n mountedCallbacks: MountedCallbackType[]\n beforeRenderCallbacks: RenderCallbackType[]\n afterRenderCallbacks: RenderCallbackType[]\n resizeCallbacks: ResizeCallbackType[]\n}\n\nexport interface RendererInterface extends RendererSetupInterface {\n scene?: Scene\n camera?: Camera\n composer?: EffectComposer\n\n onInit(cb: InitCallbackType): void\n onMounted(cb: MountedCallbackType): void\n\n onBeforeRender(cb: RenderCallbackType): void\n offBeforeRender(cb: RenderCallbackType): void\n onAfterRender(cb: RenderCallbackType): void\n offAfterRender(cb: RenderCallbackType): void\n\n onResize(cb: ResizeCallbackType): void\n offResize(cb: ResizeCallbackType): void\n\n addListener(t: T, cb: EventCallbackMap[T]): void\n removeListener(t: T, cb: EventCallbackMap[T]): void\n}\n\nexport const RendererInjectionKey: InjectionKey = Symbol('Renderer')\n\nexport default defineComponent({\n name: 'Renderer',\n props: {\n antialias: Boolean,\n alpha: Boolean,\n autoClear: { type: Boolean, default: true },\n orbitCtrl: { type: [Boolean, Object] as PropType>, default: false },\n pointer: { type: [Boolean, Object] as PropType, default: false },\n resize: { type: [Boolean, String] as PropType, default: false },\n shadow: Boolean,\n shadowType: { type: Number, default: PCFShadowMap },\n toneMapping: { type: Number, default: NoToneMapping },\n width: String,\n height: String,\n xr: Boolean,\n onReady: Function as PropType<(r: RendererInterface) => void>,\n onClick: Function as PropType<(this: HTMLCanvasElement, ev: MouseEvent) => any>,\n },\n setup(props): RendererSetupInterface {\n const initCallbacks: InitCallbackType[] = []\n const mountedCallbacks: MountedCallbackType[] = []\n const beforeRenderCallbacks: RenderCallbackType[] = []\n const afterRenderCallbacks: RenderCallbackType[] = []\n const resizeCallbacks: ResizeCallbackType[] = []\n\n const canvas = document.createElement('canvas')\n const config: ThreeConfigInterface = {\n canvas,\n antialias: props.antialias,\n alpha: props.alpha,\n autoClear: props.autoClear,\n orbitCtrl: props.orbitCtrl,\n pointer: props.pointer,\n resize: props.resize,\n }\n\n if (props.width) config.width = parseInt(props.width)\n if (props.height) config.height = parseInt(props.height)\n\n const three = useThree(config)\n bindProp(props, 'toneMapping', three.renderer)\n\n const renderFn: {(): void} = () => {}\n\n // we have to handle canvas events ourself (it is not rendered by vue)\n if (props.onClick) {\n canvas.addEventListener('click', props.onClick)\n }\n\n return {\n canvas,\n three,\n renderer: three.renderer,\n size: three.size,\n renderFn,\n raf: true,\n initCallbacks,\n mountedCallbacks,\n beforeRenderCallbacks,\n afterRenderCallbacks,\n resizeCallbacks,\n }\n },\n computed: {\n camera: {\n get: function(): Camera | undefined { return this.three.camera },\n set: function(camera: Camera): void { this.three.camera = camera },\n },\n scene: {\n get: function(): Scene | undefined { return this.three.scene },\n set: function(scene: Scene): void { this.three.scene = scene },\n },\n composer: {\n get: function(): EffectComposer | undefined { return this.three.composer },\n set: function(composer: EffectComposer): void { this.three.composer = composer },\n },\n },\n provide() {\n return {\n [RendererInjectionKey as symbol]: this,\n }\n },\n mounted() {\n // appendChild won't work on reload\n this.$el.parentNode.insertBefore(this.canvas, this.$el)\n\n if (this.three.init()) {\n // if (this.three.pointer) {\n // this.pointerPosition = this.three.pointer.position\n // this.pointerPositionN = this.three.pointer.positionN\n // this.pointerPositionV3 = this.three.pointer.positionV3\n // }\n\n // TODO : don't use config\n this.three.config.onResize = (size) => {\n this.resizeCallbacks.forEach(e => e({ type: 'resize', renderer: this, size }))\n }\n\n if (this.shadow) {\n this.renderer.shadowMap.enabled = true\n this.renderer.shadowMap.type = this.shadowType\n }\n\n this.renderFn = this.three.composer ? this.three.renderC : this.three.render\n\n this.initCallbacks.forEach(e => e({ type: 'init', renderer: this }))\n this.onReady?.(this as RendererInterface)\n\n if (this.xr) {\n this.renderer.xr.enabled = true\n this.renderer.setAnimationLoop(this.render)\n } else {\n requestAnimationFrame(this.renderLoop)\n }\n }\n\n this.mountedCallbacks.forEach(e => e({ type: 'mounted', renderer: this }))\n },\n beforeUnmount() {\n this.canvas.remove()\n this.beforeRenderCallbacks = []\n this.afterRenderCallbacks = []\n this.raf = false\n this.three.dispose()\n },\n methods: {\n onInit(cb: InitCallbackType) { this.addListener('init', cb) },\n onMounted(cb: MountedCallbackType) { this.addListener('mounted', cb) },\n onBeforeRender(cb: RenderCallbackType) { this.addListener('beforerender', cb) },\n offBeforeRender(cb: RenderCallbackType) { this.removeListener('beforerender', cb) },\n onAfterRender(cb: RenderCallbackType) { this.addListener('afterrender', cb) },\n offAfterRender(cb: RenderCallbackType) { this.removeListener('afterrender', cb) },\n onResize(cb: ResizeCallbackType) { this.addListener('resize', cb) },\n offResize(cb: ResizeCallbackType) { this.removeListener('resize', cb) },\n\n addListener(type: string, cb: {(e?: any): void}) {\n const callbacks = this.getCallbacks(type)\n callbacks.push(cb)\n },\n\n removeListener(type: string, cb: {(e?: any): void}) {\n const callbacks = this.getCallbacks(type)\n const index = callbacks.indexOf(cb)\n if (index) callbacks.splice(index, 1)\n },\n\n getCallbacks(type: string) {\n if (type === 'init') {\n return this.initCallbacks\n } else if (type === 'mounted') {\n return this.mountedCallbacks\n } else if (type === 'beforerender') {\n return this.beforeRenderCallbacks\n } else if (type === 'afterrender') {\n return this.afterRenderCallbacks\n } else {\n return this.resizeCallbacks\n }\n },\n\n render(time: number) {\n this.beforeRenderCallbacks.forEach(e => e({ type: 'beforerender', renderer: this, time }))\n // this.onFrame?.(cbParams)\n this.renderFn({ renderer: this, time })\n this.afterRenderCallbacks.forEach(e => e({ type: 'afterrender', renderer: this, time }))\n },\n renderLoop(time: number) {\n if (this.raf) requestAnimationFrame(this.renderLoop)\n this.render(time)\n },\n },\n render() {\n return this.$slots.default ? this.$slots.default() : []\n },\n __hmrId: 'Renderer',\n})\n","import { defineComponent } from 'vue'\n// import { Camera } from 'three'\n// import { RendererInjectionKey, RendererInterface } from './Renderer'\n// import Object3D from './Object3D'\n\n// export interface CameraSetupInterface {\n// renderer?: RendererInterface\n// camera: Camera\n// }\n\nexport default defineComponent({\n // TODO: eventually extend Object3D\n // extends: Object3D,\n\n // inject: { renderer: RendererInjectionKey as symbol },\n\n // setup(): CameraSetupInterface {\n // return {}\n // },\n\n render() {\n return this.$slots.default ? this.$slots.default() : []\n },\n})\n","import { defineComponent, inject, PropType, watch } from 'vue'\nimport { OrthographicCamera } from 'three'\nimport { bindProp } from '../tools'\nimport Camera from './Camera'\nimport { Vector3PropInterface } from './Object3D'\nimport { RendererInjectionKey } from './Renderer'\n\nexport default defineComponent({\n extends: Camera,\n name: 'OrthographicCamera',\n props: {\n left: { type: Number, default: -1 },\n right: { type: Number, default: 1 },\n top: { type: Number, default: 1 },\n bottom: { type: Number, default: -1 },\n near: { type: Number, default: 0.1 },\n far: { type: Number, default: 2000 },\n zoom: { type: Number, default: 1 },\n position: { type: Object as PropType, default: () => ({ x: 0, y: 0, z: 0 }) },\n },\n setup(props) {\n const renderer = inject(RendererInjectionKey)\n if (!renderer) {\n console.error('Renderer not found')\n return\n }\n\n const camera = new OrthographicCamera(props.left, props.right, props.top, props.bottom, props.near, props.far)\n renderer.camera = camera\n\n bindProp(props, 'position', camera)\n\n const watchProps = ['left', 'right', 'top', 'bottom', 'near', 'far', 'zoom']\n watchProps.forEach(p => {\n // @ts-ignore\n watch(() => props[p], (value) => {\n // @ts-ignore\n camera[p] = value\n camera.updateProjectionMatrix()\n })\n })\n\n return { renderer, camera }\n },\n __hmrId: 'OrthographicCamera',\n})\n","import { defineComponent, inject, PropType, watch } from 'vue'\nimport { PerspectiveCamera } from 'three'\nimport { bindProp } from '../tools'\nimport Camera from './Camera'\nimport { Vector3PropInterface } from './Object3D'\nimport { RendererInjectionKey } from './Renderer'\n\nexport default defineComponent({\n extends: Camera,\n name: 'PerspectiveCamera',\n props: {\n aspect: { type: Number, default: 1 },\n far: { type: Number, default: 2000 },\n fov: { type: Number, default: 50 },\n near: { type: Number, default: 0.1 },\n position: { type: Object as PropType, default: () => ({ x: 0, y: 0, z: 0 }) },\n lookAt: { type: Object as PropType, default: null },\n },\n setup(props) {\n const renderer = inject(RendererInjectionKey)\n if (!renderer) {\n console.error('Renderer not found')\n return\n }\n\n const camera = new PerspectiveCamera(props.fov, props.aspect, props.near, props.far)\n renderer.camera = camera\n\n bindProp(props, 'position', camera)\n\n if (props.lookAt) camera.lookAt(props.lookAt.x ?? 0, props.lookAt.y, props.lookAt.z)\n watch(() => props.lookAt, (v) => { camera.lookAt(v.x ?? 0, v.y, v.z) }, { deep: true })\n\n const watchProps = ['aspect', 'far', 'fov', 'near']\n watchProps.forEach(p => {\n // @ts-ignore\n watch(() => props[p], (value) => {\n // @ts-ignore\n camera[p] = value\n camera.updateProjectionMatrix()\n })\n })\n\n return { renderer, camera }\n },\n __hmrId: 'PerspectiveCamera',\n})\n","import { defineComponent, inject, InjectionKey, provide, watch } from 'vue'\nimport { Scene, Color, Object3D, Texture } from 'three'\nimport { RendererInjectionKey } from './Renderer'\n\nexport const SceneInjectionKey: InjectionKey = Symbol('Scene')\n\nexport default defineComponent({\n name: 'Scene',\n props: {\n background: [String, Number, Object],\n },\n setup(props) {\n const renderer = inject(RendererInjectionKey)\n const scene = new Scene()\n\n if (!renderer) {\n console.error('Renderer not found')\n return\n }\n\n renderer.scene = scene\n provide(SceneInjectionKey, scene)\n\n const setBackground = (value: any): void => {\n if (!value) return\n if (typeof value === 'string' || typeof value === 'number') {\n if (scene.background instanceof Color) scene.background.set(value)\n else scene.background = new Color(value)\n } else if (value instanceof Texture) {\n scene.background = value\n }\n }\n\n setBackground(props.background)\n watch(() => props.background, setBackground)\n\n const add = (o: Object3D): void => { scene.add(o) }\n const remove = (o: Object3D): void => { scene.remove(o) }\n\n return { scene, add, remove }\n },\n render() {\n return this.$slots.default ? this.$slots.default() : []\n },\n __hmrId: 'Scene',\n})\n","import { Object3D, Scene } from 'three'\nimport { ComponentPublicInstance, defineComponent, PropType, watch } from 'vue'\nimport { bindProp } from '../tools'\nimport { RendererInjectionKey, RendererInterface } from './Renderer'\nimport { SceneInjectionKey } from './Scene'\n\nexport interface Object3DSetupInterface {\n renderer?: RendererInterface\n scene?: Scene\n o3d?: Object3D\n parent?: ComponentPublicInstance\n}\n\nexport interface Object3DInterface extends Object3DSetupInterface {\n addToParent(o?: Object3D): boolean\n removeFromParent(o?: Object3D): boolean\n add(o: Object3D): void\n remove(o: Object3D): void\n}\n\n// export function object3DSetup(): Object3DSetupInterface {\n// const renderer = inject(RendererInjectionKey)\n// const scene = inject(SceneInjectionKey)\n// return { scene, renderer }\n// }\n\nexport interface Vector2PropInterface {\n x?: number\n y?: number\n}\n\nexport interface Vector3PropInterface extends Vector2PropInterface {\n z?: number\n}\n\nexport interface EulerPropInterface extends Vector3PropInterface {\n order?: 'XYZ' | 'YZX' | 'ZXY' | 'XZY' | 'YXZ' | 'ZYX'\n}\n\nexport default defineComponent({\n name: 'Object3D',\n // inject for sub components\n inject: {\n renderer: RendererInjectionKey as symbol,\n scene: SceneInjectionKey as symbol,\n },\n emits: ['created', 'ready'],\n props: {\n position: { type: Object as PropType, default: () => ({ x: 0, y: 0, z: 0 }) },\n rotation: { type: Object as PropType, default: () => ({ x: 0, y: 0, z: 0 }) },\n scale: { type: Object as PropType, default: () => ({ x: 1, y: 1, z: 1, order: 'XYZ' }) },\n lookAt: { type: Object as PropType, default: null },\n autoRemove: { type: Boolean, default: true },\n userData: { type: Object, default: () => ({}) },\n },\n setup(): Object3DSetupInterface {\n // return object3DSetup()\n return {}\n },\n created() {\n if (!this.renderer) {\n console.error('Missing parent Renderer')\n }\n if (!this.scene) {\n console.error('Missing parent Scene')\n }\n },\n unmounted() {\n if (this.autoRemove) this.removeFromParent()\n },\n methods: {\n initObject3D(o3d: Object3D) {\n this.o3d = o3d\n\n this.$emit('created', o3d)\n\n bindProp(this, 'position', o3d)\n bindProp(this, 'rotation', o3d)\n bindProp(this, 'scale', o3d)\n bindProp(this, 'userData', o3d.userData)\n\n if (this.lookAt) o3d.lookAt(this.lookAt.x ?? 0, this.lookAt.y, this.lookAt.z)\n watch(() => this.lookAt, (v) => { o3d.lookAt(v.x ?? 0, v.y, v.z) }, { deep: true })\n\n this.parent = this.getParent()\n if (this.addToParent()) this.$emit('ready', this)\n else console.error('Missing parent (Scene, Group...)')\n },\n getParent(): undefined | ComponentPublicInstance {\n let parent = this.$parent\n while (parent) {\n if ((parent as any).add) return parent\n parent = parent.$parent\n }\n return undefined\n },\n addToParent(o?: Object3D) {\n const o3d = o || this.o3d\n if (this.parent) {\n (this.parent as any).add(o3d)\n return true\n }\n return false\n },\n removeFromParent(o?: Object3D) {\n const o3d = o || this.o3d\n if (this.parent) {\n (this.parent as any).remove(o3d)\n return true\n }\n return false\n },\n add(o: Object3D) { this.o3d?.add(o) },\n remove(o: Object3D) { this.o3d?.remove(o) },\n },\n render() {\n return this.$slots.default ? this.$slots.default() : []\n },\n __hmrId: 'Object3D',\n})\n","import { defineComponent } from 'vue'\nimport { Group } from 'three'\nimport Object3D from './Object3D'\n\nexport default defineComponent({\n name: 'Group',\n extends: Object3D,\n setup() {\n return {\n group: new Group(),\n }\n },\n created() {\n this.initObject3D(this.group)\n },\n __hmrId: 'Group',\n})\n","import { Object3D } from 'three'\nimport { defineComponent, inject, PropType } from 'vue'\nimport usePointer, { IntersectObject, PointerInterface, PointerIntersectCallbackType } from './usePointer'\nimport { RendererInjectionKey, RendererInterface } from './Renderer'\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst emptyCallBack: PointerIntersectCallbackType = () => {}\n\ninterface RaycasterSetupInterface {\n renderer?: RendererInterface\n pointer?: PointerInterface\n}\n\nexport default defineComponent({\n name: 'Raycaster',\n props: {\n onPointerEnter: { type: Function as PropType, default: emptyCallBack },\n onPointerOver: { type: Function as PropType, default: emptyCallBack },\n onPointerMove: { type: Function as PropType, default: emptyCallBack },\n onPointerLeave: { type: Function as PropType, default: emptyCallBack },\n onClick: { type: Function as PropType, default: emptyCallBack },\n intersectMode: { type: String, default: 'move' },\n },\n setup(): RaycasterSetupInterface {\n const renderer = inject(RendererInjectionKey)\n return { renderer }\n },\n mounted() {\n if (!this.renderer) {\n console.error('Renderer not found')\n return\n }\n const renderer = this.renderer\n\n this.renderer.onMounted(() => {\n if (!renderer.camera) return\n\n this.pointer = usePointer({\n camera: renderer.camera,\n domElement: renderer.canvas,\n intersectObjects: this.getIntersectObjects(),\n onIntersectEnter: this.onPointerEnter,\n onIntersectOver: this.onPointerOver,\n onIntersectMove: this.onPointerMove,\n onIntersectLeave: this.onPointerLeave,\n onIntersectClick: this.onClick,\n })\n this.pointer.addListeners()\n\n if (this.intersectMode === 'frame') {\n renderer.onBeforeRender(this.pointer.intersect)\n }\n })\n },\n unmounted() {\n if (this.pointer) {\n this.pointer.removeListeners()\n this.renderer?.offBeforeRender(this.pointer.intersect)\n }\n },\n methods: {\n getIntersectObjects() {\n if (this.renderer && this.renderer.scene) {\n const children = this.renderer.scene.children.filter((c: Object3D) => ['Mesh', 'InstancedMesh'].includes(c.type))\n return children as IntersectObject[]\n }\n return []\n },\n },\n render() {\n return []\n },\n __hmrId: 'Raycaster',\n})\n","import { defineComponent, inject, onUnmounted } from 'vue'\r\nimport {\r\n CubeCamera,\r\n LinearMipmapLinearFilter,\r\n RGBFormat,\r\n WebGLCubeRenderTarget,\r\n} from 'three'\r\nimport Object3D from './Object3D'\r\nimport { RendererInjectionKey } from './Renderer'\r\n\r\nexport default defineComponent({\r\n extends: Object3D,\r\n props: {\r\n cubeRTSize: { type: Number, default: 256 },\r\n cubeCameraNear: { type: Number, default: 0.1 },\r\n cubeCameraFar: { type: Number, default: 2000 },\r\n autoUpdate: Boolean,\r\n },\r\n setup(props) {\r\n const rendererC = inject(RendererInjectionKey)\r\n if (!rendererC || !rendererC.scene) {\r\n console.error('Missing Renderer / Scene')\r\n return\r\n }\r\n\r\n const renderer = rendererC.renderer, scene = rendererC.scene\r\n const cubeRT = new WebGLCubeRenderTarget(props.cubeRTSize, { format: RGBFormat, generateMipmaps: true, minFilter: LinearMipmapLinearFilter })\r\n const cubeCamera = new CubeCamera(props.cubeCameraNear, props.cubeCameraFar, cubeRT)\r\n const updateRT = () => { cubeCamera.update(renderer, scene) }\r\n\r\n if (props.autoUpdate) {\r\n rendererC.onBeforeRender(updateRT)\r\n onUnmounted(() => { rendererC.offBeforeRender(updateRT) })\r\n } else {\r\n rendererC.onMounted(updateRT)\r\n }\r\n\r\n return { cubeRT, cubeCamera }\r\n },\r\n render() {\r\n return []\r\n },\r\n __hmrId: 'CubeCamera',\r\n})\r\n","import { ComponentPropsOptions, defineComponent, InjectionKey, watch } from 'vue'\nimport { BufferGeometry, Material, Mesh as TMesh } from 'three'\nimport Object3D, { Object3DSetupInterface } from '../core/Object3D'\nimport { bindProp } from '../tools'\n\nexport const pointerProps = {\n onPointerEnter: Function,\n onPointerOver: Function,\n onPointerMove: Function,\n onPointerLeave: Function,\n onPointerDown: Function,\n onPointerUp: Function,\n onClick: Function,\n}\n\nexport interface MeshSetupInterface extends Object3DSetupInterface {\n mesh?: TMesh\n geometry?: BufferGeometry\n material?: Material\n loading?: boolean\n}\n\nexport interface MeshInterface extends MeshSetupInterface {\n setGeometry(g: BufferGeometry): void\n setMaterial(m: Material): void\n}\n\nexport const MeshInjectionKey: InjectionKey = Symbol('Mesh')\n\nconst Mesh = defineComponent({\n name: 'Mesh',\n extends: Object3D,\n props: {\n castShadow: Boolean,\n receiveShadow: Boolean,\n ...pointerProps,\n },\n setup(): MeshSetupInterface {\n return {}\n },\n provide() {\n return {\n [MeshInjectionKey as symbol]: this,\n }\n },\n mounted() {\n // TODO : proper ?\n if (!this.mesh && !this.loading) this.initMesh()\n },\n methods: {\n initMesh() {\n const mesh = new TMesh(this.geometry, this.material)\n mesh.userData.component = this\n\n bindProp(this, 'castShadow', mesh)\n bindProp(this, 'receiveShadow', mesh)\n\n if (this.onPointerEnter ||\n this.onPointerOver ||\n this.onPointerMove ||\n this.onPointerLeave ||\n this.onPointerDown ||\n this.onPointerUp ||\n this.onClick) {\n if (this.renderer) this.renderer.three.addIntersectObject(mesh)\n }\n\n this.mesh = mesh\n this.initObject3D(mesh)\n },\n createGeometry() {},\n addGeometryWatchers(props: Readonly) {\n Object.keys(props).forEach(prop => {\n // @ts-ignore\n watch(() => this[prop], () => {\n this.refreshGeometry()\n })\n })\n },\n setGeometry(geometry: BufferGeometry) {\n this.geometry = geometry\n if (this.mesh) this.mesh.geometry = geometry\n },\n setMaterial(material: Material) {\n this.material = material\n if (this.mesh) this.mesh.material = material\n },\n refreshGeometry() {\n const oldGeo = this.geometry\n this.createGeometry()\n if (this.mesh && this.geometry) this.mesh.geometry = this.geometry\n oldGeo?.dispose()\n },\n },\n unmounted() {\n if (this.mesh) {\n if (this.renderer) this.renderer.three.removeIntersectObject(this.mesh)\n }\n // for predefined mesh (geometry/material are not unmounted)\n if (this.geometry) this.geometry.dispose()\n if (this.material) this.material.dispose()\n },\n __hmrId: 'Mesh',\n})\n\nexport default Mesh\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function meshComponent

>(\n name: string,\n props: P,\n createGeometry: {(c: any): BufferGeometry}\n) {\n return defineComponent({\n name,\n extends: Mesh,\n props,\n created() {\n this.createGeometry()\n this.addGeometryWatchers(props)\n },\n methods: {\n createGeometry() {\n this.geometry = createGeometry(this)\n },\n },\n })\n}\n","import { ComponentPropsOptions, defineComponent, PropType, watch } from 'vue'\nimport { BufferAttribute, BufferGeometry } from 'three'\nimport { MeshInjectionKey, MeshInterface } from '../meshes/Mesh'\n\nexport interface GeometrySetupInterface {\n mesh?: MeshInterface\n geometry?: BufferGeometry\n watchProps?: string[]\n}\n\nexport interface GeometryAttributeInterface {\n name: string\n array: ArrayLike\n itemSize: number\n normalized?: boolean\n}\n\n// function defaultSetup(): GeometryInterface {\n// const mesh = inject('mesh') as MeshInterface\n// const watchProps: string[] = []\n// return { mesh, watchProps }\n// }\n\nconst Geometry = defineComponent({\n props: {\n rotateX: Number,\n rotateY: Number,\n rotateZ: Number,\n attributes: { type: Array as PropType>, default: () => ([]) },\n },\n // inject for sub components\n inject: {\n mesh: MeshInjectionKey as symbol,\n },\n setup(): GeometrySetupInterface {\n return {}\n },\n created() {\n if (!this.mesh) {\n console.error('Missing parent Mesh')\n return\n }\n\n this.createGeometry()\n this.rotateGeometry()\n if (this.geometry) this.mesh.setGeometry(this.geometry)\n\n Object.keys(this.$props).forEach(prop => {\n // @ts-ignore\n watch(() => this[prop], this.refreshGeometry)\n })\n },\n unmounted() {\n this.geometry?.dispose()\n },\n methods: {\n createGeometry() {\n const bufferAttributes: Record = {}\n const geometry = new BufferGeometry()\n this.attributes.forEach(attribute => {\n if (attribute.name && attribute.itemSize && attribute.array) {\n const bufferAttribute = bufferAttributes[attribute.name] = new BufferAttribute(attribute.array, attribute.itemSize, attribute.normalized)\n geometry.setAttribute(attribute.name, bufferAttribute)\n }\n })\n geometry.computeBoundingBox()\n this.geometry = geometry\n },\n rotateGeometry() {\n if (!this.geometry) return\n if (this.rotateX) this.geometry.rotateX(this.rotateX)\n if (this.rotateY) this.geometry.rotateY(this.rotateY)\n if (this.rotateZ) this.geometry.rotateZ(this.rotateZ)\n },\n refreshGeometry() {\n const oldGeo = this.geometry\n this.createGeometry()\n this.rotateGeometry()\n if (this.geometry && this.mesh) this.mesh.setGeometry(this.geometry)\n oldGeo?.dispose()\n },\n },\n render() { return [] },\n})\n\nexport default Geometry\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function geometryComponent

>(\n name: string,\n props: P,\n createGeometry: {(c: any): BufferGeometry}\n) {\n return defineComponent({\n name,\n extends: Geometry,\n props,\n methods: {\n createGeometry() {\n this.geometry = createGeometry(this)\n },\n },\n })\n}\n","import { geometryComponent } from './Geometry'\nimport { BoxGeometry } from 'three'\n\nexport const props = {\n size: Number,\n width: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n depth: { type: Number, default: 1 },\n widthSegments: { type: Number, default: 1 },\n heightSegments: { type: Number, default: 1 },\n depthSegments: { type: Number, default: 1 },\n} as const\n\nexport function createGeometry(comp: any): BoxGeometry {\n if (comp.size) {\n return new BoxGeometry(comp.size, comp.size, comp.size, comp.widthSegments, comp.heightSegments, comp.depthSegments)\n } else {\n return new BoxGeometry(comp.width, comp.height, comp.depth, comp.widthSegments, comp.heightSegments, comp.depthSegments)\n }\n}\n\nexport default geometryComponent('BoxGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { CircleGeometry } from 'three'\n\nexport const props = {\n radius: { type: Number, default: 1 },\n segments: { type: Number, default: 8 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n} as const\n\nexport function createGeometry(comp: any): CircleGeometry {\n return new CircleGeometry(comp.radius, comp.segments, comp.thetaStart, comp.thetaLength)\n}\n\nexport default geometryComponent('CircleGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { ConeGeometry } from 'three'\n\nexport const props = {\n radius: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n} as const\n\nexport function createGeometry(comp: any): ConeGeometry {\n return new ConeGeometry(comp.radius, comp.height, comp.radialSegments, comp.heightSegments, comp.openEnded, comp.thetaStart, comp.thetaLength)\n}\n\nexport default geometryComponent('ConeGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { CylinderGeometry } from 'three'\n\nexport const props = {\n radiusTop: { type: Number, default: 1 },\n radiusBottom: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n heightSegments: { type: Number, default: 1 },\n openEnded: { type: Boolean, default: false },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n} as const\n\nexport function createGeometry(comp: any): CylinderGeometry {\n return new CylinderGeometry(comp.radiusTop, comp.radiusBottom, comp.height, comp.radialSegments, comp.heightSegments, comp.openEnded, comp.thetaStart, comp.thetaLength)\n}\n\nexport default geometryComponent('CylinderGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { DodecahedronGeometry } from 'three'\n\nexport const props = {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n} as const\n\nexport function createGeometry(comp: any): DodecahedronGeometry {\n return new DodecahedronGeometry(comp.radius, comp.detail)\n}\n\nexport default geometryComponent('DodecahedronGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { IcosahedronGeometry } from 'three'\n\nexport const props = {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n} as const\n\nexport function createGeometry(comp: any): IcosahedronGeometry {\n return new IcosahedronGeometry(comp.radius, comp.detail)\n}\n\nexport default geometryComponent('IcosahedronGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { LatheGeometry } from 'three'\n\nexport const props = {\n points: Array,\n segments: { type: Number, default: 12 },\n phiStart: { type: Number, default: 0 },\n phiLength: { type: Number, default: Math.PI * 2 },\n} as const\n\nexport function createGeometry(comp: any): LatheGeometry {\n return new LatheGeometry(comp.points, comp.segments, comp.phiStart, comp.phiLength)\n}\n\nexport default geometryComponent('LatheGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { OctahedronGeometry } from 'three'\n\nexport const props = {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n} as const\n\nexport function createGeometry(comp: any): OctahedronGeometry {\n return new OctahedronGeometry(comp.radius, comp.detail)\n}\n\nexport default geometryComponent('OctahedronGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { PlaneGeometry } from 'three'\n\nexport const props = {\n width: { type: Number, default: 1 },\n height: { type: Number, default: 1 },\n widthSegments: { type: Number, default: 1 },\n heightSegments: { type: Number, default: 1 },\n} as const\n\nexport function createGeometry(comp: any): PlaneGeometry {\n return new PlaneGeometry(comp.width, comp.height, comp.widthSegments, comp.heightSegments)\n}\n\nexport default geometryComponent('PlaneGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { PolyhedronGeometry } from 'three'\n\nexport const props = {\n vertices: Array,\n indices: Array,\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n} as const\n\nexport function createGeometry(comp: any): PolyhedronGeometry {\n return new PolyhedronGeometry(comp.vertices, comp.indices, comp.radius, comp.detail)\n}\n\nexport default geometryComponent('PolyhedronGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { RingGeometry } from 'three'\n\nexport const props = {\n innerRadius: { type: Number, default: 0.5 },\n outerRadius: { type: Number, default: 1 },\n thetaSegments: { type: Number, default: 8 },\n phiSegments: { type: Number, default: 1 },\n thetaStart: { type: Number, default: 0 },\n thetaLength: { type: Number, default: Math.PI * 2 },\n} as const\n\nexport function createGeometry(comp: any): RingGeometry {\n return new RingGeometry(comp.innerRadius, comp.outerRadius, comp.thetaSegments, comp.phiSegments, comp.thetaStart, comp.thetaLength)\n}\n\nexport default geometryComponent('RingGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { SphereGeometry } from 'three'\n\nexport const props = {\n radius: { type: Number, default: 1 },\n widthSegments: { type: Number, default: 12 },\n heightSegments: { type: Number, default: 12 },\n} as const\n\nexport function createGeometry(comp: any): SphereGeometry {\n return new SphereGeometry(comp.radius, comp.widthSegments, comp.heightSegments)\n}\n\nexport default geometryComponent('SphereGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { TetrahedronGeometry } from 'three'\n\nexport const props = {\n radius: { type: Number, default: 1 },\n detail: { type: Number, default: 0 },\n} as const\n\nexport function createGeometry(comp: any): TetrahedronGeometry {\n return new TetrahedronGeometry(comp.radius, comp.detail)\n}\n\nexport default geometryComponent('TetrahedronGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { TorusGeometry } from 'three'\n\nexport const props = {\n radius: { type: Number, default: 1 },\n tube: { type: Number, default: 0.4 },\n radialSegments: { type: Number, default: 8 },\n tubularSegments: { type: Number, default: 6 },\n arc: { type: Number, default: Math.PI * 2 },\n} as const\n\nexport function createGeometry(comp: any): TorusGeometry {\n return new TorusGeometry(comp.radius, comp.tube, comp.radialSegments, comp.tubularSegments, comp.arc)\n}\n\nexport default geometryComponent('TorusGeometry', props, createGeometry)\n","import { geometryComponent } from './Geometry'\nimport { TorusKnotGeometry } from 'three'\n\nexport const props = {\n radius: { type: Number, default: 1 },\n tube: { type: Number, default: 0.4 },\n tubularSegments: { type: Number, default: 64 },\n radialSegments: { type: Number, default: 8 },\n p: { type: Number, default: 2 },\n q: { type: Number, default: 3 },\n} as const\n\nexport function createGeometry(comp: any): TorusKnotGeometry {\n return new TorusKnotGeometry(comp.radius, comp.tube, comp.tubularSegments, comp.radialSegments, comp.p, comp.q)\n}\n\nexport default geometryComponent('TorusKnotGeometry', props, createGeometry)\n","import { defineComponent } from 'vue'\nimport { CatmullRomCurve3, Curve, TubeGeometry, Vector3 } from 'three'\nimport Geometry from './Geometry'\n\nexport const props = {\n points: Array,\n path: Curve,\n tubularSegments: { type: Number, default: 64 },\n radius: { type: Number, default: 1 },\n radialSegments: { type: Number, default: 8 },\n closed: { type: Boolean, default: false },\n} as const\n\nexport function createGeometry(comp: any): TubeGeometry {\n let curve\n if (comp.points) {\n curve = new CatmullRomCurve3(comp.points)\n } else if (comp.path) {\n curve = comp.path\n } else {\n console.error('Missing path curve or points.')\n }\n return new TubeGeometry(curve, comp.tubularSegments, comp.radius, comp.radiusSegments, comp.closed)\n}\n\nexport default defineComponent({\n extends: Geometry,\n props,\n methods: {\n createGeometry() {\n this.geometry = createGeometry(this)\n },\n // update points (without using prop, faster)\n updatePoints(points: Vector3[]) {\n updateTubeGeometryPoints(this.geometry as TubeGeometry, points)\n },\n },\n})\n\nexport function updateTubeGeometryPoints(tube: TubeGeometry, points: Vector3[]): void {\n const curve = new CatmullRomCurve3(points)\n const { radialSegments, radius, tubularSegments, closed } = tube.parameters\n const frames = curve.computeFrenetFrames(tubularSegments, closed)\n tube.tangents = frames.tangents\n tube.normals = frames.normals\n tube.binormals = frames.binormals\n tube.parameters.path = curve\n\n const pAttribute = tube.getAttribute('position')\n const nAttribute = tube.getAttribute('normal')\n\n const normal = new Vector3()\n const P = new Vector3()\n\n for (let i = 0; i < tubularSegments; i++) {\n updateSegment(i)\n }\n updateSegment(tubularSegments)\n\n tube.attributes.position.needsUpdate = true\n tube.attributes.normal.needsUpdate = true\n\n function updateSegment(i: number) {\n curve.getPointAt(i / tubularSegments, P)\n const N = frames.normals[i]\n const B = frames.binormals[i]\n for (let j = 0; j <= radialSegments; j++) {\n const v = j / radialSegments * Math.PI * 2\n const sin = Math.sin(v)\n const cos = -Math.cos(v)\n normal.x = (cos * N.x + sin * B.x)\n normal.y = (cos * N.y + sin * B.y)\n normal.z = (cos * N.z + sin * B.z)\n normal.normalize()\n const index = (i * (radialSegments + 1) + j)\n nAttribute.setXYZ(index, normal.x, normal.y, normal.z)\n pAttribute.setXYZ(index, P.x + radius * normal.x, P.y + radius * normal.y, P.z + radius * normal.z)\n }\n }\n}\n","import { DirectionalLight, Light, SpotLight } from 'three'\nimport { defineComponent, PropType, watch } from 'vue'\nimport Object3D, { Vector2PropInterface } from '../core/Object3D'\nimport { bindProp, setFromProp } from '../tools'\n\nexport interface LightSetupInterface {\n light?: Light\n}\n\nexport default defineComponent({\n extends: Object3D,\n name: 'Light',\n props: {\n color: { type: String, default: '#ffffff' },\n intensity: { type: Number, default: 1 },\n castShadow: { type: Boolean, default: false },\n shadowMapSize: { type: Object as PropType, default: () => ({ x: 512, y: 512 }) },\n shadowCamera: { type: Object, default: () => ({}) },\n },\n setup(): LightSetupInterface {\n return {}\n },\n unmounted() {\n if (this.light instanceof SpotLight || this.light instanceof DirectionalLight) {\n this.removeFromParent(this.light.target)\n }\n },\n methods: {\n initLight(light: Light) {\n this.light = light\n\n if ((light as any).shadow) {\n light.castShadow = this.castShadow\n // @ts-ignore\n setFromProp(light.shadow.mapSize, this.shadowMapSize)\n // @ts-ignore\n setFromProp(light.shadow.camera, this.shadowCamera)\n }\n\n ['color', 'intensity', 'castShadow'].forEach(p => {\n // @ts-ignore\n watch(() => this[p], (value) => {\n if (p === 'color') {\n light.color.set(value)\n } else {\n // @ts-ignore\n light[p] = value\n }\n })\n })\n\n this.initObject3D(light)\n\n if (light instanceof SpotLight || light instanceof DirectionalLight) {\n bindProp(this, 'target', light.target, 'position')\n this.addToParent(light.target)\n }\n },\n },\n __hmrId: 'Light',\n})\n","import { defineComponent } from 'vue'\nimport { AmbientLight } from 'three'\nimport Light from './Light'\n\nexport default defineComponent({\n extends: Light,\n created() {\n this.initLight(new AmbientLight(this.color, this.intensity))\n },\n __hmrId: 'AmbientLight',\n})\n","import { defineComponent, PropType } from 'vue'\nimport { DirectionalLight } from 'three'\nimport { Vector2PropInterface } from '../core/Object3D'\nimport Light from './Light'\n\nexport default defineComponent({\n extends: Light,\n props: {\n target: { type: Object as PropType, default: () => ({ x: 0, y: 0, z: 0 }) },\n },\n created() {\n this.initLight(new DirectionalLight(this.color, this.intensity))\n },\n __hmrId: 'DirectionalLight',\n})\n","import { defineComponent, watch } from 'vue'\nimport { HemisphereLight } from 'three'\nimport Light from './Light'\n\nexport default defineComponent({\n extends: Light,\n props: {\n groundColor: { type: String, default: '#444444' },\n },\n created() {\n const light = new HemisphereLight(this.color, this.groundColor, this.intensity)\n watch(() => this.groundColor, (value) => { light.groundColor.set(value) })\n this.initLight(light)\n },\n __hmrId: 'HemisphereLight',\n})\n","import { defineComponent } from 'vue'\nimport { PointLight } from 'three'\nimport Light from './Light'\n\nexport default defineComponent({\n extends: Light,\n props: {\n distance: { type: Number, default: 0 },\n decay: { type: Number, default: 1 },\n },\n created() {\n this.initLight(new PointLight(this.color, this.intensity, this.distance, this.decay))\n },\n __hmrId: 'PointLight',\n})\n","import { defineComponent, watch } from 'vue'\nimport { RectAreaLight } from 'three'\nimport { RectAreaLightUniformsLib } from 'three/examples/jsm/lights/RectAreaLightUniformsLib.js'\nimport { RectAreaLightHelper } from 'three/examples/jsm/helpers/RectAreaLightHelper.js'\nimport Light from './Light'\n\nexport default defineComponent({\n extends: Light,\n props: {\n width: { type: Number, default: 10 },\n height: { type: Number, default: 10 },\n helper: Boolean,\n },\n created() {\n RectAreaLightUniformsLib.init()\n const light = new RectAreaLight(this.color, this.intensity, this.width, this.height)\n\n const watchProps = ['width', 'height']\n watchProps.forEach(p => {\n // @ts-ignore\n watch(() => this[p], (value) => { light[p] = value })\n })\n\n if (this.helper) {\n const lightHelper = new RectAreaLightHelper(light)\n light.add(lightHelper)\n }\n\n this.initLight(light)\n },\n __hmrId: 'RectAreaLight',\n})\n","import { defineComponent, watch } from 'vue'\nimport { SpotLight } from 'three'\nimport Light from './Light'\n\nexport default defineComponent({\n extends: Light,\n props: {\n angle: { type: Number, default: Math.PI / 3 },\n decay: { type: Number, default: 1 },\n distance: { type: Number, default: 0 },\n penumbra: { type: Number, default: 0 },\n target: Object,\n },\n created() {\n const light = new SpotLight(this.color, this.intensity, this.distance, this.angle, this.penumbra, this.decay)\n\n const watchProps = ['angle', 'decay', 'distance', 'penumbra']\n watchProps.forEach(p => {\n // @ts-ignore\n watch(() => this[p], (value) => { light[p] = value })\n })\n\n this.initLight(light)\n },\n __hmrId: 'SpotLight',\n})\n","import { defineComponent, InjectionKey, PropType, watch } from 'vue'\nimport { FrontSide, Material, NormalBlending, Texture } from 'three'\nimport { MeshInjectionKey, MeshInterface } from '../meshes/Mesh'\n\nexport interface MaterialSetupInterface {\n mesh?: MeshInterface\n material?: Material\n createMaterial?(): Material\n}\n\nexport interface MaterialInterface extends MaterialSetupInterface {\n setProp(key: string, value: unknown, needsUpdate: boolean): void\n setTexture(texture: Texture | null, key: string): void\n}\n\nexport const MaterialInjectionKey: InjectionKey = Symbol('Material')\n\nexport default defineComponent({\n // inject for sub components\n inject: {\n mesh: MeshInjectionKey as symbol,\n },\n props: {\n color: { type: [String, Number] as PropType, default: '#ffffff' },\n blending: { type: Number, default: NormalBlending },\n alphaTest: { type: Number, default: 0 },\n depthTest: { type: Boolean, default: true },\n depthWrite: { type: Boolean, default: true },\n fog: { type: Boolean, default: true },\n opacity: { type: Number, default: 1 },\n side: { type: Number, default: FrontSide },\n transparent: Boolean,\n vertexColors: Boolean,\n },\n setup(): MaterialSetupInterface {\n return {}\n },\n provide() {\n return {\n [MaterialInjectionKey as symbol]: this,\n }\n },\n created() {\n if (!this.mesh) {\n console.error('Missing parent Mesh')\n return\n }\n\n if (this.createMaterial) {\n this.material = this.createMaterial()\n this.mesh.setMaterial(this.material)\n this.addWatchers()\n }\n },\n unmounted() {\n this.material?.dispose()\n },\n methods: {\n setProp(key: string, value: any, needsUpdate = false) {\n if (this.material) {\n // @ts-ignore\n this.material[key] = value\n this.material.needsUpdate = needsUpdate\n }\n },\n setTexture(texture: Texture | null, key = 'map') {\n this.setProp(key, texture, true)\n },\n addWatchers() {\n ['color', 'alphaTest', 'blending', 'depthTest', 'depthWrite', 'fog', 'opacity', 'side', 'transparent'].forEach(p => {\n // @ts-ignore\n watch(() => this[p], (value) => {\n if (p === 'color') {\n // @ts-ignore\n this.material.color.set(value)\n } else {\n // @ts-ignore\n this.material[p] = value\n }\n })\n })\n },\n },\n render() {\n return this.$slots.default ? this.$slots.default() : []\n },\n __hmrId: 'Material',\n})\n\nexport const wireframeProps = {\n wireframe: { type: Boolean, default: false },\n // not needed for WebGL\n // wireframeLinecap: { type: String, default: 'round' },\n // wireframeLinejoin: { type: String, default: 'round' },\n wireframeLinewidth: { type: Number, default: 1 }, // not really useful\n}\n","import { defineComponent } from 'vue'\nimport { MeshBasicMaterial } from 'three'\nimport { bindProps, propsValues } from '../tools'\nimport Material, { wireframeProps } from './Material'\n\nexport default defineComponent({\n extends: Material,\n props: {\n ...wireframeProps,\n },\n methods: {\n createMaterial() {\n const material = new MeshBasicMaterial(propsValues(this.$props))\n bindProps(this, Object.keys(wireframeProps), material)\n return material\n },\n },\n __hmrId: 'BasicMaterial',\n})\n","import { defineComponent } from 'vue'\nimport { MeshLambertMaterial } from 'three'\nimport { bindProps, propsValues } from '../tools'\nimport Material, { wireframeProps } from './Material'\n\nexport default defineComponent({\n extends: Material,\n props: {\n ...wireframeProps,\n },\n methods: {\n createMaterial() {\n const material = new MeshLambertMaterial(propsValues(this.$props))\n bindProps(this, Object.keys(wireframeProps), material)\n return material\n },\n },\n __hmrId: 'LambertMaterial',\n})\n","import { defineComponent } from 'vue'\nimport { MeshMatcapMaterial, TextureLoader } from 'three'\nimport { propsValues, getMatcapUrl } from '../tools'\nimport Material from './Material'\n\nexport default defineComponent({\n extends: Material,\n props: {\n src: String,\n name: { type: String, default: '0404E8_0404B5_0404CB_3333FC' },\n flatShading: Boolean,\n },\n methods: {\n createMaterial() {\n const src = this.src ? this.src : getMatcapUrl(this.name)\n const opts = propsValues(this.$props, ['src', 'name'])\n opts.matcap = new TextureLoader().load(src)\n return new MeshMatcapMaterial(opts)\n },\n },\n __hmrId: 'MatcapMaterial',\n})\n","import { defineComponent, watch } from 'vue'\nimport { MeshPhongMaterial } from 'three'\nimport { bindProps, propsValues } from '../tools'\nimport Material, { wireframeProps } from './Material'\n\nexport default defineComponent({\n extends: Material,\n props: {\n emissive: { type: [Number, String], default: 0 },\n emissiveIntensity: { type: Number, default: 1 },\n reflectivity: { type: Number, default: 1 },\n shininess: { type: Number, default: 30 },\n specular: { type: [String, Number], default: 0x111111 },\n flatShading: Boolean,\n ...wireframeProps,\n },\n methods: {\n createMaterial() {\n const material = new MeshPhongMaterial(propsValues(this.$props))\n\n // TODO : handle flatShading ?\n const watchProps = ['emissive', 'emissiveIntensity', 'reflectivity', 'shininess', 'specular']\n watchProps.forEach(p => {\n // @ts-ignore\n watch(() => this[p], (value) => {\n if (p === 'emissive' || p === 'specular') {\n material[p].set(value)\n } else {\n // @ts-ignore\n material[p] = value\n }\n })\n })\n bindProps(this, Object.keys(wireframeProps), material)\n\n return material\n },\n },\n __hmrId: 'PhongMaterial',\n})\n","import { defineComponent, PropType, watch } from 'vue'\nimport { MeshStandardMaterial } from 'three'\nimport { bindProp, bindProps, propsValues } from '../tools'\nimport Material, { wireframeProps } from './Material'\nimport { Vector2PropInterface } from '../core/Object3D'\n\nconst props = {\n aoMapIntensity: { type: Number, default: 1 },\n bumpScale: { type: Number, default: 1 },\n displacementBias: { type: Number, default: 0 },\n displacementScale: { type: Number, default: 1 },\n emissive: { type: [String, Number] as PropType, default: 0 },\n emissiveIntensity: { type: Number, default: 1 },\n envMapIntensity: { type: Number, default: 1 },\n lightMapIntensity: { type: Number, default: 1 },\n metalness: { type: Number, default: 0 },\n normalScale: { type: Object as PropType, default: () => ({ x: 1, y: 1 }) },\n roughness: { type: Number, default: 1 },\n refractionRatio: { type: Number, default: 0.98 },\n flatShading: Boolean,\n} as const\n\nexport default defineComponent({\n extends: Material,\n props: {\n ...props,\n ...wireframeProps,\n },\n methods: {\n createMaterial() {\n const material = new MeshStandardMaterial(propsValues(this.$props, ['normalScale']))\n\n // TODO : use setProp, handle flatShading ?\n Object.keys(props).forEach(p => {\n if (p === 'normalScale') return\n // @ts-ignore\n watch(() => this[p], (value) => {\n if (p === 'emissive') {\n material[p].set(value)\n } else {\n // @ts-ignore\n material[p] = value\n }\n })\n })\n\n bindProp(this, 'normalScale', material)\n bindProps(this, Object.keys(wireframeProps), material)\n\n return material\n },\n },\n __hmrId: 'StandardMaterial',\n})\n","import { defineComponent } from 'vue'\nimport { MeshPhysicalMaterial } from 'three'\nimport { propsValues } from '../tools'\nimport StandardMaterial from './StandardMaterial'\n\nexport default defineComponent({\n extends: StandardMaterial,\n props: {\n flatShading: Boolean,\n },\n methods: {\n createMaterial() {\n return new MeshPhysicalMaterial(propsValues(this.$props))\n },\n },\n __hmrId: 'PhysicalMaterial',\n})\n","import { defineComponent, watch } from 'vue'\nimport { ShaderMaterial } from 'three'\nimport Material from './Material'\nimport { propsValues } from '../tools'\n\nconst defaultVertexShader = `\n varying vec2 vUv;\n void main(){\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);\n }\n`\n\nconst defaultFragmentShader = `\n varying vec2 vUv;\n void main() {\n gl_FragColor = vec4(vUv.x, vUv.y, 0., 1.0);\n }\n`\n\nexport default defineComponent({\n extends: Material,\n props: {\n uniforms: { type: Object, default: () => ({}) },\n vertexShader: { type: String, default: defaultVertexShader },\n fragmentShader: { type: String, default: defaultFragmentShader },\n },\n methods: {\n createMaterial() {\n const material = new ShaderMaterial(propsValues(this.$props, ['color']));\n\n ['vertexShader', 'fragmentShader'].forEach(p => {\n // @ts-ignore\n watch(() => this[p], (value) => { material[p] = value; material.needsUpdate = true })\n })\n\n return material\n },\n },\n __hmrId: 'ShaderMaterial',\n})\n","/**\n * ------------------------------------------------------------------------------------------\n * Subsurface Scattering shader\n * Based on three/examples/jsm/shaders/SubsurfaceScatteringShader.js\n * Based on GDC 2011 – Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look\n * https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/\n *------------------------------------------------------------------------------------------\n */\nimport {\n Color,\n ShaderChunk,\n ShaderLib,\n UniformsUtils,\n} from 'three'\n\nfunction replaceAll(string: string, find: string, replace: string) {\n return string.split(find).join(replace)\n}\n\nconst meshphongFragHead = ShaderChunk.meshphong_frag.slice(0, ShaderChunk.meshphong_frag.indexOf('void main() {'))\nconst meshphongFragBody = ShaderChunk.meshphong_frag.slice(ShaderChunk.meshphong_frag.indexOf('void main() {'))\n\nconst SubsurfaceScatteringShader = {\n\n uniforms: UniformsUtils.merge([\n ShaderLib.phong.uniforms,\n {\n thicknessColor: { value: new Color(0xffffff) },\n thicknessDistortion: { value: 0.1 },\n thicknessAmbient: { value: 0.0 },\n thicknessAttenuation: { value: 0.1 },\n thicknessPower: { value: 2.0 },\n thicknessScale: { value: 10.0 },\n },\n ]),\n\n vertexShader: `\n #define USE_UV\n ${ShaderChunk.meshphong_vert}\n `,\n\n fragmentShader: `\n #define USE_UV\n #define SUBSURFACE\n\n ${meshphongFragHead}\n\n uniform float thicknessPower;\n uniform float thicknessScale;\n uniform float thicknessDistortion;\n uniform float thicknessAmbient;\n uniform float thicknessAttenuation;\n uniform vec3 thicknessColor;\n\n void RE_Direct_Scattering(const in IncidentLight directLight, const in vec2 uv, const in GeometricContext geometry, inout ReflectedLight reflectedLight) {\n #ifdef USE_COLOR\n vec3 thickness = vColor * thicknessColor;\n #else\n vec3 thickness = thicknessColor;\n #endif\n vec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * thicknessDistortion));\n float scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), thicknessPower) * thicknessScale;\n vec3 scatteringIllu = (scatteringDot + thicknessAmbient) * thickness;\n reflectedLight.directDiffuse += scatteringIllu * thicknessAttenuation * directLight.color;\n }\n ` + meshphongFragBody.replace(\n '#include ',\n replaceAll(\n ShaderChunk.lights_fragment_begin,\n 'RE_Direct( directLight, geometry, material, reflectedLight );',\n `\n RE_Direct( directLight, geometry, material, reflectedLight );\n #if defined( SUBSURFACE ) && defined( USE_UV )\n RE_Direct_Scattering(directLight, vUv, geometry, reflectedLight);\n #endif\n `\n )\n ),\n}\n\nexport default SubsurfaceScatteringShader\n","import { defineComponent, PropType } from 'vue'\nimport { Color, ShaderMaterial, UniformsUtils } from 'three'\nimport SubsurfaceScatteringShader from './SubsurfaceScatteringShader'\nimport Material from './Material'\n// import { bindProps, propsValues } from '../tools'\n\nconst props = {\n color: { type: [String, Number] as PropType, default: '#ffffff' },\n thicknessColor: { type: [String, Number] as PropType, default: '#ffffff' },\n thicknessDistortion: { type: Number, default: 0.4 },\n thicknessAmbient: { type: Number, default: 0.01 },\n thicknessAttenuation: { type: Number, default: 0.7 },\n thicknessPower: { type: Number, default: 2 },\n thicknessScale: { type: Number, default: 4 },\n} as const\n\nexport default defineComponent({\n extends: Material,\n props,\n methods: {\n createMaterial() {\n const params = SubsurfaceScatteringShader\n const uniforms = UniformsUtils.clone(params.uniforms)\n\n Object.keys(props).forEach((key) => {\n // @ts-ignore\n const value = this[key]\n let _key = key, _value = value\n if (['color', 'thicknessColor'].includes(key)) {\n if (key === 'color') _key = 'diffuse'\n _value = new Color(value)\n }\n uniforms[_key].value = _value\n })\n\n const material = new ShaderMaterial({\n ...params,\n uniforms,\n lights: true,\n transparent: this.transparent,\n vertexColors: this.vertexColors,\n })\n\n return material\n },\n },\n __hmrId: 'SubSurfaceMaterial',\n})\n","import { defineComponent } from 'vue'\nimport { MeshToonMaterial } from 'three'\nimport { bindProps, propsValues } from '../tools'\nimport Material, { wireframeProps } from './Material'\n\nexport default defineComponent({\n extends: Material,\n props: {\n ...wireframeProps,\n },\n methods: {\n createMaterial() {\n const material = new MeshToonMaterial(propsValues(this.$props))\n bindProps(this, Object.keys(wireframeProps), material)\n return material\n },\n },\n __hmrId: 'ToonMaterial',\n})\n","import { defineComponent, PropType, watch } from 'vue'\nimport { ClampToEdgeWrapping, LinearEncoding, LinearFilter, LinearMipmapLinearFilter, ShaderMaterial, Texture, TextureLoader, UVMapping } from 'three'\nimport { bindProp } from '../tools'\nimport { MaterialInjectionKey, MaterialInterface } from './Material'\nimport { Vector2PropInterface } from '../core/Object3D'\n\nexport interface TexureInterface {\n material?: MaterialInterface\n texture?: Texture\n}\n\nexport default defineComponent({\n inject: {\n material: MaterialInjectionKey as symbol,\n },\n props: {\n name: { type: String, default: 'map' },\n uniform: String,\n src: String,\n onLoad: Function as PropType<(t: Texture) => void>,\n onProgress: Function as PropType<(e: ProgressEvent) => void>,\n onError: Function as PropType<(e: ErrorEvent) => void>,\n encoding: { type: Number, default: LinearEncoding },\n // format: { type: Number, default: RGBAFormat },\n mapping: { type: Number, default: UVMapping },\n wrapS: { type: Number, default: ClampToEdgeWrapping },\n wrapT: { type: Number, default: ClampToEdgeWrapping },\n magFilter: { type: Number, default: LinearFilter },\n minFilter: { type: Number, default: LinearMipmapLinearFilter },\n repeat: { type: Object as PropType, default: () => ({ x: 1, y: 1 }) },\n rotation: { type: Number, default: 0 },\n center: { type: Object as PropType, default: () => ({ x: 0, y: 0 }) },\n },\n setup(): TexureInterface {\n return {}\n },\n created() {\n this.refreshTexture()\n watch(() => this.src, this.refreshTexture)\n },\n unmounted() {\n this.material?.setTexture(null, this.name)\n this.texture?.dispose()\n },\n methods: {\n createTexture() {\n if (!this.src) return undefined\n const texture = new TextureLoader().load(this.src, this.onLoaded, this.onProgress, this.onError)\n // use format ? TextureLoader will automatically set format to THREE.RGBFormat for JPG images.\n const wathProps = ['encoding', 'mapping', 'wrapS', 'wrapT', 'magFilter', 'minFilter', 'repeat', 'rotation', 'center']\n wathProps.forEach(prop => { bindProp(this, prop, texture) })\n return texture\n },\n refreshTexture() {\n this.texture = this.createTexture()\n\n if (this.texture && this.material) {\n this.material.setTexture(this.texture, this.name)\n if (this.material.material instanceof ShaderMaterial && this.uniform) {\n (this.material as any).uniforms[this.uniform] = { value: this.texture }\n }\n }\n },\n onLoaded(t: Texture) {\n this.onLoad?.(t)\n },\n },\n render() { return [] },\n})\n","import { defineComponent, PropType, watch } from 'vue'\nimport { CubeReflectionMapping, CubeTextureLoader, RGBFormat } from 'three'\nimport Texture from './Texture'\n\nexport default defineComponent({\n extends: Texture,\n props: {\n path: { type: String, required: true },\n urls: {\n type: Array as PropType,\n default: () => ['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg'],\n },\n // format: { type: Number, default: RGBFormat },\n mapping: { type: Number, default: CubeReflectionMapping },\n },\n created() {\n watch(() => this.path, this.refreshTexture)\n watch(() => this.urls, this.refreshTexture)\n },\n methods: {\n createTexture() {\n return new CubeTextureLoader()\n .setPath(this.path)\n .load(this.urls, this.onLoaded, this.onProgress, this.onError)\n },\n },\n})\n","import { defineComponent } from 'vue'\r\nimport { PointsMaterial } from 'three'\r\nimport { propsValues } from '../tools'\r\nimport Material from './Material'\r\n\r\nexport default defineComponent({\r\n extends: Material,\r\n props: {\r\n size: { type: Number, default: 10 },\r\n sizeAttenuation: { type: Boolean, default: true },\r\n },\r\n methods: {\r\n createMaterial() {\r\n const material = new PointsMaterial(propsValues(this.$props))\r\n return material\r\n },\r\n },\r\n __hmrId: 'PointsMaterial',\r\n})\r\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/BoxGeometry'\n\nexport default meshComponent('Box', props, createGeometry)\n\n// import { defineComponent } from 'vue'\n// import Mesh, { meshComponent } from './Mesh'\n//\n// export default defineComponent({\n// extends: Mesh,\n// props,\n// created() {\n// this.createGeometry()\n// this.addGeometryWatchers(props)\n// },\n// methods: {\n// createGeometry() {\n// this.geometry = createGeometry(this)\n// },\n// },\n// })\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/CircleGeometry'\n\nexport default meshComponent('Circle', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/ConeGeometry'\n\nexport default meshComponent('Cone', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/CylinderGeometry'\n\nexport default meshComponent('Cylinder', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/DodecahedronGeometry'\n\nexport default meshComponent('Dodecahedron', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/IcosahedronGeometry'\n\nexport default meshComponent('Icosahedron', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/LatheGeometry'\n\nexport default meshComponent('Lathe', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/OctahedronGeometry'\n\nexport default meshComponent('Octahedron', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/PlaneGeometry'\n\nexport default meshComponent('Plane', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/PolyhedronGeometry'\n\nexport default meshComponent('Polyhedron', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/RingGeometry'\n\nexport default meshComponent('Ring', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/SphereGeometry'\n\nexport default meshComponent('Sphere', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/TetrahedronGeometry'\n\nexport default meshComponent('Tetrahedron', props, createGeometry)\n","import { defineComponent, PropType, watch } from 'vue'\nimport { Font, FontLoader, TextGeometry } from 'three'\nimport Mesh, { MeshSetupInterface } from './Mesh'\n\ninterface TextSetupInterface extends MeshSetupInterface {\n geometry?: TextGeometry\n font?: Font\n}\n\nconst props = {\n text: { type: String, required: true, default: 'Text' },\n fontSrc: { type: String, required: true },\n size: { type: Number, default: 80 },\n height: { type: Number, default: 5 },\n depth: { type: Number, default: 1 },\n curveSegments: { type: Number, default: 12 },\n bevelEnabled: { type: Boolean, default: false },\n bevelThickness: { type: Number, default: 10 },\n bevelSize: { type: Number, default: 8 },\n bevelOffset: { type: Number, default: 0 },\n bevelSegments: { type: Number, default: 5 },\n align: { type: [Boolean, String] as PropType, default: false },\n} as const\n\nexport default defineComponent({\n extends: Mesh,\n props,\n setup(): TextSetupInterface {\n return {}\n },\n created() {\n if (!this.fontSrc) {\n console.error('Missing required prop: \"font-src\"')\n return\n }\n // if (!this.text) {\n // console.error('Missing required prop: \"text\"')\n // return\n // }\n\n // add watchers\n const watchProps = [\n 'text', 'size', 'height', 'curveSegments',\n 'bevelEnabled', 'bevelThickness', 'bevelSize', 'bevelOffset', 'bevelSegments',\n 'align',\n ]\n watchProps.forEach(p => {\n // @ts-ignore\n watch(() => this[p], () => {\n if (this.font) this.refreshGeometry()\n })\n })\n\n const loader = new FontLoader()\n this.loading = true\n loader.load(this.fontSrc, (font) => {\n this.loading = false\n this.font = font\n this.createGeometry()\n this.initMesh()\n })\n },\n methods: {\n createGeometry() {\n this.geometry = new TextGeometry(this.text, {\n // @ts-ignore\n font: this.font,\n size: this.size,\n height: this.height,\n depth: this.depth,\n curveSegments: this.curveSegments,\n bevelEnabled: this.bevelEnabled,\n bevelThickness: this.bevelThickness,\n bevelSize: this.bevelSize,\n bevelOffset: this.bevelOffset,\n bevelSegments: this.bevelSegments,\n })\n\n if (this.align === 'center') {\n this.geometry.center()\n }\n },\n },\n})\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/TorusGeometry'\n\nexport default meshComponent('Torus', props, createGeometry)\n","import { meshComponent } from './Mesh'\nimport { props, createGeometry } from '../geometries/TorusKnotGeometry'\n\nexport default meshComponent('TorusKnot', props, createGeometry)\n","import { defineComponent } from 'vue'\nimport { TubeGeometry, Vector3 } from 'three'\nimport Mesh from './Mesh'\nimport { props, createGeometry, updateTubeGeometryPoints } from '../geometries/TubeGeometry'\n\nexport default defineComponent({\n extends: Mesh,\n props,\n created() {\n this.createGeometry()\n this.addGeometryWatchers(props)\n },\n methods: {\n createGeometry() {\n this.geometry = createGeometry(this)\n },\n // update curve points (without using prop, faster)\n updatePoints(points: Vector3[]) {\n updateTubeGeometryPoints(this.geometry as TubeGeometry, points)\n },\n },\n __hmrId: 'Tube',\n})\n","import { defineComponent, watch } from 'vue'\nimport { DoubleSide, MeshBasicMaterial, PlaneGeometry, Texture, TextureLoader } from 'three'\nimport Mesh, { MeshSetupInterface } from './Mesh'\n\ninterface ImageSetupInterface extends MeshSetupInterface {\n material?: MeshBasicMaterial\n texture?: Texture\n}\n\nexport default defineComponent({\n emits: ['loaded'],\n extends: Mesh,\n props: {\n src: { type: String, required: true },\n width: Number,\n height: Number,\n widthSegments: { type: Number, default: 1 },\n heightSegments: { type: Number, default: 1 },\n keepSize: Boolean,\n },\n setup(): ImageSetupInterface {\n return {}\n },\n created() {\n if (!this.renderer) return\n\n this.geometry = new PlaneGeometry(1, 1, this.widthSegments, this.heightSegments)\n this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() })\n\n watch(() => this.src, this.refreshTexture);\n\n ['width', 'height'].forEach(p => {\n // @ts-ignore\n watch(() => this[p], this.resize)\n })\n\n this.resize()\n if (this.keepSize) this.renderer.onResize(this.resize)\n },\n unmounted() {\n this.renderer?.offResize(this.resize)\n },\n methods: {\n loadTexture() {\n return new TextureLoader().load(this.src, this.onLoaded)\n },\n refreshTexture() {\n this.texture?.dispose()\n if (this.material) {\n this.material.map = this.loadTexture()\n this.material.needsUpdate = true\n }\n },\n onLoaded(texture: Texture) {\n this.texture = texture\n this.resize()\n this.$emit('loaded', texture)\n },\n resize() {\n if (!this.renderer || !this.texture) return\n const screen = this.renderer.size\n const iW = this.texture.image.width\n const iH = this.texture.image.height\n const iRatio = iW / iH\n let w = 1, h = 1\n if (this.width && this.height) {\n w = this.width * screen.wWidth / screen.width\n h = this.height * screen.wHeight / screen.height\n } else if (this.width) {\n w = this.width * screen.wWidth / screen.width\n h = w / iRatio\n } else if (this.height) {\n h = this.height * screen.wHeight / screen.height\n w = h * iRatio\n } else {\n if (iRatio > 1) w = h * iRatio\n else h = w / iRatio\n }\n if (this.mesh) {\n this.mesh.scale.x = w\n this.mesh.scale.y = h\n }\n },\n },\n __hmrId: 'Image',\n})\n","import { defineComponent } from 'vue'\nimport { InstancedMesh } from 'three'\nimport Mesh from './Mesh'\nimport { bindProp } from '../tools'\n\nexport default defineComponent({\n extends: Mesh,\n props: {\n count: { type: Number, required: true },\n },\n methods: {\n initMesh() {\n if (!this.renderer) return\n\n if (!this.geometry || !this.material) {\n console.error('Missing geometry and/or material')\n return false\n }\n\n this.mesh = new InstancedMesh(this.geometry, this.material, this.count)\n this.mesh.userData.component = this\n\n bindProp(this, 'castShadow', this.mesh)\n bindProp(this, 'receiveShadow', this.mesh)\n\n if (this.onPointerEnter ||\n this.onPointerOver ||\n this.onPointerMove ||\n this.onPointerLeave ||\n this.onPointerDown ||\n this.onPointerUp ||\n this.onClick) {\n this.renderer.three.addIntersectObject(this.mesh)\n }\n\n this.initObject3D(this.mesh)\n },\n },\n __hmrId: 'InstancedMesh',\n})\n","import { defineComponent } from 'vue'\nimport { Sprite, SpriteMaterial, Texture, TextureLoader } from 'three'\nimport Object3D, { Object3DSetupInterface } from '../core/Object3D'\n\ninterface SpriteSetupInterface extends Object3DSetupInterface {\n texture?: Texture\n material?: SpriteMaterial\n sprite?: Sprite\n}\n\nexport default defineComponent({\n extends: Object3D,\n emits: ['loaded'],\n props: {\n src: { type: String, required: true },\n },\n setup(): SpriteSetupInterface {\n return {}\n },\n created() {\n this.texture = new TextureLoader().load(this.src, this.onLoaded)\n this.material = new SpriteMaterial({ map: this.texture })\n this.sprite = new Sprite(this.material)\n this.initObject3D(this.sprite)\n },\n unmounted() {\n this.texture?.dispose()\n this.material?.dispose()\n },\n methods: {\n onLoaded() {\n this.updateUV()\n this.$emit('loaded')\n },\n updateUV() {\n if (!this.texture || !this.sprite) return\n\n const iWidth = this.texture.image.width\n const iHeight = this.texture.image.height\n const iRatio = iWidth / iHeight\n\n let x = 0.5, y = 0.5\n if (iRatio > 1) {\n x = 0.5 * iRatio\n } else {\n y = 0.5 / iRatio\n }\n\n const positions = this.sprite.geometry.attributes.position.array as Array\n positions[0] = -x; positions[1] = -y\n positions[5] = x; positions[6] = -y\n positions[10] = x; positions[11] = y\n positions[15] = -x; positions[16] = y\n this.sprite.geometry.attributes.position.needsUpdate = true\n },\n },\n __hmrId: 'Sprite',\n})\n","import { defineComponent } from 'vue'\r\nimport { BufferGeometry, Material, Points } from 'three'\r\nimport Object3D, { Object3DSetupInterface } from '../core/Object3D'\r\nimport { MeshInjectionKey } from './Mesh'\r\n\r\nexport interface PointsSetupInterface extends Object3DSetupInterface {\r\n mesh?: Points\r\n points?: Points\r\n geometry?: BufferGeometry\r\n material?: Material\r\n}\r\n\r\nexport interface PointsInterface extends PointsSetupInterface {\r\n setGeometry(geometry: BufferGeometry): void\r\n setMaterial(material: Material): void\r\n}\r\n\r\n// not really a mesh, but allow us to easily get geometry/material support\r\nexport default defineComponent({\r\n extends: Object3D,\r\n setup(): PointsSetupInterface {\r\n return {}\r\n },\r\n provide() {\r\n return {\r\n [MeshInjectionKey as symbol]: this,\r\n }\r\n },\r\n mounted() {\r\n this.mesh = this.points = new Points(this.geometry, this.material)\r\n this.initObject3D(this.mesh)\r\n },\r\n methods: {\r\n setGeometry(geometry: BufferGeometry) {\r\n this.geometry = geometry\r\n if (this.mesh) this.mesh.geometry = geometry\r\n },\r\n setMaterial(material: Material) {\r\n this.material = material\r\n if (this.mesh) this.mesh.material = material\r\n },\r\n },\r\n})\r\n","import { Object3D as TObject3D } from 'three'\nimport { defineComponent } from 'vue'\nimport Object3D from '../core/Object3D'\n\nexport default defineComponent({\n extends: Object3D,\n emits: ['load', 'progress', 'error'],\n props: {\n src: { type: String, required: true },\n },\n data() {\n return {\n progress: 0,\n }\n },\n methods: {\n onLoad(model: TObject3D) {\n this.$emit('load', model)\n this.initObject3D(model)\n },\n onProgress(progress: ProgressEvent) {\n this.progress = progress.loaded / progress.total\n this.$emit('progress', progress)\n },\n onError(error: ErrorEvent) {\n this.$emit('error', error)\n },\n },\n})\n","import { defineComponent } from 'vue'\nimport { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'\nimport Model from './Model'\n\nexport default defineComponent({\n extends: Model,\n created() {\n const loader = new GLTFLoader()\n loader.load(this.src, (gltf) => {\n this.onLoad(gltf.scene)\n }, this.onProgress, this.onError)\n },\n})\n","import { defineComponent } from 'vue'\nimport { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js'\nimport Model from './Model'\n\nexport default defineComponent({\n extends: Model,\n created() {\n const loader = new FBXLoader()\n loader.load(this.src, (fbx) => {\n this.onLoad(fbx)\n }, this.onProgress, this.onError)\n },\n})\n","import { defineComponent, inject, InjectionKey } from 'vue'\nimport { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'\nimport { Pass } from 'three/examples/jsm/postprocessing/Pass'\nimport { RendererInjectionKey, RendererInterface } from '../core/Renderer'\n\ninterface EffectComposerSetupInterface {\n renderer?: RendererInterface\n composer?: EffectComposer\n}\n\nexport interface EffectComposerInterface extends EffectComposerSetupInterface {\n addPass(pass: Pass): void\n removePass(pass: Pass): void\n}\n\nexport const ComposerInjectionKey: InjectionKey = Symbol('Composer')\n\nexport default defineComponent({\n setup(): EffectComposerSetupInterface {\n const renderer = inject(RendererInjectionKey)\n return { renderer }\n },\n provide() {\n return {\n [ComposerInjectionKey as symbol]: this,\n }\n },\n created() {\n if (!this.renderer) {\n console.error('Renderer not found')\n return\n }\n const renderer = this.renderer\n\n const composer = new EffectComposer(this.renderer.renderer)\n this.composer = composer\n this.renderer.composer = composer\n\n // this.renderer.onInit(() => {\n renderer.addListener('init', () => {\n renderer.renderer.autoClear = false\n this.resize()\n renderer.addListener('resize', this.resize)\n })\n },\n unmounted() {\n this.renderer?.removeListener('resize', this.resize)\n },\n methods: {\n addPass(pass: Pass) {\n this.composer?.addPass(pass)\n },\n removePass(pass: Pass) {\n this.composer?.removePass(pass)\n },\n resize() {\n if (this.composer && this.renderer) {\n this.composer.setSize(this.renderer.size.width, this.renderer.size.height)\n }\n },\n },\n render() {\n return this.$slots.default ? this.$slots.default() : []\n },\n __hmrId: 'EffectComposer',\n})\n","import { Pass } from 'three/examples/jsm/postprocessing/Pass'\nimport { defineComponent } from 'vue'\nimport { RendererInjectionKey, RendererInterface } from '../core/Renderer'\nimport { ComposerInjectionKey, EffectComposerInterface } from './EffectComposer'\n\nexport interface EffectSetupInterface {\n renderer?: RendererInterface\n composer?: EffectComposerInterface\n pass?: Pass\n}\n\nexport default defineComponent({\n // inject for sub components\n inject: {\n renderer: RendererInjectionKey as symbol,\n composer: ComposerInjectionKey as symbol,\n },\n emits: ['ready'],\n setup(): EffectSetupInterface {\n return {}\n },\n created() {\n if (!this.composer) {\n console.error('Missing parent EffectComposer')\n }\n if (!this.renderer) {\n console.error('Missing parent Renderer')\n }\n },\n unmounted() {\n if (this.pass) {\n this.composer?.removePass(this.pass);\n (this.pass as any).dispose?.()\n }\n },\n methods: {\n initEffectPass(pass: Pass) {\n this.pass = pass\n this.composer?.addPass(pass)\n this.$emit('ready', pass)\n },\n },\n render() {\n return []\n },\n __hmrId: 'EffectPass',\n})\n","import { defineComponent } from 'vue'\nimport { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js'\nimport EffectPass from './EffectPass'\n\nexport default defineComponent({\n extends: EffectPass,\n created() {\n if (!this.renderer) return\n\n if (!this.renderer.scene) {\n console.error('Missing Scene')\n return\n }\n if (!this.renderer.camera) {\n console.error('Missing Camera')\n return\n }\n const pass = new RenderPass(this.renderer.scene, this.renderer.camera)\n this.initEffectPass(pass)\n },\n __hmrId: 'RenderPass',\n})\n","import { defineComponent, watch } from 'vue'\nimport { BokehPass } from 'three/examples/jsm/postprocessing/BokehPass.js'\nimport EffectPass from './EffectPass'\n\nconst props = {\n focus: { type: Number, default: 1 },\n aperture: { type: Number, default: 0.025 },\n maxblur: { type: Number, default: 0.01 },\n} as const\n\nexport default defineComponent({\n extends: EffectPass,\n props,\n created() {\n if (!this.renderer) return\n\n if (!this.renderer.scene) {\n console.error('Missing Scene')\n return\n }\n if (!this.renderer.camera) {\n console.error('Missing Camera')\n return\n }\n\n const params = {\n focus: this.focus,\n aperture: this.aperture,\n maxblur: this.maxblur,\n width: this.renderer.size.width,\n height: this.renderer.size.height,\n }\n\n const pass = new BokehPass(this.renderer.scene, this.renderer.camera, params)\n\n Object.keys(props).forEach(p => {\n // @ts-ignore\n watch(() => this[p], (value) => { pass.uniforms[p].value = value })\n })\n\n this.initEffectPass(pass)\n },\n __hmrId: 'BokehPass',\n})\n","import { defineComponent, watch } from 'vue'\nimport { FilmPass } from 'three/examples/jsm/postprocessing/FilmPass.js'\nimport EffectPass from './EffectPass'\n\nconst props = {\n noiseIntensity: { type: Number, default: 0.5 },\n scanlinesIntensity: { type: Number, default: 0.05 },\n scanlinesCount: { type: Number, default: 4096 },\n grayscale: { type: Number, default: 0 },\n} as const\n\nexport default defineComponent({\n extends: EffectPass,\n props,\n created() {\n const pass = new FilmPass(this.noiseIntensity, this.scanlinesIntensity, this.scanlinesCount, this.grayscale)\n\n Object.keys(props).forEach(p => {\n // @ts-ignore\n watch(() => this[p], (value) => { pass.uniforms[p].value = value })\n })\n\n this.initEffectPass(pass)\n },\n __hmrId: 'FilmPass',\n})\n","import { defineComponent } from 'vue'\nimport { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js'\nimport { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader.js'\nimport EffectPass from './EffectPass'\nimport { SizeInterface } from '../core/useThree'\n\nexport default defineComponent({\n extends: EffectPass,\n created() {\n const pass = new ShaderPass(FXAAShader)\n\n // resize will be first called in renderer init\n this.renderer?.addListener('resize', this.resize)\n\n this.initEffectPass(pass)\n },\n unmounted() {\n this.renderer?.removeListener('resize', this.resize)\n },\n methods: {\n resize({ size }: { size: SizeInterface }) {\n if (this.pass) {\n const { resolution } = (this.pass as ShaderPass).material.uniforms\n resolution.value.x = 1 / size.width\n resolution.value.y = 1 / size.height\n }\n },\n },\n __hmrId: 'FXAAPass',\n})\n","import { defineComponent, watch } from 'vue'\nimport { HalftonePass } from 'three/examples/jsm/postprocessing/HalftonePass.js'\nimport EffectPass from './EffectPass'\n\nconst props = {\n shape: { type: Number, default: 1 },\n radius: { type: Number, default: 4 },\n rotateR: { type: Number, default: Math.PI / 12 * 1 },\n rotateG: { type: Number, default: Math.PI / 12 * 2 },\n rotateB: { type: Number, default: Math.PI / 12 * 3 },\n scatter: { type: Number, default: 0 },\n} as const\n\nexport default defineComponent({\n extends: EffectPass,\n props,\n created() {\n if (!this.renderer) return\n\n const pass = new HalftonePass(this.renderer.size.width, this.renderer.size.height, {})\n\n Object.keys(props).forEach(p => {\n // @ts-ignore\n pass.uniforms[p].value = this[p]\n // @ts-ignore\n watch(() => this[p], (value) => { pass.uniforms[p].value = value })\n })\n\n this.initEffectPass(pass)\n },\n __hmrId: 'HalftonePass',\n})\n","import { defineComponent } from 'vue'\nimport { SMAAPass } from 'three/examples/jsm/postprocessing/SMAAPass.js'\nimport EffectPass from './EffectPass'\n\nexport default defineComponent({\n extends: EffectPass,\n created() {\n if (!this.renderer) return\n\n const pass = new SMAAPass(this.renderer.size.width, this.renderer.size.height)\n this.initEffectPass(pass)\n },\n __hmrId: 'SMAAPass',\n})\n","import { defineComponent } from 'vue'\nimport { SSAOPass } from 'three/examples/jsm/postprocessing/SSAOPass.js'\nimport EffectPass from './EffectPass'\n\nexport default defineComponent({\n extends: EffectPass,\n props: {\n options: {\n type: Object,\n default: () => ({}),\n },\n },\n created() {\n if (!this.renderer) return\n\n if (!this.renderer.scene) {\n console.error('Missing Scene')\n return\n }\n if (!this.renderer.camera) {\n console.error('Missing Camera')\n return\n }\n\n const pass = new SSAOPass(\n this.renderer.scene,\n this.renderer.camera,\n this.renderer.size.width,\n this.renderer.size.height\n )\n\n Object.keys(this.options).forEach(key => {\n // @ts-ignore\n pass[key] = this.options[key]\n })\n\n this.initEffectPass(pass)\n },\n __hmrId: 'SSAOPass',\n})\n","export default {\n uniforms: {},\n vertexShader: `\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: `\n varying vec2 vUv;\n void main() {\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n }\n `,\n}\n","// From https://github.com/evanw/glfx.js\nimport { Vector2 } from 'three'\nimport DefaultShader from './default'\n\nexport default {\n uniforms: {\n tDiffuse: { value: null },\n blurRadius: { value: 0 },\n gradientRadius: { value: 0 },\n start: { value: new Vector2() },\n end: { value: new Vector2() },\n delta: { value: new Vector2() },\n texSize: { value: new Vector2() },\n },\n vertexShader: DefaultShader.vertexShader,\n fragmentShader: `\n uniform sampler2D tDiffuse;\n uniform float blurRadius;\n uniform float gradientRadius;\n uniform vec2 start;\n uniform vec2 end;\n uniform vec2 delta;\n uniform vec2 texSize;\n varying vec2 vUv;\n\n float random(vec3 scale, float seed) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n }\n\n void main() {\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vUv * texSize - start, normal)) / gradientRadius) * blurRadius;\n for (float t = -30.0; t <= 30.0; t++) {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 texel = texture2D(tDiffuse, vUv + delta / texSize * percent * radius);\n // vec4 texel2 = texture2D(tDiffuse, vUv + vec2(-delta.y, delta.x) / texSize * percent * radius);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n texel.rgb *= texel.a;\n // texel2.rgb *= texel2.a;\n\n color += texel * weight;\n total += 2.0 * weight;\n }\n\n gl_FragColor = color / total;\n\n /* switch back from pre-multiplied alpha */\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n }\n `,\n}\n","import { defineComponent, PropType, watch } from 'vue'\nimport { Vector2 } from 'three'\nimport { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js'\nimport EffectPass from './EffectPass'\nimport TiltShift from '../shaders/TiltShift'\nimport { Vector2PropInterface } from '../core/Object3D'\nimport { bindProp } from '../tools'\n\nconst props = {\n blurRadius: { type: Number, default: 10 },\n gradientRadius: { type: Number, default: 100 },\n start: { type: Object as PropType, default: () => ({ x: 0, y: 100 }) },\n end: { type: Object as PropType, default: () => ({ x: 10, y: 100 }) },\n} as const\n\ninterface TiltShiftPassSetupInterface {\n uniforms1: {[name: string]: { value: any }}\n uniforms2: {[name: string]: { value: any }}\n pass1?: ShaderPass\n pass2?: ShaderPass\n}\n\nexport default defineComponent({\n extends: EffectPass,\n props,\n setup(): TiltShiftPassSetupInterface {\n return { uniforms1: {}, uniforms2: {} }\n },\n created() {\n if (!this.composer) return\n\n this.pass1 = new ShaderPass(TiltShift)\n this.pass2 = new ShaderPass(TiltShift)\n\n const uniforms1 = this.uniforms1 = this.pass1.uniforms\n const uniforms2 = this.uniforms2 = this.pass2.uniforms\n\n // shared uniforms\n uniforms2.blurRadius = uniforms1.blurRadius\n uniforms2.gradientRadius = uniforms1.gradientRadius\n uniforms2.start = uniforms1.start\n uniforms2.end = uniforms1.end\n uniforms2.texSize = uniforms1.texSize\n\n bindProp(this, 'blurRadius', uniforms1.blurRadius, 'value')\n bindProp(this, 'gradientRadius', uniforms1.gradientRadius, 'value')\n\n this.updateFocusLine();\n\n ['start', 'end'].forEach(p => {\n // @ts-ignore\n watch(() => this[p], this.updateFocusLine, { deep: true })\n })\n\n this.pass1.setSize = (width: number, height: number) => {\n uniforms1.texSize.value.set(width, height)\n }\n\n this.initEffectPass(this.pass1)\n this.composer.addPass(this.pass2)\n },\n unmounted() {\n if (this.composer && this.pass2) this.composer.removePass(this.pass2)\n },\n methods: {\n updateFocusLine() {\n this.uniforms1.start.value.copy(this.start)\n this.uniforms1.end.value.copy(this.end)\n const dv = new Vector2().copy(this.end as Vector2).sub(this.start as Vector2).normalize()\n this.uniforms1.delta.value.copy(dv)\n this.uniforms2.delta.value.set(-dv.y, dv.x)\n },\n },\n __hmrId: 'TiltShiftPass',\n})\n","import { defineComponent, watch } from 'vue'\nimport { Vector2 } from 'three'\nimport { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js'\nimport EffectPass from './EffectPass'\n\nconst props = {\n strength: { type: Number, default: 1.5 },\n radius: { type: Number, default: 0 },\n threshold: { type: Number, default: 0 },\n} as const\n\nexport default defineComponent({\n extends: EffectPass,\n props,\n created() {\n if (!this.renderer) return\n\n const size = new Vector2(this.renderer.size.width, this.renderer.size.height)\n const pass = new UnrealBloomPass(size, this.strength, this.radius, this.threshold)\n\n Object.keys(props).forEach(p => {\n // @ts-ignore\n watch(() => this[p], (value) => { pass.uniforms[p].value = value })\n })\n\n this.initEffectPass(pass)\n },\n __hmrId: 'UnrealBloomPass',\n})\n","// From https://github.com/evanw/glfx.js\nimport { Vector2 } from 'three'\nimport DefaultShader from './default'\n\nexport default {\n uniforms: {\n tDiffuse: { value: null },\n center: { value: new Vector2(0.5, 0.5) },\n strength: { value: 0 },\n },\n vertexShader: DefaultShader.vertexShader,\n fragmentShader: `\n uniform sampler2D tDiffuse;\n uniform vec2 center;\n uniform float strength;\n varying vec2 vUv;\n\n float random(vec3 scale, float seed) {\n /* use the fragment position for a different seed per-pixel */\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n }\n \n void main() {\n vec4 color = vec4(0.0);\n float total = 0.0;\n vec2 toCenter = center - vUv;\n \n /* randomize the lookup values to hide the fixed number of samples */\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n \n for (float t = 0.0; t <= 40.0; t++) {\n float percent = (t + offset) / 40.0;\n float weight = 4.0 * (percent - percent * percent);\n vec4 texel = texture2D(tDiffuse, vUv + toCenter * percent * strength);\n\n /* switch to pre-multiplied alpha to correctly blur transparent images */\n texel.rgb *= texel.a;\n\n color += texel * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n\n /* switch back from pre-multiplied alpha */\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n }\n `,\n}\n","import { defineComponent, PropType } from 'vue'\nimport { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js'\nimport EffectPass from './EffectPass'\nimport ZoomBlur from '../shaders/ZoomBlur'\nimport { Vector2PropInterface } from '../core/Object3D'\nimport { bindProp } from '../tools'\n\nexport default defineComponent({\n extends: EffectPass,\n props: {\n center: { type: Object as PropType, default: () => ({ x: 0.5, y: 0.5 }) },\n strength: { type: Number, default: 0.5 },\n },\n created() {\n const pass = new ShaderPass(ZoomBlur)\n\n bindProp(this, 'center', pass.uniforms.center, 'value')\n bindProp(this, 'strength', pass.uniforms.strength, 'value')\n\n this.initEffectPass(pass)\n },\n __hmrId: 'ZoomBlurPass',\n})\n","import { App, createApp as _createApp } from 'vue'\nimport * as TROIS from './index'\n\nexport const TroisJSVuePlugin = {\n install(app: App): void {\n const comps = [\n 'Camera',\n 'OrthographicCamera',\n 'PerspectiveCamera',\n 'Raycaster',\n 'Renderer',\n 'Scene',\n 'Group',\n\n 'AmbientLight',\n 'DirectionalLight',\n 'HemisphereLight',\n 'PointLight',\n 'RectAreaLight',\n 'SpotLight',\n\n 'BasicMaterial',\n 'LambertMaterial',\n 'MatcapMaterial',\n 'PhongMaterial',\n 'PhysicalMaterial',\n 'ShaderMaterial',\n 'StandardMaterial',\n 'SubSurfaceMaterial',\n 'ToonMaterial',\n\n 'Texture',\n 'CubeTexture',\n\n 'Mesh',\n\n 'Box', 'BoxGeometry',\n 'Circle', 'CircleGeometry',\n 'Cone', 'ConeGeometry',\n 'Cylinder', 'CylinderGeometry',\n 'Dodecahedron', 'DodecahedronGeometry',\n 'Icosahedron', 'IcosahedronGeometry',\n 'Lathe', 'LatheGeometry',\n 'Octahedron', 'OctahedronGeometry',\n 'Plane', 'PlaneGeometry',\n 'Polyhedron', 'PolyhedronGeometry',\n 'Ring', 'RingGeometry',\n 'Sphere', 'SphereGeometry',\n 'Tetrahedron', 'TetrahedronGeometry',\n 'Text',\n 'Torus', 'TorusGeometry',\n 'TorusKnot', 'TorusKnotGeometry',\n 'Tube', 'TubeGeometry',\n\n 'Image',\n 'InstancedMesh',\n 'Sprite',\n\n 'FBXModel',\n 'GLTFModel',\n\n 'BokehPass',\n 'EffectComposer',\n 'FilmPass',\n 'FXAAPass',\n 'HalftonePass',\n 'RenderPass',\n 'SAOPass',\n 'SMAAPass',\n 'SSAOPass',\n 'TiltShiftPass',\n 'UnrealBloomPass',\n 'ZoomBlurPass',\n\n 'GLTFViewer',\n ]\n\n comps.forEach(comp => {\n // @ts-ignore\n app.component(comp, TROIS[comp])\n })\n },\n}\n\nexport function createApp(params: any): App {\n return _createApp(params).use(TroisJSVuePlugin)\n}\n","import { Texture, TextureLoader } from 'three'\n\nexport interface TextureConfigInterface {\n src: string\n}\n\nexport interface TexturesInterface {\n loader: TextureLoader\n count: number\n textures: Texture[],\n loadProgress: number\n loadTextures(images: TextureConfigInterface[], cb: {() : void}): void\n dispose(): void\n}\n\nexport default function useTextures(): TexturesInterface {\n const obj: TexturesInterface = {\n loader: new TextureLoader(),\n count: 0,\n textures: [],\n loadProgress: 0,\n loadTextures,\n dispose,\n }\n return obj\n\n function loadTextures(images: TextureConfigInterface[], cb: {() : void}) {\n obj.count = images.length\n obj.textures.splice(0)\n obj.loadProgress = 0\n Promise.all(images.map(loadTexture)).then(cb)\n }\n\n function loadTexture(img: TextureConfigInterface, index: number) {\n return new Promise(resolve => {\n obj.loader.load(\n img.src,\n texture => {\n obj.loadProgress += 1 / obj.count\n obj.textures[index] = texture\n resolve(texture)\n }\n )\n })\n }\n\n function dispose() {\n obj.textures.forEach(t => t.dispose())\n }\n}\n"],"names":["Raycaster","Plane","InstancedMesh","OrthographicCamera","PerspectiveCamera","Scene","Texture","Group","CubeCamera","TMesh","props","BoxGeometry","createGeometry","CircleGeometry","ConeGeometry","CylinderGeometry","DodecahedronGeometry","IcosahedronGeometry","LatheGeometry","OctahedronGeometry","PlaneGeometry","PolyhedronGeometry","RingGeometry","SphereGeometry","TetrahedronGeometry","TorusGeometry","TorusKnotGeometry","TubeGeometry","SpotLight","DirectionalLight","AmbientLight","HemisphereLight","PointLight","RectAreaLight","ShaderMaterial","PointsMaterial","Sprite","Points","EffectComposer","RenderPass","BokehPass","FilmPass","HalftonePass","SMAAPass","SSAOPass","UnrealBloomPass","_createApp"],"mappings":"ysGAE4B,EAA4B,EAAqC,CACvF,YAAgB,gBACX,QAAQ,GAAM,QAAQ,CAAC,CAAC,EAAK,KAAW,GAC3C,GAAO,eAKW,EAAU,EAAiB,EAAgB,GAC7D,QAAQ,GAAQ,GACX,EAAK,EAAM,EAAK,gBAIJ,EAAU,EAAiB,EAAU,EAAwB,MAC9E,GAAW,GAAW,EACtB,EAAM,GAAM,EAAK,GACnB,EAAI,gBAAiB,WACX,EAAI,GAAW,EAAI,SACzB,EAAK,AAAC,GAAU,GAAc,EAAI,GAAW,IAAU,CAAE,KAAM,MAEjE,GAAI,UAAW,GAAY,EAAI,MAC7B,EAAK,AAAC,GAAU,GAAM,GAAY,gBAIhB,EAAgC,EAAoB,GAA6B,MACrG,GAAkC,iBACjC,QAAQ,GAAO,QAAQ,CAAC,CAAC,EAAK,KAAW,CAC1C,EAAC,GAAY,GAAW,CAAC,EAAQ,SAAS,QACrC,GAAO,KAGX,cAGY,EAAgB,EAAgB,EAAwB,UAClE,EAAS,EAAI,EAAI,IACjB,EAAS,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