Merge branch 'feature/header-only' into develop

This commit is contained in:
David Williams 2015-02-07 23:22:00 +01:00
commit 74089437b3
140 changed files with 813 additions and 1364 deletions

View File

@ -50,7 +50,7 @@ endif()
FIND_PACKAGE(Doxygen)
ADD_SUBDIRECTORY(library)
ADD_SUBDIRECTORY(include)
@ -90,6 +90,7 @@ ENDIF()
ADD_SUBDIRECTORY(documentation)
ADD_SUBDIRECTORY(bindings)
set_package_properties(Doxygen PROPERTIES URL http://www.doxygen.org DESCRIPTION "API documentation generator" TYPE OPTIONAL PURPOSE "Building the API documentation")
set_package_properties(Qt4 PROPERTIES DESCRIPTION "C++ framework" URL http://qt-project.org)

View File

@ -39,8 +39,7 @@ add_definitions(-DGLEW_STATIC)
FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR})
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR})
#This will include the shader files inside the compiled binary
QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc)
@ -53,7 +52,7 @@ ADD_EXECUTABLE(BasicExample ${SRC_FILES} ${COMMON_RESOURCES_RCC})
IF(MSVC)
SET_TARGET_PROPERTIES(BasicExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127")
ENDIF(MSVC)
TARGET_LINK_LIBRARIES(BasicExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore)
TARGET_LINK_LIBRARIES(BasicExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
SET_PROPERTY(TARGET BasicExample PROPERTY FOLDER "Examples")
#Install - Only install the example in Windows
@ -64,11 +63,4 @@ IF(WIN32)
ARCHIVE DESTINATION Examples/OpenGL/lib
COMPONENT example
)
#.dlls should be installed in shared builds.
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
ENDIF(WIN32)

View File

@ -23,10 +23,10 @@ freely, subject to the following restrictions:
#include "OpenGLWidget.h"
#include "PolyVoxCore/CubicSurfaceExtractor.h"
#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h"
#include "PolyVoxCore/Mesh.h"
#include "PolyVoxCore/PagedVolume.h"
#include "PolyVox/CubicSurfaceExtractor.h"
#include "PolyVox/MarchingCubesSurfaceExtractor.h"
#include "PolyVox/Mesh.h"
#include "PolyVox/PagedVolume.h"
#include <QApplication>

View File

@ -39,8 +39,7 @@ add_definitions(-DGLEW_STATIC)
FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR})
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR})
#This will include the shader files inside the compiled binary
QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc)
@ -54,7 +53,7 @@ ADD_EXECUTABLE(DecodeOnGPUExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${DECODE_
IF(MSVC)
SET_TARGET_PROPERTIES(DecodeOnGPUExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127")
ENDIF(MSVC)
TARGET_LINK_LIBRARIES(DecodeOnGPUExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore)
TARGET_LINK_LIBRARIES(DecodeOnGPUExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
SET_PROPERTY(TARGET DecodeOnGPUExample PROPERTY FOLDER "Examples")
#Install - Only install the example in Windows
@ -65,11 +64,4 @@ IF(WIN32)
ARCHIVE DESTINATION Examples/OpenGL/lib
COMPONENT example
)
#.dlls should be installed in shared builds.
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
ENDIF(WIN32)

View File

@ -23,10 +23,10 @@ freely, subject to the following restrictions:
#include "OpenGLWidget.h"
#include "PolyVoxCore/CubicSurfaceExtractor.h"
#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h"
#include "PolyVoxCore/Mesh.h"
#include "PolyVoxCore/PagedVolume.h"
#include "PolyVox/CubicSurfaceExtractor.h"
#include "PolyVox/MarchingCubesSurfaceExtractor.h"
#include "PolyVox/Mesh.h"
#include "PolyVox/PagedVolume.h"
#include <QApplication>

View File

@ -41,8 +41,7 @@ add_definitions(-DGLEW_STATIC)
FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR})
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR})
#This will include the shader files inside the compiled binary
QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc)
@ -56,7 +55,7 @@ ADD_EXECUTABLE(OpenGLExample ${SRC_FILES} ${COMMON_RESOURCES_RCC} ${OPENGLEXAMPL
IF(MSVC)
SET_TARGET_PROPERTIES(OpenGLExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127")
ENDIF(MSVC)
TARGET_LINK_LIBRARIES(OpenGLExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore)
TARGET_LINK_LIBRARIES(OpenGLExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
SET_PROPERTY(TARGET OpenGLExample PROPERTY FOLDER "Examples")
#Install - Only install the example in Windows
@ -67,11 +66,4 @@ IF(WIN32)
ARCHIVE DESTINATION Examples/OpenGL/lib
COMPONENT example
)
#.dlls should be installed in shared builds.
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
ENDIF(WIN32)

View File

@ -23,7 +23,7 @@ freely, subject to the following restrictions:
#include "Shapes.h"
#include "PolyVoxCore/MaterialDensityPair.h"
#include "PolyVox/MaterialDensityPair.h"
using namespace PolyVox;

View File

@ -24,8 +24,8 @@ freely, subject to the following restrictions:
#ifndef __OpenGLExample_Shapes_H__
#define __OpenGLExample_Shapes_H__
#include "PolyVoxCore/PagedVolume.h"
#include "PolyVoxCore/MaterialDensityPair.h"
#include "PolyVox/PagedVolume.h"
#include "PolyVox/MaterialDensityPair.h"
void createSphereInVolume(PolyVox::LargeVolume<PolyVox::MaterialDensityPair88>& volData, float fRadius, uint8_t uValue);
void createCubeInVolume(PolyVox::LargeVolume<PolyVox::MaterialDensityPair88>& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue);

View File

@ -21,13 +21,13 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/FilePager.h"
#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h"
#include "PolyVoxCore/MaterialDensityPair.h"
#include "PolyVoxCore/LowPassFilter.h"
#include "PolyVoxCore/RawVolume.h"
#include "PolyVoxCore/Mesh.h"
#include "PolyVoxCore/Impl/Utility.h"
#include "PolyVox/FilePager.h"
#include "PolyVox/MarchingCubesSurfaceExtractor.h"
#include "PolyVox/MaterialDensityPair.h"
#include "PolyVox/LowPassFilter.h"
#include "PolyVox/RawVolume.h"
#include "PolyVox/Mesh.h"
#include "PolyVox/Impl/Utility.h"
#include "Shapes.h"

View File

@ -41,8 +41,7 @@ add_definitions(-DGLEW_STATIC)
FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR})
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR})
#This will include the shader files inside the compiled binary
QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc)
@ -55,7 +54,7 @@ ADD_EXECUTABLE(PagingExample ${SRC_FILES} ${COMMON_RESOURCES_RCC})
IF(MSVC)
SET_TARGET_PROPERTIES(PagingExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127")
ENDIF(MSVC)
TARGET_LINK_LIBRARIES(PagingExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore)
TARGET_LINK_LIBRARIES(PagingExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
SET_PROPERTY(TARGET PagingExample PROPERTY FOLDER "Examples")
configure_file(../common/example.vert example.vert COPYONLY)
@ -69,11 +68,4 @@ IF(WIN32)
ARCHIVE DESTINATION Examples/OpenGL/lib
COMPONENT example
)
#.dlls should be installed in shared builds.
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
ENDIF(WIN32)

View File

@ -24,11 +24,11 @@ freely, subject to the following restrictions:
#include "OpenGLWidget.h"
#include "Perlin.h"
#include "PolyVoxCore/MaterialDensityPair.h"
#include "PolyVoxCore/CubicSurfaceExtractor.h"
#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h"
#include "PolyVoxCore/Mesh.h"
#include "PolyVoxCore/PagedVolume.h"
#include "PolyVox/MaterialDensityPair.h"
#include "PolyVox/CubicSurfaceExtractor.h"
#include "PolyVox/MarchingCubesSurfaceExtractor.h"
#include "PolyVox/Mesh.h"
#include "PolyVox/PagedVolume.h"
#include <QApplication>
@ -147,7 +147,7 @@ int main(int argc, char *argv[])
openGLWidget.show();
PerlinNoisePager* pager = new PerlinNoisePager();
PagedVolume<MaterialDensityPair44> volData(PolyVox::Region::MaxRegion, pager, 64);
PagedVolume<MaterialDensityPair44> volData(PolyVox::Region::MaxRegion(), pager, 64);
volData.setMemoryUsageLimit(8 * 1024 * 1024); // 8Mb
//createSphereInVolume(volData, 30);

View File

@ -39,8 +39,7 @@ add_definitions(-DGLEW_STATIC)
FIND_PACKAGE(OpenGL REQUIRED)
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxCore_BINARY_DIR}/include ${PolyVoxCore_SOURCE_DIR}/include ${GLEW_SOURCE_DIR})
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR})
#This will include the shader files inside the compiled binary
QT4_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc)
@ -53,7 +52,7 @@ ADD_EXECUTABLE(SmoothLODExample ${SRC_FILES} ${COMMON_RESOURCES_RCC})
IF(MSVC)
SET_TARGET_PROPERTIES(SmoothLODExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") #All warnings
ENDIF(MSVC)
TARGET_LINK_LIBRARIES(SmoothLODExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore)
TARGET_LINK_LIBRARIES(SmoothLODExample glew ${QT_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
SET_PROPERTY(TARGET SmoothLODExample PROPERTY FOLDER "Examples")
configure_file(../common/example.vert example.vert COPYONLY)
@ -67,11 +66,4 @@ IF(WIN32)
ARCHIVE DESTINATION Examples/OpenGL/lib
COMPONENT example
)
#.dlls should be installed in shared builds.
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../release/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Release)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxCore.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../debug/PolyVoxUtil.dll DESTINATION Examples/OpenGL/bin CONFIGURATIONS Debug)
ENDIF(WIN32)

