\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.",[2876,2879],{"name":2877,"color":2878},"bug","d73a4a",{"name":2880,"color":2881},"p3-minor-bug","F28C37",457,"useEventListener bug in controls","2024-07-24T06:42:25Z","https://github.com/Tresjs/cientos/issues/457",0.6809788,{"description":2888,"labels":2889,"number":2892,"owner":2866,"repository":2867,"state":2868,"title":2893,"updated_at":2894,"url":2895,"score":2896},"### 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.",[2890,2891],{"name":2877,"color":2878},{"name":2863,"color":2864},493,"Line2,Modify props.points, but it does not take effect","2024-10-17T16:25:41Z","https://github.com/Tresjs/cientos/issues/493",0.7108915,{"description":2898,"labels":2899,"number":2903,"owner":2866,"repository":2867,"state":2868,"title":2904,"updated_at":2905,"url":2906,"score":2907},"### Description\r\n\r\nAs a Tres dev, I'd sometimes like to show off Tres/Cientos on mobile. But when the docs demos include Leches controls, the Leches controls mostly cover the demo visuals.\r\n\r\n[From Lensflare](https://deploy-preview-272--cientos-tresjs.netlify.app/guide/abstractions/lensflare.html):\r\n\r\n\u003Cimg width=\"322\" alt=\"Screenshot 2023-10-29 at 22 33 56\" src=\"https://github.com/Tresjs/cientos/assets/20469369/55599767-0d8d-456e-b681-810a37a270f3\">\r\n\r\n### Suggested solution\r\n\r\nI suggest that we extend Leches controls so that they can be embedded in the page below the demos. See highlighted area:\r\n\r\n\u003Cimg width=\"318\" alt=\"Screenshot 2023-10-29 at 22 41 46\" src=\"https://github.com/Tresjs/cientos/assets/20469369/1004d966-1e28-4776-b132-0e2c42255244\">\r\n\r\n### Additional requirements\r\n\r\n* the controls would be inserted into the [normal document flow](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Normal_Flow), so that they don't overlap other content\r\n* the controls' styling would reflect the dark/light theme choices of the user\r\n\r\n\r\n### Alternative\r\n\r\nLeave as is.\r\n\r\n### Validations\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.",[2900],{"name":2901,"color":2902},"docs","0075ca",273,"Embed Leches controls under docs demos","2024-04-02T07:13:11Z","https://github.com/Tresjs/cientos/issues/273",0.71141523,{"description":2909,"labels":2910,"number":2915,"owner":2866,"repository":2867,"state":2868,"title":2916,"updated_at":2917,"url":2918,"score":2919},"\r\n\r\n\r\n\r\n### Description\r\n\r\nImplement a MeshRefractionMaterial \r\n\r\n\r\n### Suggested solution\r\n\r\nSome links for context:\r\nhttps://medium.com/geekculture/simulating-refraction-in-three-js-9e367753bf6d\r\nhttps://github.com/pmndrs/drei/blob/master/src/core/MeshRefractionMaterial.tsx\r\nhttps://github.com/pmndrs/drei/blob/master/src/materials/MeshRefractionMaterial.tsx\r\n\r\n### Alternative\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\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.",[2911,2912],{"name":2857,"color":2858},{"name":2913,"color":2914},"p3-significant","2C78E3",454,"MeshRefractionMaterial","2024-07-23T11:40:40Z","https://github.com/Tresjs/cientos/issues/454",0.7227109,{"description":2921,"labels":2922,"number":2927,"owner":2866,"repository":2928,"state":2868,"title":2929,"updated_at":2930,"url":2931,"score":2932},"### Describe the bug\n\nWhile working on the `Joint` I wanted to reproduce the same custom collider exportation, and when I wanted to watch the `Joint` props, I wasn't able to do so...\r\n\r\nI figured that the Vue component `setup function` needs a `Proxy` as the first parameter to **reflect** changes and here:\r\nhttps://github.com/Tresjs/rapier/blob/main/src/components/colliders/index.ts#L29-L42\r\n```ts\r\nprops: {\r\n ...BaseCollider.props,\r\n shape: undefined,\r\n },\r\n setup(props, ctx) {\r\n return {\r\n ...BaseCollider?.setup?.(\r\n { ...props, shape } as Parameters\u003C\r\n Exclude\u003C(typeof BaseCollider)['setup'], undefined>\r\n >['0'],\r\n ctx,\r\n ),\r\n }\r\n },\r\n```\r\n\r\nWe are destructing it which is equivalent to passing a native `Object`\n\n### Reproduction\n\n---\n\n### Steps to reproduce\n\n---\n\n### System Info\n\n```shell\n---\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/rapier/blob/main/CODE_OF_CONDUCT.md)\n- [X] Read the [Contributing Guidelines](https://github.com/Tresjs/rapier/blob/main/CONTRIBUTING.md).\n- [X] Read the [docs](https://rapier.tresjs.org/guide).\n- [X] Check that there isn't [already an issue](https://github.com/Tresjs/rapier/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.",[2923,2924],{"name":2877,"color":2878},{"name":2925,"color":2926},"collider","306B60",149,"rapier","Bug: custom collider props are not reactive anymore.","2024-11-19T23:52:46Z","https://github.com/Tresjs/rapier/issues/149",0.742238,{"description":2934,"labels":2935,"number":2939,"owner":2866,"repository":2940,"state":2941,"title":2942,"updated_at":2943,"url":2944,"score":2945},"### Describe the bug\n\nWe should automatically invalidate when useTexture resolves the textures fetching. Is not really noticeable on the reproduction but I have a asset heavy demo that occurs \n\nhttps://github.com/user-attachments/assets/bfe5ce99-64c8-4b7a-aeea-c97858614a8c\n\n### Reproduction\n\nhttps://stackblitz.com/~/edit/tresjs-minimal-reproduction-sht9ttt5?file=src/App.vue\n\n### Steps to reproduce\n\n_No response_\n\n### System Info\n\n```shell\nSystem:\n OS: Linux 5.0 undefined\n CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz\n Memory: 0 Bytes / 0 Bytes\n Shell: 1.0 - /bin/jsh\n Binaries:\n Node: 18.20.3 - /usr/local/bin/node\n Yarn: 1.22.19 - /usr/local/bin/yarn\n npm: 10.2.3 - /usr/local/bin/npm\n pnpm: 8.15.6 - /usr/local/bin/pnpm\n npmPackages:\n @tresjs/cientos: 4.1.0 => 4.1.0 \n @tresjs/core: 4.3.2 => 4.3.2 \n @tresjs/leches: ^0.14.0 => 0.14.0 \n vite: ^6.0.3 => 6.0.5\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/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.",[2936],{"name":2937,"color":2938},"p4-important-bug","D93F0B",909,"tres","closed","on-demand invalidation not triggered when assets are loaded.","2025-02-06T09:34:37Z","https://github.com/Tresjs/tres/issues/909",0.6178446,{"description":2947,"labels":2948,"number":2949,"owner":2866,"repository":2867,"state":2941,"title":2950,"updated_at":2951,"url":2952,"score":2953},"### Describe the bug\n\nI'm trying to enableDamping on my OrbitControls and I'm unable to call controls.update in the render loop for two reasons: When using the Cientos OrbitControls, if I expose it with a ref it has no update function, and if I access it from context it returns null.\r\n\r\nThere's also a separate issue where orbitControls has no camera attached to it when you expose it unless you explicitly v-bind one to the component (also in stackBlitz attached).\n\n### Reproduction\n\nhttps://stackblitz.com/edit/tresjs-basic-nj82xh?file=src%2Fcomponents%2FTheScene.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.",[],249,"OrbitControls has no update function, also shows null when accessed from context","2023-10-15T10:18:44Z","https://github.com/Tresjs/cientos/issues/249",0.71382487,{"description":2955,"labels":2956,"number":2957,"owner":2866,"repository":2940,"state":2941,"title":2958,"updated_at":2959,"url":2960,"score":2961},"### Description\r\n\r\nBased on https://github.com/orgs/Tresjs/discussions/321\r\n\r\nAs a plugin author, I will like to have a reactive state with the following characteristics:\r\n\r\n- Performant, (use of `shallowRef` where needed)\r\n- read-only\r\n- Strictly Typed\r\n- Reduce side effects on watchers\r\n- Needs to work on cientos and the rest of ecosystem via `provide/inject` \r\n\r\n### Suggested solution\r\n\r\n| Name | Type | Requirement | Details |\r\n| ---------------------------------- | -------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| scene | readonly, shallowRef | essential | |\r\n| cameras | readonly, shallowRef | essential | userData.TRES_IS_ACTIVE_CAMERA = true\u003Cbr>const cameras = shallowRef([]) return { cameras: readonly(cameras)} |\r\n| camera | computed, readonly | essential | |\r\n| pushCamera(newCamera: Camera, setActive: boolean) | function | essential | cameras should be watched and removed from the cameras array if they got removed from the scene |\r\n| removeCamera(camera: Camera) | function | essential ||\r\n| setCamera(cameraId string) | function | essential ||\r\n| renderer | readonly, shallowRef | essential | setRenderer(renderer: Renderer)\u003Cbr>maybe only callable once? |\r\n| setRenderer(renderer: Renderer) | function | essential ||\r\n| sizes (height, width, aspectRatio) | readonly | handy | sizes: {\u003Cbr> height: Ref\u003Cnumber>\u003Cbr> width: Ref\u003Cnumber>\u003Cbr> aspectRatio: Computed\u003Cnumber>\u003Cbr>} |\r\n\r\n### Alternative\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\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.",[],331,"New and better state context provider","2023-07-29T08:58:56Z","https://github.com/Tresjs/tres/issues/331",0.7170743,{"description":2963,"labels":2964,"number":2965,"owner":2866,"repository":2867,"state":2941,"title":2966,"updated_at":2967,"url":2968,"score":2969},"### Description\n\nAs a developer using cientos, I would like to have the minimal bundle possible.\r\n\r\nAtm, the bundle size of cientos is around 600 Kb which is huge, at least 300kb (31%) are coming from [TweakPane](https://cocopon.github.io/tweakpane/)\r\n\r\n\u003Cimg width=\"1479\" alt=\"Screenshot 2023-08-13 at 12 37 22\" src=\"https://github.com/Tresjs/cientos/assets/4699008/9062618d-f7ac-4aad-9b20-9631e4bd2623\">\r\n\r\n\u003Cimg width=\"631\" alt=\"Screenshot 2023-08-13 at 12 38 50\" src=\"https://github.com/Tresjs/cientos/assets/4699008/e4dc5dd6-c344-41b7-bee5-392fc075bbf3\">\r\n\n\n### Suggested solution\n\nTake out tweakpane from the final bundle by making it a peer dep\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.",[],168,"Tweakpane as peer dep","2023-09-29T06:32:30Z","https://github.com/Tresjs/cientos/issues/168",0.72506285,["Reactive",2971],{},["Set"],["ShallowReactive",2974],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fv2D1bNXSOnV-99LcANCZqmBuvinA3MIYX1Lw-OMowf8":-1},"/Tresjs/tres/503"]