Hi all,
In the process of working on the language bindings for PolyVox, I found that due to the reliance of callbacks in the raycast functions, they were hard to wrap. To this end, I opened
issue 22 where David and I discussed a simple API that should cover the most common usecases. The result of this is currently a
commit in a feature branch.
The new function simply takes the volume pointer, a vector to define where the ray should start (usually the user's camera location), a vector to define the direction (probably either the camera direction of offset from that if doing mouse-picking) and finally a single value which represents what is an empty voxel.
This set-up only really makes sense for cubic style terrain but that is where this type of picking happens usually. For smooth terrain, doing mesh picking in your 3D engine is probably best since it's difficult to get right from the density field.
Really, I wanted to ask if anyone had any comments on this. For voxel picking on cubic meshes, is a single example of an empty voxel good enough for most cases? Any special cases we should think about?
The important files are
Picking.h and
Picking.inl.