View File

@ -23,12 +23,12 @@ freely, subject to the following restrictions:
#include "OpenGLWidget.h"
#include "PolyVoxCore/Density.h"
#include "PolyVoxCore/MarchingCubesSurfaceExtractor.h"
#include "PolyVoxCore/Mesh.h"
#include "PolyVoxCore/RawVolume.h"
#include "PolyVoxCore/PagedVolume.h"
#include "PolyVoxCore/VolumeResampler.h"
#include "PolyVox/Density.h"
#include "PolyVox/MarchingCubesSurfaceExtractor.h"
#include "PolyVox/Mesh.h"
#include "PolyVox/RawVolume.h"
#include "PolyVox/PagedVolume.h"
#include "PolyVox/VolumeResampler.h"
#include <QApplication>

View File

@ -24,7 +24,7 @@ distribution.
#ifndef __BasicExample_OpenGLWidget_H__
#define __BasicExample_OpenGLWidget_H__
#include "PolyVoxCore/Mesh.h"
#include "PolyVox/Mesh.h"
#include "glew/glew.h"

View File

@ -22,26 +22,108 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(PolyVox)
PROJECT(PolyVoxHeaders)
add_subdirectory(PolyVoxCore)
add_subdirectory(PolyVoxUtil)
add_subdirectory(bindings)
#Projects headers files
SET(CORE_INC_FILES
PolyVox/AmbientOcclusionCalculator.h
PolyVox/AmbientOcclusionCalculator.inl
PolyVox/Array.h
PolyVox/AStarPathfinder.h
PolyVox/AStarPathfinder.inl
PolyVox/BaseVolume.h
PolyVox/BaseVolume.inl
PolyVox/BaseVolumeSampler.inl
PolyVox/CubicSurfaceExtractor.h
PolyVox/CubicSurfaceExtractor.inl
PolyVox/DefaultIsQuadNeeded.h
PolyVox/DefaultMarchingCubesController.h
PolyVox/Density.h
PolyVox/FilePager.h
PolyVox/GradientEstimators.h
PolyVox/GradientEstimators.inl
PolyVox/Interpolation.h
PolyVox/IteratorController.h
PolyVox/IteratorController.inl
PolyVox/LargeVolume.h
PolyVox/LowPassFilter.h
PolyVox/LowPassFilter.inl
PolyVox/MarchingCubesSurfaceExtractor.h
PolyVox/MarchingCubesSurfaceExtractor.inl
PolyVox/Material.h
PolyVox/MaterialDensityPair.h
PolyVox/Mesh.h
PolyVox/Mesh.inl
PolyVox/PagedVolume.h
PolyVox/PagedVolume.inl
PolyVox/PagedVolumeChunk.inl
PolyVox/PagedVolumeSampler.inl
PolyVox/PolyVoxForwardDeclarations.h
PolyVox/Picking.h
PolyVox/Picking.inl
PolyVox/RawVolume.h
PolyVox/RawVolume.inl
PolyVox/RawVolumeSampler.inl
PolyVox/Raycast.h
PolyVox/Raycast.inl
PolyVox/Region.h
PolyVox/Region.inl
PolyVox/SimpleVolume.h
PolyVox/Vector.h
PolyVox/Vector.inl
PolyVox/Vertex.h
PolyVox/VolumeResampler.h
PolyVox/VolumeResampler.inl
PolyVox/VoxelFilters.h
PolyVox/VoxelFilters.inl
)
SET(IMPL_INC_FILES
PolyVox/Impl/AStarPathfinderImpl.h
PolyVox/Impl/Config.h
PolyVox/Impl/ErrorHandling.h
PolyVox/Impl/Logging.h
PolyVox/Impl/MarchingCubesTables.h
PolyVox/Impl/RandomUnitVectors.h
PolyVox/Impl/RandomVectors.h
PolyVox/Impl/Timer.h
PolyVox/Impl/TypeDef.h
PolyVox/Impl/Utility.h
)
#NOTE: The following line should be uncommented when building shared libs.
#"Sources" and "Headers" are the group names in Visual Studio.
#They may have other uses too...
#SOURCE_GROUP("Source Files" FILES ${CORE_SRC_FILES})
SOURCE_GROUP("Header Files" FILES ${CORE_INC_FILES})
#SOURCE_GROUP("Source Files\\Impl" FILES ${IMPL_SRC_FILES})
SOURCE_GROUP("Header Files\\Impl" FILES ${IMPL_INC_FILES})
#Tell CMake the paths
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include)
#Core
#Build
# Although we don't build anything for PolyVox, we still add this custom target (which
# doesn't do anything) so that we can browse the source code from within Visual Studio.
ADD_CUSTOM_TARGET(PolyVoxCore SOURCES ${CORE_INC_FILES})
#Install the core header files, including the ones in the Impl subfolder.
INSTALL(DIRECTORY PolyVox/ DESTINATION include/PolyVox COMPONENT development PATTERN "*.git*" EXCLUDE)
#Set up install paths e.g. for PolyVoxConfig.cmake
if(WIN32)
set(CONFIG_FILE_DIR "CMake")
set(PolyVoxCore_LIBRARY_INSTALL_DIRS "PolyVoxCore/lib")
set(PolyVoxUtil_LIBRARY_INSTALL_DIRS "PolyVoxUtil/lib")
set(PolyVoxCore_INCLUDE_INSTALL_DIRS "PolyVoxCore/include")
set(PolyVoxUtil_INCLUDE_INSTALL_DIRS "PolyVoxUtil/include")
set(PolyVox_DOC_INSTALL_DIR "PolyVox/doc")
else(WIN32)
set(CONFIG_FILE_DIR "share/PolyVox/cmake")
set(PolyVoxCore_LIBRARY_INSTALL_DIRS "lib")
set(PolyVoxUtil_LIBRARY_INSTALL_DIRS "lib")
set(PolyVoxCore_INCLUDE_INSTALL_DIRS "include/PolyVoxCore")
set(PolyVoxUtil_INCLUDE_INSTALL_DIRS "include/PolyVoxUtil")
set(PolyVox_DOC_INSTALL_DIR "share/doc/packages/polyvox")
endif(WIN32)

