Renamed Volume to LargeVolume.
This commit is contained in:
@ -26,14 +26,14 @@ freely, subject to the following restrictions:
|
||||
#include "MaterialDensityPair.h"
|
||||
#include "CubicSurfaceExtractorWithNormals.h"
|
||||
#include "SurfaceMesh.h"
|
||||
#include "Volume.h"
|
||||
#include "LargeVolume.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
//Use the PolyVox namespace
|
||||
using namespace PolyVox;
|
||||
|
||||
void createSphereInVolume(Volume<MaterialDensityPair44>& volData, float fRadius)
|
||||
void createSphereInVolume(LargeVolume<MaterialDensityPair44>& volData, float fRadius)
|
||||
{
|
||||
//This vector hold the position of the center of the volume
|
||||
Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2);
|
||||
@ -78,7 +78,7 @@ int main(int argc, char *argv[])
|
||||
openGLWidget.show();
|
||||
|
||||
//Create an empty volume and then place a sphere in it
|
||||
Volume<MaterialDensityPair44> volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63)));
|
||||
LargeVolume<MaterialDensityPair44> volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(63, 63, 63)));
|
||||
createSphereInVolume(volData, 30);
|
||||
|
||||
//Extract the surface
|
||||
|
@ -48,7 +48,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent)
|
||||
timer->start(0);
|
||||
}
|
||||
|
||||
void OpenGLWidget::setVolume(PolyVox::Volume<MaterialDensityPair44>* volData)
|
||||
void OpenGLWidget::setVolume(PolyVox::LargeVolume<MaterialDensityPair44>* volData)
|
||||
{
|
||||
//First we free anything from the previous volume (if there was one).
|
||||
m_mapOpenGLSurfaceMeshes.clear();
|
||||
|
@ -29,7 +29,7 @@ freely, subject to the following restrictions:
|
||||
#include <QGLWidget>
|
||||
#include <QTimer>
|
||||
|
||||
#include "Volume.h"
|
||||
#include "LargeVolume.h"
|
||||
#include "SurfaceMesh.h"
|
||||
#include "PolyVoxImpl/Utility.h"
|
||||
|
||||
@ -45,7 +45,7 @@ class OpenGLWidget : public QGLWidget
|
||||
public:
|
||||
OpenGLWidget(QWidget *parent);
|
||||
|
||||
void setVolume(PolyVox::Volume<PolyVox::MaterialDensityPair44>* volData);
|
||||
void setVolume(PolyVox::LargeVolume<PolyVox::MaterialDensityPair44>* volData);
|
||||
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
@ -69,7 +69,7 @@ class OpenGLWidget : public QGLWidget
|
||||
bool m_bUseOpenGLVertexBufferObjects;
|
||||
|
||||
//Creates a volume 128x128x128
|
||||
PolyVox::Volume<PolyVox::MaterialDensityPair44>* m_volData;
|
||||
PolyVox::LargeVolume<PolyVox::MaterialDensityPair44>* m_volData;
|
||||
|
||||
//Rather than storing one big mesh, the volume is broken into regions and a mesh is stored for each region
|
||||
std::map<PolyVox::Vector3DUint8, OpenGLSurfaceMesh> m_mapOpenGLSurfaceMeshes;
|
||||
|
@ -27,7 +27,7 @@ freely, subject to the following restrictions:
|
||||
|
||||
using namespace PolyVox;
|
||||
|
||||
void createSphereInVolume(Volume<MaterialDensityPair44>& volData, float fRadius, uint8_t uValue)
|
||||
void createSphereInVolume(LargeVolume<MaterialDensityPair44>& volData, float fRadius, uint8_t uValue)
|
||||
{
|
||||
//This vector hold the position of the center of the volume
|
||||
Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2);
|
||||
@ -55,7 +55,7 @@ void createSphereInVolume(Volume<MaterialDensityPair44>& volData, float fRadius,
|
||||
}
|
||||
}
|
||||
|
||||
void createCubeInVolume(Volume<MaterialDensityPair44>& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue)
|
||||
void createCubeInVolume(LargeVolume<MaterialDensityPair44>& volData, Vector3DInt32 lowerCorner, Vector3DInt32 upperCorner, uint8_t uValue)
|
||||
{
|
||||
//This three-level for loop iterates over every voxel between the specified corners
|
||||
for (int z = lowerCorner.getZ(); z <= upperCorner.getZ(); z++)
|
||||
|
@ -25,9 +25,9 @@ freely, subject to the following restrictions:
|
||||
#define __OpenGLExample_Shapes_H__
|
||||
|
||||
#include "PolyVoxForwardDeclarations.h"
|
||||
#include "Volume.h"
|
||||
#include "LargeVolume.h"
|
||||
|
||||
void createSphereInVolume(PolyVox::Volume<PolyVox::MaterialDensityPair44>& volData, float fRadius, uint8_t uValue);
|
||||
void createCubeInVolume(PolyVox::Volume<PolyVox::MaterialDensityPair44>& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue);
|
||||
void createSphereInVolume(PolyVox::LargeVolume<PolyVox::MaterialDensityPair44>& volData, float fRadius, uint8_t uValue);
|
||||
void createCubeInVolume(PolyVox::LargeVolume<PolyVox::MaterialDensityPair44>& volData, PolyVox::Vector3DInt32 lowerCorner, PolyVox::Vector3DInt32 upperCorner, uint8_t uValue);
|
||||
|
||||
#endif //__OpenGLExample_Shapes_H__
|
@ -24,7 +24,7 @@ freely, subject to the following restrictions:
|
||||
#include "Filters.h"
|
||||
#include "Log.h"
|
||||
#include "MaterialDensityPair.h"
|
||||
#include "Volume.h"
|
||||
#include "LargeVolume.h"
|
||||
#include "SurfaceMesh.h"
|
||||
#include "PolyVoxImpl/Utility.h"
|
||||
|
||||
@ -72,7 +72,7 @@ void exampleLog(string message, int severity)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
logHandler = &exampleLog;
|
||||
Volume<MaterialDensityPair44> volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(g_uVolumeSideLength-1, g_uVolumeSideLength-1, g_uVolumeSideLength-1)));
|
||||
LargeVolume<MaterialDensityPair44> volData(PolyVox::Region(Vector3DInt32(0,0,0), Vector3DInt32(g_uVolumeSideLength-1, g_uVolumeSideLength-1, g_uVolumeSideLength-1)));
|
||||
|
||||
//Make our volume contain a sphere in the center.
|
||||
int32_t minPos = 0;
|
||||
|
@ -28,7 +28,7 @@ freely, subject to the following restrictions:
|
||||
#include "CubicSurfaceExtractorWithNormals.h"
|
||||
#include "SurfaceExtractor.h"
|
||||
#include "SurfaceMesh.h"
|
||||
#include "Volume.h"
|
||||
#include "LargeVolume.h"
|
||||
#include "Filters.h"
|
||||
|
||||
#include <QApplication>
|
||||
@ -36,7 +36,7 @@ freely, subject to the following restrictions:
|
||||
//Use the PolyVox namespace
|
||||
using namespace PolyVox;
|
||||
|
||||
void createPerlinVolumeSlow(Volume<MaterialDensityPair44>& volData)
|
||||
void createPerlinVolumeSlow(LargeVolume<MaterialDensityPair44>& volData)
|
||||
{
|
||||
Perlin perlin(2,8,1,234);
|
||||
|
||||
@ -75,7 +75,7 @@ void createPerlinVolumeSlow(Volume<MaterialDensityPair44>& volData)
|
||||
}
|
||||
}
|
||||
|
||||
/*void createPerlinVolumeFast(Volume<MaterialDensityPair44>& volData)
|
||||
/*void createPerlinVolumeFast(LargeVolume<MaterialDensityPair44>& volData)
|
||||
{
|
||||
Perlin perlin(2,8,1,234);
|
||||
|
||||
@ -123,7 +123,7 @@ void createPerlinVolumeSlow(Volume<MaterialDensityPair44>& volData)
|
||||
}
|
||||
}*/
|
||||
|
||||
void createPerlinTerrain(Volume<MaterialDensityPair44>& volData)
|
||||
void createPerlinTerrain(LargeVolume<MaterialDensityPair44>& volData)
|
||||
{
|
||||
Perlin perlin(2,2,1,234);
|
||||
|
||||
@ -159,7 +159,7 @@ void createPerlinTerrain(Volume<MaterialDensityPair44>& volData)
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
void createSphereInVolume(Volume<MaterialDensityPair44>& volData, Vector3DFloat v3dVolCenter, float fRadius)
|
||||
void createSphereInVolume(LargeVolume<MaterialDensityPair44>& volData, Vector3DFloat v3dVolCenter, float fRadius)
|
||||
{
|
||||
//This vector hold the position of the center of the volume
|
||||
//Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2);
|
||||
@ -253,8 +253,8 @@ int main(int argc, char *argv[])
|
||||
//If these lines don't compile, please try commenting them out and using the two lines after
|
||||
//(you will need Boost for this). If you have to do this then please let us know in the forums as
|
||||
//we rely on community feedback to keep the Boost version running.
|
||||
Volume<MaterialDensityPair44> volData(&load, &unload, 256);
|
||||
//Volume<MaterialDensityPair44> volData(polyvox_bind(&load, polyvox_placeholder_1, polyvox_placeholder_2),
|
||||
LargeVolume<MaterialDensityPair44> volData(&load, &unload, 256);
|
||||
//LargeVolume<MaterialDensityPair44> volData(polyvox_bind(&load, polyvox_placeholder_1, polyvox_placeholder_2),
|
||||
// polyvox_bind(&unload, polyvox_placeholder_1, polyvox_placeholder_2), 256);
|
||||
volData.setMaxNumberOfBlocksInMemory(4096);
|
||||
volData.setMaxNumberOfUncompressedBlocks(64);
|
||||
|
Reference in New Issue
Block a user