PolyVox and Thermite3D now support the use of a density component as well as a material component for each voxel.

This commit is contained in:
David Williams
2010-06-25 21:41:13 +00:00
parent 29928b774d
commit 254fa3329e
24 changed files with 802 additions and 371 deletions

View File

@ -26,6 +26,7 @@ freely, subject to the following restrictions:
#include <QMouseEvent>
#include "GradientEstimators.h"
#include "MaterialDensityPair.h"
#include "SurfaceExtractor.h"
#include "Mesh.h"
@ -48,7 +49,7 @@ OpenGLWidget::OpenGLWidget(QWidget *parent)
timer->start(0);
}
void OpenGLWidget::setVolume(PolyVox::Volume<uint8_t>* volData)
void OpenGLWidget::setVolume(PolyVox::Volume<MaterialDensityPair44>* volData)
{
//First we free anything from the previous volume (if there was one).
m_mapOpenGLSurfaceMeshes.clear();
@ -62,7 +63,7 @@ void OpenGLWidget::setVolume(PolyVox::Volume<uint8_t>* volData)
m_uVolumeHeightInRegions = volData->getHeight() / m_uRegionSideLength;
m_uVolumeDepthInRegions = volData->getDepth() / m_uRegionSideLength;
SurfaceExtractor surfaceExtractor(*volData);
SurfaceExtractor<MaterialDensityPair44> surfaceExtractor(*volData);
//Our volume is broken down into cuboid regions, and we create one mesh for each region.
//This three-level for loop iterates over each region.