View File

@ -37,9 +37,43 @@ namespace PolyVox
const float sqrt_2 = 1.4143f;
const float sqrt_3 = 1.7321f;
extern const POLYVOX_API Vector3DInt32 arrayPathfinderFaces[6];
extern const POLYVOX_API Vector3DInt32 arrayPathfinderEdges[12];
extern const POLYVOX_API Vector3DInt32 arrayPathfinderCorners[8];
const Vector3DInt32 arrayPathfinderFaces[6] =
{
Vector3DInt32(0, 0, -1),
Vector3DInt32(0, 0, +1),
Vector3DInt32(0, -1, 0),
Vector3DInt32(0, +1, 0),
Vector3DInt32(-1, 0, 0),
Vector3DInt32(+1, 0, 0)
};
const Vector3DInt32 arrayPathfinderEdges[12] =
{
Vector3DInt32(0, -1, -1),
Vector3DInt32(0, -1, +1),
Vector3DInt32(0, +1, -1),
Vector3DInt32(0, +1, +1),
Vector3DInt32(-1, 0, -1),
Vector3DInt32(-1, 0, +1),
Vector3DInt32(+1, 0, -1),
Vector3DInt32(+1, 0, +1),
Vector3DInt32(-1, -1, 0),
Vector3DInt32(-1, +1, 0),
Vector3DInt32(+1, -1, 0),
Vector3DInt32(+1, +1, 0)
};
const Vector3DInt32 arrayPathfinderCorners[8] =
{
Vector3DInt32(-1, -1, -1),
Vector3DInt32(-1, -1, +1),
Vector3DInt32(-1, +1, -1),
Vector3DInt32(-1, +1, +1),
Vector3DInt32(+1, -1, -1),
Vector3DInt32(+1, -1, +1),
Vector3DInt32(+1, +1, -1),
Vector3DInt32(+1, +1, +1)
};
/// This function provides the default method for checking whether a given voxel
/// is valid for the path computed by the AStarPathfinder.
@ -190,6 +224,6 @@ namespace PolyVox
};
}
#include "PolyVoxCore/AStarPathfinder.inl"
#include "PolyVox/AStarPathfinder.inl"
#endif //__PolyVox_AStarPathfinder_H__

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Impl/ErrorHandling.h"
#include "PolyVox/Impl/ErrorHandling.h"
namespace PolyVox
{

View File

@ -27,13 +27,13 @@ freely, subject to the following restrictions:
#include "Impl/RandomUnitVectors.h"
#include "Impl/RandomVectors.h"
#include "PolyVoxCore/Array.h"
#include "PolyVoxCore/Region.h"
#include "PolyVoxCore/Raycast.h"
#include "PolyVox/Array.h"
#include "PolyVox/Region.h"
#include "PolyVox/Raycast.h"
//These two should not be here!
#include "PolyVoxCore/Material.h"
#include "PolyVoxCore/PagedVolume.h"
#include "PolyVox/Material.h"
#include "PolyVox/PagedVolume.h"
#include <algorithm>
@ -77,6 +77,6 @@ namespace PolyVox
void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback);
}
#include "PolyVoxCore/AmbientOcclusionCalculator.inl"
#include "PolyVox/AmbientOcclusionCalculator.inl"
#endif //__AmbientOcclusionCalculator_H__

