oframe / ogl

Minimal WebGL Library
https://oframe.github.io/ogl/examples
3.71k stars 211 forks source link

Intersect mesh state #164

Closed willybrauner closed 1 year ago

willybrauner commented 1 year ago

Hi! I'm trying to get an updated intersect meshes array when a mesh intersect with another one. After digging through the OGL sources, I do not find a method to do this check.

I reproduce a minimal example of this case witch not work with raycast.intersectMeshes method. (definitely i missed something about this one) https://codesandbox.io/s/ogl-mesh-intersect-example-6s2mcp?file=/src/index.ts

For comparison, I also reproduced this case with threejs who provide theintersectBox method on the vector 3. The intersect state is update as needed. https://codesandbox.io/s/three-intersect-example-nuejk8?file=/src/index.ts:0-1245

Is there a way to achieve this as mesh1.intersectWith(mesh2) with ogl, or another pattern which would allow to get this updated state?

gordonnl commented 1 year ago

Did you manage to find a solution in the end?

willybrauner commented 1 year ago

Unfortunately I did not easily manage to cover this feature with ogl. Thanks anyway!