component","2025-04-24T09:26:06Z","https://github.com/Tresjs/tres/issues/1002",0.7761046,{"description":2901,"labels":2902,"number":2906,"owner":2874,"repository":2907,"state":2876,"title":2908,"updated_at":2909,"url":2910,"score":2911},"### Description\n\nAs a developer using TresJS,\nI want a straightforward way to enable a bounding volume hierarchy (BVH) on my 3D meshes and geometries,\nso that I can benefit from drastically improved raycasting performance and more efficient collision detection in complex scenes.\n\n### Reason / Use Cases\n- **Performance Gains**: A BVH can accelerate raycasting operations, especially for large/complex geometry.\n\n- **Collision Detection**: Many real-time applications (e.g. games, simulations) need fast collision checks; BVH can help optimize these.\n\n- **Simplicity & Consistency**: Having a composable approach in TresJS aligns with the rest of the API, keeping logic encapsulated and Vue-friendly.\n\n### Suggested solution\n\nIn the appropriate module (e.g.,`/useBVH.ts` or similar), we could provide:\n\n> [!TIP]\n> Check R3F Drei's implementation https://drei.docs.pmnd.rs/performances/bvh\n\n```ts\nimport { ref, onMounted } from 'vue'\n// Possibly import { MeshBVH, MeshBVHVisualizer } from 'three-mesh-bvh' \n// or any relevant utility from three-mesh-bvh\n\nexport function useBVH(geometryRef) {\n const bvhRef = ref(null)\n\n onMounted(() => {\n // Pseudocode: \n // 1. Create or update the BVH\n // 2. Store the result in bvhRef\n // 3. Optionally expose utilities for intersection, collision checks, etc.\n\n // Example:\n // bvhRef.value = new MeshBVH(geometryRef.value)\n })\n\n // Return whatever is helpful for the user:\n // e.g. the BVH instance, methods for raycasting, collision checks, etc.\n return {\n bvhRef,\n // raycastWithBVH, collisionCheck, etc.\n }\n}\n```\n\nReactive Updates\n\nOptionally watch for changes in the provided geometry or the mesh and re-build BVH if necessary.\n\n### Alternative\n\n_No response_\n\n### Additional context\n\n- Potentially wrap [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) or another library under the hood.\n- Consider how to handle dynamic geometries versus static ones (e.g., partial updates vs. full rebuilds).\n- Align the API style with other TresJS composables (useXyz naming, returning refs or methods, etc.).\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.",[2903],{"name":2904,"color":2905},"p4-important-bug","D93F0B",604,"cientos","useBVH (Bounding Volume Hierarchy) composable","2025-03-24T15:26:01Z","https://github.com/Tresjs/cientos/issues/604",0.77788293,{"description":2913,"labels":2914,"number":2921,"owner":2874,"repository":2907,"state":2876,"title":2922,"updated_at":2923,"url":2924,"score":2925},"### Description\n\nAs developer using TresJs I would like to have a easy way to \"embed\" images (textures) to an existing mesh.\n\n### Suggested solution\n\nSee: https://github.com/pmndrs/drei#decal\n\n### Alternative\n\nFeel free to come with another alternative\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.",[2915,2918],{"name":2916,"color":2917},"feature","c2e0c6",{"name":2919,"color":2920},"p3-significant","2C78E3",282,"Decal component","2024-11-24T11:20:26Z","https://github.com/Tresjs/cientos/issues/282",0.7962427,{"description":2927,"labels":2928,"number":2936,"owner":2874,"repository":2875,"state":2937,"title":2938,"updated_at":2939,"url":2940,"score":2941},"Add more insightful changes\r\n\r\n- [x] Extend is no longer from `useCatalog` \r\n- [x] Models ref value getModel is deprecated\r\n- [x] Controls needs to be below the camera\r\n- [x] Change `three/examples/jsm` to `three/addons`",[2929,2932,2935],{"name":2930,"color":2931},"docs","0075ca",{"name":2933,"color":2934},"v2","FEE22E",{"name":2868,"color":2869},206,"closed","Improve migration guide","2023-04-18T07:57:51Z","https://github.com/Tresjs/tres/issues/206",0.79311365,{"description":2943,"labels":2944,"number":2945,"owner":2874,"repository":2907,"state":2937,"title":2946,"updated_at":2947,"url":2948,"score":2949},"### Description\n\nAs a dev using TresJS, I would like to have smooth OrbitControls and TrackballControls\n\n### Suggested solution\n\nhttps://twitter.com/niccolofanton/status/1836727821005139988\r\nhttps://github.com/niccolofanton/SmoothOrbitControls\r\n\r\nCredits @niccolofanton\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/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.",[],495,"Smooth Orbit Controls","2024-09-27T16:09:51Z","https://github.com/Tresjs/cientos/issues/495",0.7996734,{"description":2951,"labels":2952,"number":2958,"owner":2874,"repository":2959,"state":2937,"title":2960,"updated_at":2961,"url":2962,"score":2963},"I'm using `nuxt` with `SSG`, so running `nuxt generate` to build it,\r\nI noticed this thing, everything works fine in dev mode, but when i build using `generate` the `onLoop` function never get called. \r\nAttached I have the reproduction link\r\n\r\nI'm running on \r\n\r\n```json\r\n \"nuxt\": \"^3.11.2\",\r\n \"@tresjs/cientos\": \"^3.8.0\",\r\n \"@tresjs/core\": \"^3.8.0\",\r\n \"@tresjs/nuxt\": \"^2.1.1\",\r\n ```\r\n \r\nDEV MODE, as you can see it triggers the logs correctly, including the loop\r\n\r\n\r\nBUILD, the `onLoop` never get triggered\r\n\r\n\r\n\r\n\r\n### Reproduction\r\n\r\nhttps://stackblitz.com/edit/nuxt-starter-hsw5j9\r\n\r\n### Steps to reproduce\r\n\r\n`npm i`\r\n`npm run dev`\r\n`npm run generate`\r\n\r\n### System Info\r\n\r\n```shell\r\nSystem:\r\n OS: macOS 14.4.1\r\n CPU: (8) x64 Apple M1\r\n Memory: 16.41 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node\r\n npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm\r\n pnpm: 8.6.7 - ~/Library/pnpm/pnpm\r\n bun: 1.0.17 - ~/.bun/bin/bun\r\n Browsers:\r\n Brave Browser: 122.1.63.169\r\n Chrome: 123.0.6312.107\r\n Safari: 17.4.1\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/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.",[2953,2954,2955],{"name":2893,"color":2894},{"name":2904,"color":2905},{"name":2956,"color":2957},"upstream","DDC01F",97,"nuxt","`onLoop` function not called in `nuxt generate` (SSG) but working in dev mode","2024-07-05T13:42:14Z","https://github.com/Tresjs/nuxt/issues/97",0.801183,{"description":2965,"labels":2966,"number":2971,"owner":2874,"repository":2875,"state":2937,"title":2972,"updated_at":2973,"url":2974,"score":2975},"### Describe the bug\n\n\"Hello, I have two questions:\r\n\r\n1.In the custom rendering, it seems that Vue's unmount hooks, 'onUnmounted' and 'onBeforeUnmount', are not working. I'm using 'onLoop', and when I navigate to another page and then return, it creates a new 'onLoop' which runs alongside the previous one, including the 'onLoop' inside 'useFBO'. Currently, I can only unmount them by using 'onLoop.off' at the root canvas component.\r\n2.I am using version 3.5.1, and I've noticed significant frame drops with touch and other events. I'm not sure if this has been optimized in newer versions.\r\n3.I encounter a problem when using 'Tres' on two different pages. When I navigate from page 1 with 'tres' to page 2 with 'tres', nothing is displayed. However, if I go from page 1 with 'tres' to page 3 without 'tres', and then to page 2 with 'tres', this problem does not occur.\"\r\n\n\n### Reproduction\n\nhttps://github.com/zhangyijie0214/nuxt-tres-test\n\n### Steps to reproduce\n\nnpm install\r\nnpm run dev\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/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.",[2967,2968],{"name":2893,"color":2894},{"name":2969,"color":2970},"waiting for author","B145BC",475,"Routing Jump - Problem Occurring","2024-02-18T01:59:58Z","https://github.com/Tresjs/tres/issues/475",0.80207837,{"description":2977,"labels":2978,"number":2982,"owner":2874,"repository":2907,"state":2937,"title":2983,"updated_at":2984,"url":2985,"score":2986},"### Description\r\n\r\nAfter some investigation, we can add a new section to the Cientos pkg regarding the Vue custom directives:\r\n\r\nThe main goal of this would be to provide more DX for the Tresjs Ecosystem:\r\n\r\nWe can't install them globally, because that will interfere with the treeshaking, so they will be imported and used within each component\r\n\r\nSome of the initial proposals right now are:\r\n- [x] **v-log**: to log the mesh, material/geometry, etc. within the component without making a reference and watching it\r\n- [x] **v-look-at**: as we can use the onRenderLoop inside the directive, we could reference a moving object so that it will always update the look-at property\r\n- [ ] **v-responsive**: a proposal that will accept a breakpoint and apply a function to the current mesh\r\n- [ ] **v-follow**: a simple way to follow another mesh, maintaining the initial distance\r\n- [ ] **v-distance-to**: a simple way to calculate the distance \r\n- [x] **v-light-helper**: create helper for the provided light\r\n\r\n### Suggested solution\r\n\r\nEJ.\r\nconst vLog= {\r\n mounted: (el) => console.log(el)\r\n}\r\n...\r\n\r\n \u003CTresMesh v-log>\r\n \u003CTresTorusGeometry />\r\n \u003CTresMeshBasicMaterial />\r\n \u003C/TresMesh>\r\n\r\n### Alternative\r\n\r\nAny other directive that you can think of will be appreciated\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.",[2979],{"name":2980,"color":2981},"investigation","D0359D",178,"V-directives in cientos proposal","2023-10-07T14:38:28Z","https://github.com/Tresjs/cientos/issues/178",0.80223066,["Reactive",2988],{},["Set"],["ShallowReactive",2991],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fyMu_vbiqh3bUkjj8ekRbyjM6Y-9WMQaP24WnvLBkWDI":-1},"/Tresjs/post-processing/114"]