View File

@ -24,7 +24,7 @@ distribution.
#ifndef __PolyVox_Array_H__
#define __PolyVox_Array_H__
#include <PolyVoxCore/Impl/ErrorHandling.h>
#include <PolyVox/Impl/ErrorHandling.h>
#include <cstdint>

View File

@ -24,8 +24,8 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_BaseVolume_H__
#define __PolyVox_BaseVolume_H__
#include "PolyVoxCore/Region.h"
#include "PolyVoxCore/Vector.h"
#include "PolyVox/Region.h"
#include "PolyVox/Vector.h"
#include <limits>
@ -211,7 +211,7 @@ namespace PolyVox
};
}
#include "PolyVoxCore/BaseVolume.inl"
#include "PolyVoxCore/BaseVolumeSampler.inl"
#include "PolyVox/BaseVolume.inl"
#include "PolyVox/BaseVolumeSampler.inl"
#endif //__PolyVox_BaseVolume_H__

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Impl/Utility.h"
#include "PolyVox/Impl/Utility.h"
namespace PolyVox
{

View File

@ -28,11 +28,11 @@ freely, subject to the following restrictions:
#include "PolyVoxForwardDeclarations.h"
#include "PolyVoxCore/Array.h"
#include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these?
#include "PolyVoxCore/DefaultIsQuadNeeded.h"
#include "PolyVoxCore/Mesh.h"
#include "PolyVoxCore/Vertex.h"
#include "PolyVox/Array.h"
#include "PolyVox/BaseVolume.h" //For wrap modes... should move these?
#include "PolyVox/DefaultIsQuadNeeded.h"
#include "PolyVox/Mesh.h"
#include "PolyVox/Vertex.h"
namespace PolyVox
{
@ -223,6 +223,6 @@ namespace PolyVox
}
}
#include "PolyVoxCore/CubicSurfaceExtractor.inl"
#include "PolyVox/CubicSurfaceExtractor.inl"
#endif

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Impl/Timer.h"
#include "PolyVox/Impl/Timer.h"
namespace PolyVox
{

View File

@ -24,7 +24,7 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_DefaultIsQuadNeeded_H__
#define __PolyVox_DefaultIsQuadNeeded_H__
#include "PolyVoxCore/Impl/TypeDef.h"
#include "PolyVox/Impl/TypeDef.h"
#include <cstdint>

View File

@ -24,7 +24,7 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_MarchingCubesController_H__
#define __PolyVox_MarchingCubesController_H__
#include "PolyVoxCore/BaseVolume.h"
#include "PolyVox/BaseVolume.h"
#include <limits>

View File

@ -24,7 +24,7 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_Density_H__
#define __PolyVox_Density_H__
#include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here
#include "PolyVox/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here
#include "Impl/TypeDef.h"

View File

@ -24,10 +24,10 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_FilePager_H__
#define __PolyVox_FilePager_H__
#include "PolyVoxCore/Impl/TypeDef.h"
#include "PolyVox/Impl/TypeDef.h"
#include "PolyVoxCore/PagedVolume.h"
#include "PolyVoxCore/Region.h"
#include "PolyVox/PagedVolume.h"
#include "PolyVox/Region.h"
#include <cstdlib>
#include <ctime>

View File

@ -24,8 +24,8 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_GradientEstimators_H__
#define __PolyVox_GradientEstimators_H__
#include "PolyVoxCore/Vector.h"
#include "PolyVoxCore/VoxelFilters.h"
#include "PolyVox/Vector.h"
#include "PolyVox/VoxelFilters.h"
#include <vector>
@ -59,6 +59,6 @@ namespace PolyVox
//POLYVOX_API Vector3DFloat computeNormal(VolumeType<uint8_t>* volumeData, const Vector3DFloat& v3dPos, NormalGenerationMethod normalGenerationMethod);
}
#include "PolyVoxCore/GradientEstimators.inl"
#include "PolyVox/GradientEstimators.inl"
#endif //__PolyVox_GradientEstimators_H__

