EmmetOT / BoundingVolumeHierarchy

This is a port of Erin Catto/box2d's b2_dynamic_tree from C++ to C#, intended for use in Unity. It's a very faithful translation with a couple of additional C# creature comforts for usability.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Small suggestions: Leaf iterations, remove asserts on enumerate empty tree.

stuw-u opened this issue · comments

commented

The title is pretty self-explanatory. I'm using your thing in my game, it's working well so far but I'm confused why it would throw an assert when trying to Enumerate on an empty tree. It would make more sense just to "yield break" and not enumerate on anything at all.

I'm also suggesting adding a leaf enumerator that returns the node's values directly. That way I can use the BVH tree as my collection to store my IBVH objects directly instead of letting the user manage two collections, one normal list/dictionary and a BVH.