How can I set checkCollisions for thin instances? In the docs, it it mentioned that thin instances support collisions. However, I couldn’t find any example on how to enable them. What I tried is setting mesh.checkCollisions = true on the mesh that I then call mesh.thinInstanceAdd() on. However, this didn’t work for me.
For picking, there’s an example in the article where picking is enabled by doing
However, I couldn’t find a similar attribute for enabling thinInstanceCheckCollsions.
One thing I found is thinInstanceRegisterAttribute and thinInstanceSetAttributeAt. However, I have no idea if I can use those to enable collisions.
So there’s no way to checkCollisions with the individual instances, right? This occured to me too when I looked at boundingBox of my thinInstance and it was a box that contained every instance.
Sadly that is not enough for my use case, since they’re spread all over the scene, but I think I have another idea that might work for my scene.
As a follow-up question: The thin instances in my scene are spread throughout the scene, but they are clustered, so there are a few points where there’s alot of them and in the rest of the scene, there’s none. Is there any way to “draw an invisible box / bounding-box” around each cluster (I know the position of the clusters). I suppose I could just create a normal box and set it’s alpha to 0, but I’m sure there’s a better way.
I have had similar issues with “clusters” of meshes and the accuracy of my collision detection has been limited by the bounding boxes being cuboids.
I have resorted to doing collision detection via CSG intersections. It’s reliable but for large number of meshes or meshes with a lot of facets it may be slow:
Great, that’w how I implemented it now. I was wondering how that would impact performance/FPS. Do you think this could have a noticable effect on my scene? I have approximately n/6 collider boxes (set to invisible) for n meshes and n instanced meshes. I didn’t really notice any performance decrease when just viewing the scene.