View File

@ -24,7 +24,7 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_AStarPathfinderImpl_H__
#define __PolyVox_AStarPathfinderImpl_H__
#include "PolyVoxCore/Vector.h"
#include "PolyVox/Vector.h"
#include <algorithm>
#include <limits> //For numeric_limits

View File

@ -24,9 +24,9 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_ErrorHandling_H__
#define __PolyVox_ErrorHandling_H__
#include "PolyVoxCore/Impl/Config.h"
#include "PolyVox/Impl/Config.h"
#include "PolyVoxCore/Impl/Logging.h"
#include "PolyVox/Impl/Logging.h"
#include <cstdlib> // For std::exit
#include <iostream> // For std::cerr
@ -155,8 +155,49 @@ freely, subject to the following restrictions:
{
typedef void (*ThrowHandler)(std::exception& e, const char* file, int line);
ThrowHandler getThrowHandler();
void setThrowHandler(ThrowHandler newHandler);
inline void defaultThrowHandler(std::exception& e, const char* file, int line)
{
std::stringstream ss; \
ss << "\n"; \
ss << " PolyVox exception thrown!"; \
ss << " ========================="; \
ss << " PolyVox has tried to throw an exception but it was built without support"; \
ss << " for exceptions. In this scenario PolyVox will call a 'throw handler'"; \
ss << " and this message is being printed by the default throw handler."; \
ss << "\n"; \
ss << " If you don't want to enable exceptions then you should try to determine why"; \
ss << " this exception was thrown and make sure it doesn't happen again. If it was"; \
ss << " due to something like an invalid argument to a function then you should be"; \
ss << " able to fix it quite easily by validating parameters as appropriate. More"; \
ss << " complex exception scenarios (out of memory, etc) might be harder to fix and"; \
ss << " you should replace this default handler with something which is more"; \
ss << " meaningful to your users."; \
ss << "\n"; \
ss << " Exception details"; \
ss << " -----------------"; \
ss << " Line: " << line; \
ss << " File: " << file; \
ss << " Message: " << e.what(); \
ss << "\n"; \
PolyVox::Impl::getLoggerInstance()->logFatalMessage(ss.str()); \
POLYVOX_HALT(); \
}
inline ThrowHandler& getThrowHandlerInstance()
{
static ThrowHandler s_fThrowHandler = &defaultThrowHandler;
return s_fThrowHandler;
}
inline ThrowHandler getThrowHandler()
{
return getThrowHandlerInstance();
}
inline void setThrowHandler(ThrowHandler fNewHandler)
{
getThrowHandlerInstance() = fNewHandler;
}
}
#define POLYVOX_THROW_IF(condition, type, message) \

View File

@ -24,7 +24,7 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_Logging_H__
#define __PolyVox_Logging_H__
#include "PolyVoxCore/Impl/Config.h"
#include "PolyVox/Impl/Config.h"
#include <iostream>
#include <sstream>
@ -70,10 +70,17 @@ namespace PolyVox
namespace Impl
{
Logger*& getLoggerInstance();
inline Logger*& getLoggerInstance()
{
static Logger* s_pLogger = new DefaultLogger;
return s_pLogger;
}
}
void setLogger(Logger* pLogger);
inline void setLogger(Logger* pLogger)
{
Impl::getLoggerInstance() = pLogger;
}
}
#ifdef POLYVOX_LOG_TRACE_ENABLED

View File

