Hopefully this pickVoxel function will fulfil most most need with
raycasting which aren't covered by the existing raycast functions.
It's essentially a wrapper around the current functions, using a custom
functor to store the position of a solid voxel as well as the previous
empty voxel. It doesn't require the user to provide a functor of their own,
just the value that they've assigned to empty voxels.
As well as the function itself, we also have a unit test as well as it
being built in the bindings.
This file assumes that the compiler doesn't support anything. If building
without CMake, it will be used and if you want to enable things, the file
can be edited.
When using CMake, a proper CompilerCapabilites.h will be generated and
CMake will set the include path order correctly in order to source the
correct file.
This is only beginning of the bindings here. It's starting to get more
complicated due to the use of callbacks. To be able to define a callback
function in Python which is then called by a C++ algorithm requires quite a
bit of wrapping boilerplate.
The class PyCallback here will wrap a Python callable and call it with the
density value of the voxel. It's not very generic and at present it can't
pass the sampler itself since it's not available in the Python bindings.
Regardless, the new test added here (TestRaycast.py) works as expected and
hopefully we will be able to build up from here.
It will #define a each of the basic features detected by CMake which can
then be used by other headers (like TypeDef.h) to set things up for
PolyVox.
It is this file which you will have to manually edit and rename if you want
to skip using CMake.
As discussed on the forums, to simplify the CMake code and avoid having to
manually specify dependencies this removes the hack to allow both static
and shared libraries to be built at the same time.
It introduces the new variable LIBRARY_TYPE which can be either STATIC or
DYNAMIC.
See: http://www.volumesoffun.com/phpBB3/viewtopic.php?p=3203#p3203
The user can choose static or dynamic libraries using
BUILD_STATIC_LIBRARIES and BUILD_DYNAMIC_LIBRARIES. By default
Windows will only build static libraries and Linux will build both.