rossborchers / UnityBoundingVolumeHeirachy

Unity Bounding Volume Heirachy (BVH)
Apache License 2.0
119 stars 12 forks source link

Added triangle adapter. #2

Open MattXV opened 2 years ago

MattXV commented 2 years ago

Hi, I've added an implementation of a triangle adapter I needed - figured it might be useful to others. I'm still testing it, but seems to work. P.S. I'm also suggesting a fix for the render method where it would fail due to too many matrices passed in the DrawMeshInstanced.

MattXV commented 2 years ago

Hi! Many thanks again for your amazing work!

My current use case for the Triangle Adapter is ray-triangle intersections in a scene, which I'm using for ray tracing. Mesh collisions, as you said, would be another interesting use case. Otherwise, I'll make sure to add a unit test and apply all the requested changes over the next week.

I'll keep you updated on this. Thank you again :)