@ -0,0 +1,335 @@
/*******************************************************************************
Copyright (c) 2005-2009 David Williams
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*******************************************************************************/
#ifndef __PolyVox_MarchingCubeTables_H__
#define __PolyVox_MarchingCubeTables_H__
#include "PolyVox/Impl/TypeDef.h"
#include <cstdint>
namespace PolyVox
{
//These tables were based on the article "Polygonising a scalar field".
//They have been optimised to allow a more efficient algorithm via bitwise operations.
// http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/index.html
const uint16_t edgeTable[256] =
{
0x000, 0x109, 0x203, 0x30a, 0x80c, 0x905, 0xa0f, 0xb06,
0x406, 0x50f, 0x605, 0x70c, 0xc0a, 0xd03, 0xe09, 0xf00,
0x190, 0x099, 0x393, 0x29a, 0x99c, 0x895, 0xb9f, 0xa96,
0x596, 0x49f, 0x795, 0x69c, 0xd9a, 0xc93, 0xf99, 0xe90,
0x230, 0x339, 0x033, 0x13a, 0xa3c, 0xb35, 0x83f, 0x936,
0x636, 0x73f, 0x435, 0x53c, 0xe3a, 0xf33, 0xc39, 0xd30,
0x3a0, 0x2a9, 0x1a3, 0x0aa, 0xbac, 0xaa5, 0x9af, 0x8a6,
0x7a6, 0x6af, 0x5a5, 0x4ac, 0xfaa, 0xea3, 0xda9, 0xca0,
0x8c0, 0x9c9, 0xac3, 0xbca, 0x0cc, 0x1c5, 0x2cf, 0x3c6,
0xcc6, 0xdcf, 0xec5, 0xfcc, 0x4ca, 0x5c3, 0x6c9, 0x7c0,
0x950, 0x859, 0xb53, 0xa5a, 0x15c, 0x055, 0x35f, 0x256,
0xd56, 0xc5f, 0xf55, 0xe5c, 0x55a, 0x453, 0x759, 0x650,
0xaf0, 0xbf9, 0x8f3, 0x9fa, 0x2fc, 0x3f5, 0x0ff, 0x1f6,
0xef6, 0xfff, 0xcf5, 0xdfc, 0x6fa, 0x7f3, 0x4f9, 0x5f0,
0xb60, 0xa69, 0x963, 0x86a, 0x36c, 0x265, 0x16f, 0x066,
0xf66, 0xe6f, 0xd65, 0xc6c, 0x76a, 0x663, 0x569, 0x460,
0x460, 0x569, 0x663, 0x76a, 0xc6c, 0xd65, 0xe6f, 0xf66,
0x066, 0x16f, 0x265, 0x36c, 0x86a, 0x963, 0xa69, 0xb60,
0x5f0, 0x4f9, 0x7f3, 0x6fa, 0xdfc, 0xcf5, 0xfff, 0xef6,
0x1f6, 0x0ff, 0x3f5, 0x2fc, 0x9fa, 0x8f3, 0xbf9, 0xaf0,
0x650, 0x759, 0x453, 0x55a, 0xe5c, 0xf55, 0xc5f, 0xd56,
0x256, 0x35f, 0x055, 0x15c, 0xa5a, 0xb53, 0x859, 0x950,
0x7c0, 0x6c9, 0x5c3, 0x4ca, 0xfcc, 0xec5, 0xdcf, 0xcc6,
0x3c6, 0x2cf, 0x1c5, 0x0cc, 0xbca, 0xac3, 0x9c9, 0x8c0,
0xca0, 0xda9, 0xea3, 0xfaa, 0x4ac, 0x5a5, 0x6af, 0x7a6,
0x8a6, 0x9af, 0xaa5, 0xbac, 0x0aa, 0x1a3, 0x2a9, 0x3a0,
0xd30, 0xc39, 0xf33, 0xe3a, 0x53c, 0x435, 0x73f, 0x636,
0x936, 0x83f, 0xb35, 0xa3c, 0x13a, 0x033, 0x339, 0x230,
0xe90, 0xf99, 0xc93, 0xd9a, 0x69c, 0x795, 0x49f, 0x596,
0xa96, 0xb9f, 0x895, 0x99c, 0x29a, 0x393, 0x099, 0x190,
0xf00, 0xe09, 0xd03, 0xc0a, 0x70c, 0x605, 0x50f, 0x406,
0xb06, 0xa0f, 0x905, 0x80c, 0x30a, 0x203, 0x109, 0x000
};
const int8_t triTable[256][16] =
{
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1, },
{ 1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1, },
{ 3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1, },
{ 4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1, },
{ 4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1, },
{ 1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1, },
{ 10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1, },
{ 5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1, },
{ 5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1, },
{ 2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1, },
{ 11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1, },
{ 10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1, },
{ 8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1, },
{ 2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1, },
{ 5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1, },
{ 11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1, },
{ 11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, },
{ 7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1, },
{ 10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, },
{ 6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1, },
{ 10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1, },
{ 10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1, },
{ 0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1, },
{ 7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1, },
{ 6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1, },
{ 8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1, },
{ 1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1, },
{ 6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1, },
{ 4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1, },
{ 10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1, },
{ 8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1, },
{ 10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1, },
{ 10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, },
{ 11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1, },
{ 7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1, },
{ 3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1, },
{ 6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1, },
{ 9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, },
{ 6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1, },
{ 7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1, },
{ 3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1, },
{ 9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1, },
{ 1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1, },
{ 4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1, },
{ 7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1, },
{ 6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1, },
{ 0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1, },
{ 6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1, },
{ 9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1, },
{ 1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1, },
{ 0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1, },
{ 11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1, },
{ 6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1, },
{ 1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1, },
{ 10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1, },
{ 0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1, },
{ 1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1, },
{ 6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1, },
{ 3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1, },
{ 6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, },
{ 10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1, },
{ 3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1, },
{ 0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, },
{ 9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1, },
{ 6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1, },
{ 8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1, },
{ 7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1, },
{ 8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1, },
{ 5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1, },
{ 0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1, },
{ 6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1, },
{ 10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, },
{ 10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1, },
{ 10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1, },
{ 3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1, },
{ 6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1, },
{ 1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1, },
{ 0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1, },
{ 8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1, },
{ 3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1, },
{ 6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1, },
{ 10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1, },
{ 10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1, },
{ 2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1, },
{ 1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1, },
{ 11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1, },
{ 1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1, },
{ 2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1, },
{ 7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1, },
{ 7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1, },
{ 0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1, },
{ 7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1, },
{ 10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1, },
{ 2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1, },
{ 9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1, },
{ 9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1, },
{ 11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1, },
{ 9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1, },
{ 7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1, },
{ 1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, },
{ 5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1, },
{ 0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1, },
{ 10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1, },
{ 2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1, },
{ 5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1, },
{ 5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1, },
{ 2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1, },
{ 0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1, },
{ 0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1, },
{ 9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1, },
{ 9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1, },
{ 1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1, },
{ 3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1, },
{ 2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1, },
{ 9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1, },
{ 3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1, },
{ 1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1, },
{ 9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1, },
{ 11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1, },
{ 11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1, },
{ 4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1, },
{ 4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1, },
{ 9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1, },
{ 1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1, },
{ 0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }
};
}
#endif

View File

@ -21,11 +21,16 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Impl/RandomUnitVectors.h"
#ifndef __PolyVox_RandomUnitVectors_H__
#define __PolyVox_RandomUnitVectors_H__
#include "PolyVox/Impl/TypeDef.h"
#include "PolyVox/Vector.h"
namespace PolyVox
{
extern const Vector3DFloat randomUnitVectors[1024] =
const Vector3DFloat randomUnitVectors[1024] =
{
Vector3DFloat(+0.339922f, +0.827727f, -0.446454f),
Vector3DFloat(+0.084104f, -0.552666f, -0.829148f),
@ -1053,3 +1058,5 @@ namespace PolyVox
Vector3DFloat(-0.526640f, +0.820445f, +0.222533f)
};
}
#endif //__PolyVox_RandomUnitVectors_H__

