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zuaptn0zKuXz8y8f2958fU0Hx8Ez83qyC5Fs8LKCXaPdhK7FGwYb0u8knWOH/fbKW5YJvN+c/kl/ASL5wGgNshDWIshs4r/ajLzAs/6l5t/IdZ7uollCLV7WPft21w/1ZC4Fv3jiP99sxfsGlw8r6cX9v+OZfbu8GKw==\n\n### Steps to reproduce\n\nOpen the reproduction-url and use the orbit-controls -> camera will jump.\n\n### System Info\n\n```shell\nUsing the tresjs playground with the latest Edge browser.\n```\n\n\n### Used Package Manager\n\nnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2856],{"name":2857,"color":2858},"pending-triage","97A4FE",791,"Tresjs","tres","open","reactive property bug","2024-08-21T09:46:13Z","https://github.com/Tresjs/tres/issues/791",0.7643086,{"description":2868,"labels":2869,"number":2876,"owner":2860,"repository":2877,"state":2862,"title":2878,"updated_at":2879,"url":2880,"score":2881},"### Describe the bug\r\n\r\nSome controls have long-standing bugs where changing props causes duplicate events to be added. \r\n\r\nE.g., flipping makeDefault in CameraControls causes duplicate events to be added. This will add 100 duplicate events:\r\n\r\n```\r\nconst makeDefault = shallowRef(true)\r\n// Flip `makeDefault` 100 times, add 100 events! Lol\r\nArray.from({length: 100}).fill(0).forEach(\r\n (_, i) => setTimeout(\r\n () => {\r\n makeDefault.value = !makeDefault.value\r\n }, i * 1000 / 25)\r\n)\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003CTresLeches />\r\n \u003CTresCanvas v-bind=\"gl\">\r\n \u003CTresPerspectiveCamera :position=\"[5, 5, 5]\" />\r\n \u003CCameraControls\r\n v-bind=\"controlsState\"\r\n ref=\"controlsRef\"\r\n :make-default=\"makeDefault\"\r\n @change=\"onChange\"\r\n @start=\"onStart\"\r\n @end=\"onEnd\"\r\n />\r\n \r\n```\r\n \r\n \r\nThat means every time these emits would be expected to fire once, they're fired 100 times:\r\n\r\n```\r\nfunction addEventListeners() {\r\n useEventListener(controlsRef.value as any, 'update', () => {\r\n emit('change', controlsRef.value)\r\n invalidateOnDemand()\r\n })\r\n useEventListener(controlsRef.value as any, 'controlend', () => emit('end', controlsRef.value))\r\n useEventListener(controlsRef.value as any, 'controlstart', () => emit('start', controlsRef.value))\r\n}\r\n```\r\n\r\nThe problem is the anonymous functions:\r\n\r\nNote: If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an addEventListener call, the second function will also be added to the list of event listeners for that target.\r\n\r\nIndeed, anonymous functions are not identical even if defined using the same unchanging source-code called repeatedly, even if in a loop.\r\n\r\nRepeatedly defining the same unnamed function in such cases can be problematic. (See Memory issues, below.)\r\n\r\nhttps://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\r\nMDN Web Docs\r\n[EventTarget: addEventListener() method - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)\r\nThe addEventListener() method of the EventTarget interface\r\nsets up a function that will be called whenever the specified event is delivered to the target.\r\n\r\n### Reproduction\r\n\r\nN/A\r\n\r\n### Steps to reproduce\r\n\r\n_No response_\r\n\r\n### System Info\r\n\r\n_No response_\r\n\r\n### Used Package Manager\r\n\r\nnpm\r\n\r\n### Code of Conduct\r\n\r\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/cientos/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/cientos/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://cientos.tresjs.org/guide).\r\n- [X] Check that there isn't [already an issue](https://github.com/Tresjs/cientos/issues) that reports the same bug to avoid creating a duplicate.\r\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2870,2873],{"name":2871,"color":2872},"bug","d73a4a",{"name":2874,"color":2875},"p3-minor-bug","F28C37",457,"cientos","useEventListener bug in controls","2024-07-24T06:42:25Z","https://github.com/Tresjs/cientos/issues/457",0.7762968,{"description":2883,"labels":2884,"number":2889,"owner":2860,"repository":2877,"state":2862,"title":2890,"updated_at":2891,"url":2892,"score":2893},"### Describe the bug\n\nI used Line2 to add a point to the props.points, but it doesn't seem to render. \r\nSpecifically, points larger than the original array were not rendered, but points smaller than the original array were re rendered\n\n### Reproduction\n\nhttps://stackblitz.com/edit/tresjs-basic-kftrax?file=src%2Fcomponents%2FTheExperience.vue\n\n### Steps to reproduce\n\n_No response_\n\n### System Info\n\n_No response_\n\n### Used Package Manager\n\nnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/cientos/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/cientos/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://cientos.tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/Tresjs/cientos/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2885,2886],{"name":2871,"color":2872},{"name":2887,"color":2888},"p2-nice-to-have","D4C5F9",493,"Line2,Modify props.points, but it does not take effect","2024-10-17T16:25:41Z","https://github.com/Tresjs/cientos/issues/493",0.77773166,{"description":2895,"labels":2896,"number":2904,"owner":2860,"repository":2877,"state":2862,"title":2905,"updated_at":2906,"url":2907,"score":2908},"### Describe the bug\r\n\r\n`useAnimations` is not working when the project dependencies are installed using `npm` \r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/edit/stackblitz-starters-mrz7qx?file=src%2Fcomponents%2FTheExperience.vue\r\n\r\n### Steps to reproduce\r\n\r\n_No response_\r\n\r\n### System Info\r\n\r\n```shell\r\nystem:\r\n OS: Linux 5.0 undefined\r\n CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz\r\n Memory: 0 Bytes / 0 Bytes\r\n Shell: 1.0 - /bin/jsh\r\n Binaries:\r\n Node: 18.18.0 - /usr/local/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 9.4.2 - /usr/local/bin/npm\r\n pnpm: 8.14.0 - /usr/local/bin/pnpm\r\n npmPackages:\r\n @tresjs/cientos: 3.7.0 => 3.7.0 \r\n @tresjs/core: 3.6.0 => 3.6.0 \r\n vite: ^5.0.11 => 5.0.11 \r\n\r\n```\r\n\r\n\r\n\r\n### Used Package Manager\r\n\r\nnpm\r\n\r\n### Code of Conduct\r\n\r\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/cientos/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/cientos/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://cientos.tresjs.org/guide).\r\n- [X] Check that there isn't [already an issue](https://github.com/Tresjs/cientos/issues) that reports the same bug to avoid creating a duplicate.\r\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2897,2898,2901],{"name":2871,"color":2872},{"name":2899,"color":2900},"investigation","D0359D",{"name":2902,"color":2903},"waiting for author","DEEAB8",326,"useAnimations does not work if project uses npm as package manager","2024-04-05T14:57:17Z","https://github.com/Tresjs/cientos/issues/326",0.779589,{"description":2910,"labels":2911,"number":2921,"owner":2860,"repository":2861,"state":2862,"title":2922,"updated_at":2923,"url":2924,"score":2925},"### Description\n\nWebGPU [Three.js r171](https://github.com/mrdoob/three.js/releases) has been released and it’s a major milestone for WebGPU integration with third-party libraries such as React Three Fiber and bundlers like Vite or Next.js. We can now do this with zero configuration:\r\n\r\nThree.js Vanilla Three.js\r\n\r\n```ts\r\nimport * as THREE from 'three'\r\nimport { WebGPURenderer } from 'three/webgpu'\r\n \r\nconst renderer = new WebGPURenderer()\r\n```\r\n\r\nR3F\r\n\r\n```ts\r\nimport { Canvas } from '@react-three/fiber'\r\nimport { WebGPURenderer } from 'three/webgpu'\r\n \r\n\u003CCanvas gl={canvas => new WebGPURenderer({ canvas })}>\r\n```\n\n### Suggested solution\n\nEnable a `renderer` prop to override the renderer, restricted to canvas-based WebGL/WebGPU renderers.\r\n\r\n```vue\r\n\u003Cscript setup>\r\nimport { WebGPURenderer } from 'three/webgpu'\r\n\u003C/script>\r\n\r\n\u003Ctemplate>\r\n \u003CTresCanvas :renderer=\"WebGPURenderer\" />\r\n\u003C/template>\r\n```\n\n### Alternative\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.",[2912,2915,2918],{"name":2913,"color":2914},"feature","c2e0c6",{"name":2916,"color":2917},"p3-significant","2C78E3",{"name":2919,"color":2920},"v5","EFC959",883,"WebGPU support","2025-02-06T09:35:42Z","https://github.com/Tresjs/tres/issues/883",0.7833854,{"description":2927,"labels":2928,"number":2931,"owner":2860,"repository":2877,"state":2862,"title":2932,"updated_at":2933,"url":2934,"score":2935},"### Describe the bug\n\n`useProgress` uses threejs `DefaultLoadingManager` under the hood. Progress restarts with concurrent resources\n\n### Reproduction\n\nhttps://lab.tresjs.org/experiments/potions-classroom\n\n### Steps to reproduce\n\n_No response_\n\n### System Info\n\n_No response_\n\n### Used Package Manager\n\npnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/cientos/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/cientos/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://cientos.tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/Tresjs/cientos/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2929,2930],{"name":2871,"color":2872},{"name":2874,"color":2875},575,"useProgress re-starts when other resources start loading","2025-01-02T14:42:43Z","https://github.com/Tresjs/cientos/issues/575",0.7867688,{"description":2937,"labels":2938,"number":2941,"owner":2860,"repository":2861,"state":2862,"title":2942,"updated_at":2943,"url":2944,"score":2945},"### Describe the bug\r\n\r\nAn object's `pointer-leave` event is fired more than once on a single \"leave\" if it is the descendant of another element that also defines a `pointer-leave`:\r\n\r\n```vue\r\n\u003CTresGroup @pointer-leave=\"() => {}\">\r\n \u003CTresMesh @pointer-leave=\"() => { console.log('Leave') }\">\r\n \u003CTresBoxGeometry :args=\"[1, 1, 1]\" />\r\n \u003CTresMeshToonMaterial color=\"#efefef\" />\r\n \u003C/TresMesh>\r\n\u003C/TresGroup>\r\n```\r\n\r\nSee also: `pointer-out` exhibits similar behavior.\r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/edit/tresjs-minimal-reproduction-qd169j?file=src%2Fcomponents%2FTheExperience.vue\r\n\r\n### Steps to reproduce\r\n\r\n* Open Stackblitz link in a browser.\r\n* Mouse over cube, then leave.\r\n* See browser console: multiple `pointer-leave` events will be logged.\r\n\r\n### System Info\r\n\r\n_No response_\r\n\r\n### Used Package Manager\r\n\r\nnpm\r\n\r\n### Code of Conduct\r\n\r\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\r\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\r\n- [X] Read the [docs](https://tresjs.org/guide).\r\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.\r\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2939,2940],{"name":2871,"color":2872},{"name":2874,"color":2875},801,"`pointer-{leave,out}` fired multiple times on single \"leave\"","2025-01-02T17:17:01Z","https://github.com/Tresjs/tres/issues/801",0.78805107,{"description":2947,"labels":2948,"number":2951,"owner":2860,"repository":2861,"state":2862,"title":2952,"updated_at":2953,"url":2954,"score":2955},"### Description\n\nAs a developer using Tres I would like to have an easy and fast way to add or remove layers to my instances.\r\n\r\n\n\n### Suggested solution\n\nMy suggestion is something like:\r\n\r\n\u003CTresMesh v-layer:enable=\"1\" />\r\n\r\nWe should accept an array too\r\n\u003CTresMesh v-layer:enable=\"[1, 2, 3]\" />\r\n\r\nAnd of course other methods like: disable, test (maybe with a console.log), toggle\r\n\r\nFor more info, check:\r\nhttps://threejs.org/docs/index.html?q=layers#api/en/core/Layers\r\n\n\n### Alternative\n\nAny other alternative is considered\n\n### Additional context\n\nAs we discuss, you can achieve this by using template ref, but sometimes is just too much code, this Issue will could improve the UX\r\n\r\nFollowing the directives pattern (to make our user easier)\n\n### Validations\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/tres/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/tres/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/tres/issues) that reports the same bug to avoid creating a duplicate.",[2949,2950],{"name":2913,"color":2914},{"name":2887,"color":2888},543,"v-layer directive","2024-03-30T15:32:13Z","https://github.com/Tresjs/tres/issues/543",0.7880518,{"description":2957,"labels":2958,"number":2964,"owner":2860,"repository":2877,"state":2965,"title":2966,"updated_at":2967,"url":2968,"score":2969},"### Description\n\nAs a developer using `@tresjs/cientos` I want to be able to benefit from on-demand and conditional renderinghttps://github.com/Tresjs/tres/pull/497 while using the abstractions provided by this package\n\n### Suggested solution\n\nUse `invalidate` and `advance` on the abstractions that require it:\r\n\r\nEx: OrbitControls\n\n### Alternative\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/cientos/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/cientos/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://cientos.tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/tresjs/cientos/issues) that reports the same bug to avoid creating a duplicate.",[2959,2960,2963],{"name":2913,"color":2914},{"name":2961,"color":2962},"v4","EEF2B0",{"name":2916,"color":2917},423,"closed","Enable render modes usage on abstractions","2024-08-28T19:22:46Z","https://github.com/Tresjs/cientos/issues/423",0.7485135,{"description":2971,"labels":2972,"number":1499,"owner":2860,"repository":2877,"state":2965,"title":2974,"updated_at":2975,"url":2976,"score":2977},"### Describe the bug\n\nUsing ScrollControls on the Nuxt playground gets broken \r\n\r\n\r\nhttps://github.com/Tresjs/cientos/assets/4699008/1a739f12-df88-4235-9793-f9859520c2e7\r\n\r\n\n\n### Reproduction\n\nhttps://deploy-preview-52--tresjs-playground.netlify.app/experiments/scroll-controls\n\n### Steps to reproduce\n\n_No response_\n\n### System Info\n\n```shell\nSystem:\r\n OS: macOS 13.4.1\r\n CPU: (8) arm64 Apple M1 Pro\r\n Memory: 100.84 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 18.14.1 - ~/.nvm/versions/node/v18.14.1/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 9.3.1 - ~/.nvm/versions/node/v18.14.1/bin/npm\r\n Browsers:\r\n Brave Browser: 114.1.52.130\r\n Chrome: 114.0.5735.198\r\n Firefox: 114.0.2\r\n Safari: 16.5.1\r\n npmPackages:\r\n @tresjs/cientos: 2.3.0 => 2.3.0 \r\n @tresjs/core: ^2.4.0 => 2.4.0 \r\n @tresjs/nuxt: 1.0.0 => 1.0.0 \r\n @tresjs/post-processing: ^0.3.0 => 0.3.0\n```\n\n\n### Used Package Manager\n\npnpm\n\n### Code of Conduct\n\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/Tresjs/cientos/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/cientos/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://cientos.tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/Tresjs/cientos/issues) that reports the same bug to avoid creating a duplicate.\n- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.",[2973],{"name":2871,"color":2872},"ScrollControls not working correctly on Nuxt ","2023-07-12T06:05:12Z","https://github.com/Tresjs/cientos/issues/129",0.7589007,["Reactive",2979],{},["Set"],["ShallowReactive",2982],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fXn2Uxm9MIjvkN9Gb6PWOy4n9Fdt5E4eI4t5FkHqMDzU":-1},"/Tresjs/rapier/123"]