View File

@ -21,11 +21,16 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Impl/RandomVectors.h"
#ifndef __PolyVox_RandomVectors_H__
#define __PolyVox_RandomVectors_H__
#include "PolyVox/Impl/TypeDef.h"
#include "PolyVox/Vector.h"
namespace PolyVox
{
extern const Vector3DFloat randomVectors[1024] =
const Vector3DFloat randomVectors[1024] =
{
Vector3DFloat(+0.348918f, -0.385662f, +0.650197f),
Vector3DFloat(-0.259255f, +0.791559f, +0.920957f),
@ -1053,3 +1058,5 @@ namespace PolyVox
Vector3DFloat(-0.002289f, +0.568834f, -0.069185f)
};
}
#endif //__PolyVox_RandomVectors_H__

View File

@ -26,33 +26,47 @@ freely, subject to the following restrictions:
#include <cstdint>
#ifdef _MSC_VER // Don't worry about the exact version, as long as this is defied.
#include <Windows.h>
#else
#include <chrono>
#endif //_MSC_VER
namespace PolyVox
{
class Timer
{
public:
Timer(bool bAutoStart = true);
Timer(bool bAutoStart = true)
{
if (bAutoStart)
{
start();
}
}
void start(void);
void start(void)
{
m_start = clock::now();
}
float elapsedTimeInSeconds(void);
uint32_t elapsedTimeInMilliSeconds(void);
uint32_t elapsedTimeInMicroSeconds(void);
float elapsedTimeInSeconds(void)
{
std::chrono::duration<float> elapsed_seconds = clock::now() - m_start;
return elapsed_seconds.count();
}
uint32_t elapsedTimeInMilliSeconds(void)
{
std::chrono::duration<float, std::milli> elapsed_milliseconds = clock::now() - m_start;
return elapsed_milliseconds.count();
}
uint32_t elapsedTimeInMicroSeconds(void)
{
std::chrono::duration<float, std::micro> elapsed_microseconds = clock::now() - m_start;
return elapsed_microseconds.count();
}
private:
#if defined(_MSC_VER)
double m_fPCFreq;
__int64 m_iStartTime;
#else //_MSC_VER
typedef std::chrono::system_clock clock;
std::chrono::time_point<clock> m_start;
#endif //_MSC_VER
};
}

View File

@ -21,14 +21,26 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Impl/ErrorHandling.h"
#include "PolyVoxCore/Impl/Utility.h"
#ifndef __PolyVox_Utility_H__
#define __PolyVox_Utility_H__
#include "PolyVox/Impl/TypeDef.h"
#include <cstdint>
namespace PolyVox
{
inline bool isPowerOf2(uint32_t uInput)
{
if (uInput == 0)
return false;
else
return ((uInput & (uInput - 1)) == 0);
}
//Note: this function only works for inputs which are a power of two and not zero
//If this is not the case then the output is undefined.
uint8_t logBase2(uint32_t uInput)
inline uint8_t logBase2(uint32_t uInput)
{
//Release mode validation
if (uInput == 0)
@ -48,17 +60,8 @@ namespace PolyVox
return static_cast<uint8_t>(uResult - 1);
}
bool isPowerOf2(uint32_t uInput)
{
if(uInput == 0)
return false;
else
return ((uInput & (uInput-1)) == 0);
}
// http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
uint32_t upperPowerOfTwo(uint32_t v)
inline uint32_t upperPowerOfTwo(uint32_t v)
{
v--;
v |= v >> 1;
@ -69,4 +72,22 @@ namespace PolyVox
v++;
return v;
}
inline int32_t roundTowardsNegInf(float r)
{
return (r >= 0.0) ? static_cast<int32_t>(r) : static_cast<int32_t>(r - 1.0f);
}
inline int32_t roundToNearestInteger(float r)
{
return (r >= 0.0) ? static_cast<int32_t>(r + 0.5f) : static_cast<int32_t>(r - 0.5f);
}
template <typename Type>
inline Type clamp(const Type& value, const Type& low, const Type& high)
{
return (std::min)(high, (std::max)(low, value));
}
}
#endif

View File

@ -24,7 +24,7 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_IteratorController_H__
#define __PolyVox_IteratorController_H__
#include "PolyVoxCore/Region.h"
#include "PolyVox/Region.h"
namespace PolyVox
{
@ -41,6 +41,6 @@ namespace PolyVox
};
}
#include "PolyVoxCore/IteratorController.inl"
#include "PolyVox/IteratorController.inl"
#endif //__PolyVox_IteratorController_H__

View File

@ -24,9 +24,9 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_LowPassFilter_H__
#define __PolyVox_LowPassFilter_H__
#include "PolyVoxCore/IteratorController.h"
#include "PolyVoxCore/RawVolume.h" //Is this desirable?
#include "PolyVoxCore/Region.h"
#include "PolyVox/IteratorController.h"
#include "PolyVox/RawVolume.h" //Is this desirable?
#include "PolyVox/Region.h"
namespace PolyVox
{
@ -54,7 +54,7 @@ namespace PolyVox
}//namespace PolyVox
#include "PolyVoxCore/LowPassFilter.inl"
#include "PolyVox/LowPassFilter.inl"
#endif //__PolyVox_LowPassFilter_H__

View File

@ -27,11 +27,11 @@ freely, subject to the following restrictions:
#include "Impl/MarchingCubesTables.h"
#include "Impl/TypeDef.h"
#include "PolyVoxCore/Array.h"
#include "PolyVoxCore/BaseVolume.h" //For wrap modes... should move these?
#include "PolyVoxCore/Mesh.h"
#include "PolyVoxCore/DefaultMarchingCubesController.h"
#include "PolyVoxCore/Vertex.h"
#include "PolyVox/Array.h"
#include "PolyVox/BaseVolume.h" //For wrap modes... should move these?
#include "PolyVox/Mesh.h"
#include "PolyVox/DefaultMarchingCubesController.h"
#include "PolyVox/Vertex.h"
namespace PolyVox
{
@ -353,6 +353,6 @@ namespace PolyVox
}
}
#include "PolyVoxCore/MarchingCubesSurfaceExtractor.inl"
#include "PolyVox/MarchingCubesSurfaceExtractor.inl"
#endif

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Impl/Timer.h"
#include "PolyVox/Impl/Timer.h"
namespace PolyVox
{

View File

@ -26,7 +26,7 @@ freely, subject to the following restrictions:
#include "Impl/TypeDef.h"
#include "PolyVoxCore/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type
#include "PolyVox/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type
namespace PolyVox
{

View File

@ -24,8 +24,8 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_MaterialDensityPair_H__
#define __PolyVox_MaterialDensityPair_H__
#include "PolyVoxCore/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type
#include "PolyVoxCore/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here
#include "PolyVox/DefaultIsQuadNeeded.h" //we'll specialise this function for this voxel type
#include "PolyVox/DefaultMarchingCubesController.h" //We'll specialise the controller contained in here
#include "Impl/TypeDef.h"

View File

@ -26,9 +26,9 @@ freely, subject to the following restrictions:
#include "Impl/TypeDef.h"
#include "PolyVoxCore/PolyVoxForwardDeclarations.h"
#include "PolyVoxCore/Region.h"
#include "PolyVoxCore/Vertex.h" //Should probably do away with this on in the future...
#include "PolyVox/PolyVoxForwardDeclarations.h"
#include "PolyVox/Region.h"
#include "PolyVox/Vertex.h" //Should probably do away with this on in the future...
#include <algorithm>
#include <cstdlib>
@ -98,6 +98,6 @@ namespace PolyVox
}
}
#include "PolyVoxCore/Mesh.inl"
#include "PolyVox/Mesh.inl"
#endif /* __Mesh_H__ */

View File

@ -24,9 +24,9 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_PagedVolume_H__
#define __PolyVox_PagedVolume_H__
#include "PolyVoxCore/BaseVolume.h"
#include "PolyVoxCore/Region.h"
#include "PolyVoxCore/Vector.h"
#include "PolyVox/BaseVolume.h"
#include "PolyVox/Region.h"
#include "PolyVox/Vector.h"
#include <limits>
#include <cstdlib> //For abort()
@ -359,8 +359,8 @@ namespace PolyVox
};
}
#include "PolyVoxCore/PagedVolume.inl"
#include "PolyVoxCore/PagedVolumeChunk.inl"
#include "PolyVoxCore/PagedVolumeSampler.inl"
#include "PolyVox/PagedVolume.inl"
#include "PolyVox/PagedVolumeChunk.inl"
#include "PolyVox/PagedVolumeSampler.inl"
#endif //__PolyVox_PagedVolume_H__

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Impl/ErrorHandling.h"
#include "PolyVox/Impl/ErrorHandling.h"
#include <algorithm>
#include <limits>
@ -52,7 +52,7 @@ namespace PolyVox
{
// If the user is creating a vast (almost infinite) volume then we can bet they will be
// expecting a high memory usage and will want a fair number of chunks to play around with.
if (regValid == Region::MaxRegion)
if (regValid == Region::MaxRegion())
{
m_uChunkCountLimit = 1024;
}

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Impl/Utility.h"
#include "PolyVox/Impl/Utility.h"
namespace PolyVox
{

View File

@ -24,7 +24,7 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_Picking_H__
#define __PolyVox_Picking_H__
#include "PolyVoxCore/Vector.h"
#include "PolyVox/Vector.h"
namespace PolyVox
{
@ -44,6 +44,6 @@ namespace PolyVox
PickResult pickVoxel(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, const typename VolumeType::VoxelType& emptyVoxelExample);
}
#include "PolyVoxCore/Picking.inl"
#include "PolyVox/Picking.inl"
#endif //__PolyVox_Picking_H__

View File

@ -21,7 +21,7 @@ freely, subject to the following restrictions:
distribution.
*******************************************************************************/
#include "PolyVoxCore/Raycast.h"
#include "PolyVox/Raycast.h"
namespace PolyVox
{

View File

@ -24,9 +24,9 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_RawVolume_H__
#define __PolyVox_RawVolume_H__
#include "PolyVoxCore/BaseVolume.h"
#include "PolyVoxCore/Region.h"
#include "PolyVoxCore/Vector.h"
#include "PolyVox/BaseVolume.h"
#include "PolyVox/Region.h"
#include "PolyVox/Vector.h"
#include <cstdlib> //For abort()
#include <limits>
@ -167,7 +167,7 @@ namespace PolyVox
};
}
#include "PolyVoxCore/RawVolume.inl"
#include "PolyVoxCore/RawVolumeSampler.inl"
#include "PolyVox/RawVolume.inl"
#include "PolyVox/RawVolumeSampler.inl"
#endif //__PolyVox_RawVolume_H__

View File

@ -24,7 +24,7 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_Raycast_H__
#define __PolyVox_Raycast_H__
#include "PolyVoxCore/Vector.h"
#include "PolyVox/Vector.h"
namespace PolyVox
{
@ -98,6 +98,6 @@ namespace PolyVox
RaycastResult raycastWithDirection(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, Callback& callback);
}
#include "PolyVoxCore/Raycast.inl"
#include "PolyVox/Raycast.inl"
#endif //__PolyVox_Raycast_H__

Some files were not shown because too many files have changed in this diff Show More