Merge branch 'master' of git@gitorious.org:polyvox/polyvox.git
This commit is contained in:
commit
06cc2806dd
@ -102,7 +102,7 @@ int main(int argc, char *argv[])
|
|||||||
createCubeInVolume(volData, Vector3DInt32(midPos-10, midPos-10 ,1), Vector3DInt32(midPos+10, midPos+10, maxPos-1), MaterialDensityPair44::getMaxDensity());
|
createCubeInVolume(volData, Vector3DInt32(midPos-10, midPos-10 ,1), Vector3DInt32(midPos+10, midPos+10, maxPos-1), MaterialDensityPair44::getMaxDensity());
|
||||||
|
|
||||||
//Smooth part of the volume
|
//Smooth part of the volume
|
||||||
RawVolume<MaterialDensityPair44> tempVolume(Region(0,0,0,128, 128, 128));
|
RawVolume<MaterialDensityPair44> tempVolume(PolyVox::Region(0,0,0,128, 128, 128));
|
||||||
LowPassFilter<LargeVolume, RawVolume, MaterialDensityPair44> pass1(&volData, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), &tempVolume, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), 3);
|
LowPassFilter<LargeVolume, RawVolume, MaterialDensityPair44> pass1(&volData, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), &tempVolume, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), 3);
|
||||||
pass1.executeSAT();
|
pass1.executeSAT();
|
||||||
LowPassFilter<RawVolume, LargeVolume, MaterialDensityPair44> pass2(&tempVolume, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), &volData, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), 3);
|
LowPassFilter<RawVolume, LargeVolume, MaterialDensityPair44> pass2(&tempVolume, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), &volData, PolyVox::Region(Vector3DInt32(62, 62, 62), Vector3DInt32(126, 126, 126)), 3);
|
||||||
|
@ -26,6 +26,8 @@ freely, subject to the following restrictions:
|
|||||||
|
|
||||||
#include "PolyVoxImpl/TypeDef.h"
|
#include "PolyVoxImpl/TypeDef.h"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
namespace PolyVox
|
namespace PolyVox
|
||||||
{
|
{
|
||||||
///This class represents a voxel storing only a density.
|
///This class represents a voxel storing only a density.
|
||||||
@ -61,7 +63,7 @@ namespace PolyVox
|
|||||||
Type getMaterial() const throw() { return 1; }
|
Type getMaterial() const throw() { return 1; }
|
||||||
|
|
||||||
void setDensity(Type uDensity) { m_uDensity = uDensity; }
|
void setDensity(Type uDensity) { m_uDensity = uDensity; }
|
||||||
void setMaterial(Type uMaterial) { assert("Cannot set material on voxel of type 'Density'"); }
|
void setMaterial(Type uMaterial) { assert(false); } //Cannot set material on voxel of type Density
|
||||||
|
|
||||||
static Type getMaxDensity() throw() { return (0x01 << (sizeof(Type) * 8)) - 1; }
|
static Type getMaxDensity() throw() { return (0x01 << (sizeof(Type) * 8)) - 1; }
|
||||||
static Type getMinDensity() throw() { return 0; }
|
static Type getMinDensity() throw() { return 0; }
|
||||||
|
@ -62,7 +62,7 @@ namespace PolyVox
|
|||||||
//int32_t iDstMaxY = m_regDst.getUpperCorner().getY();
|
//int32_t iDstMaxY = m_regDst.getUpperCorner().getY();
|
||||||
//int32_t iDstMaxZ = m_regDst.getUpperCorner().getZ();
|
//int32_t iDstMaxZ = m_regDst.getUpperCorner().getZ();
|
||||||
|
|
||||||
SrcVolumeType<VoxelType>::Sampler srcSampler(m_pVolSrc);
|
typename SrcVolumeType<VoxelType>::Sampler srcSampler(m_pVolSrc);
|
||||||
|
|
||||||
for(int32_t iSrcZ = iSrcMinZ, iDstZ = iDstMinZ; iSrcZ <= iSrcMaxZ; iSrcZ++, iDstZ++)
|
for(int32_t iSrcZ = iSrcMinZ, iDstZ = iDstMinZ; iSrcZ <= iSrcMaxZ; iSrcZ++, iDstZ++)
|
||||||
{
|
{
|
||||||
@ -144,9 +144,9 @@ namespace PolyVox
|
|||||||
satIterCont.m_Iter = &satVolumeIter;
|
satIterCont.m_Iter = &satVolumeIter;
|
||||||
satIterCont.reset();
|
satIterCont.reset();
|
||||||
|
|
||||||
SrcVolumeType<VoxelType>::Sampler srcVolumeIter(m_pVolSrc);
|
typename SrcVolumeType<VoxelType>::Sampler srcVolumeIter(m_pVolSrc);
|
||||||
|
|
||||||
IteratorController<SrcVolumeType<VoxelType>::Sampler> srcIterCont;
|
IteratorController<typename SrcVolumeType<VoxelType>::Sampler> srcIterCont;
|
||||||
srcIterCont.m_regValid = Region(satLowerCorner, satUpperCorner);
|
srcIterCont.m_regValid = Region(satLowerCorner, satUpperCorner);
|
||||||
srcIterCont.m_Iter = &srcVolumeIter;
|
srcIterCont.m_Iter = &srcVolumeIter;
|
||||||
srcIterCont.reset();
|
srcIterCont.reset();
|
||||||
|
@ -75,7 +75,7 @@ namespace PolyVox
|
|||||||
|
|
||||||
Type getMaterial() const throw() { return m_uMaterial; }
|
Type getMaterial() const throw() { return m_uMaterial; }
|
||||||
|
|
||||||
void setDensity(Type /*uDensity*/) { assert("Cannot set density on voxel of type 'Material'"); }
|
void setDensity(Type /*uDensity*/) { assert(false); } //Cannot set density on voxel of type Material
|
||||||
void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; }
|
void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; }
|
||||||
|
|
||||||
static Type getMaxDensity() throw() { return 2; }
|
static Type getMaxDensity() throw() { return 2; }
|
||||||
|
@ -76,7 +76,7 @@ namespace PolyVox
|
|||||||
{
|
{
|
||||||
if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)))
|
if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)))
|
||||||
{
|
{
|
||||||
const Vector3DInt32& v3dLowerCorner = m_regValidRegion.getLowerCorner();
|
const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner();
|
||||||
int32_t iLocalXPos = uXPos - v3dLowerCorner.getX();
|
int32_t iLocalXPos = uXPos - v3dLowerCorner.getX();
|
||||||
int32_t iLocalYPos = uYPos - v3dLowerCorner.getY();
|
int32_t iLocalYPos = uYPos - v3dLowerCorner.getY();
|
||||||
int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ();
|
int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ();
|
||||||
@ -125,7 +125,7 @@ namespace PolyVox
|
|||||||
{
|
{
|
||||||
if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)))
|
if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)))
|
||||||
{
|
{
|
||||||
const Vector3DInt32& v3dLowerCorner = m_regValidRegion.getLowerCorner();
|
const Vector3DInt32& v3dLowerCorner = this->m_regValidRegion.getLowerCorner();
|
||||||
int32_t iLocalXPos = uXPos - v3dLowerCorner.getX();
|
int32_t iLocalXPos = uXPos - v3dLowerCorner.getX();
|
||||||
int32_t iLocalYPos = uYPos - v3dLowerCorner.getY();
|
int32_t iLocalYPos = uYPos - v3dLowerCorner.getY();
|
||||||
int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ();
|
int32_t iLocalZPos = uZPos - v3dLowerCorner.getZ();
|
||||||
|
@ -93,9 +93,9 @@ namespace PolyVox
|
|||||||
|
|
||||||
mCurrentVoxel = this->mVolume->m_pData + uVoxelIndex;
|
mCurrentVoxel = this->mVolume->m_pData + uVoxelIndex;
|
||||||
|
|
||||||
m_bIsCurrentPositionValidInX = mVolume->getEnclosingRegion().containsPointInX(xPos);
|
m_bIsCurrentPositionValidInX = this->mVolume->getEnclosingRegion().containsPointInX(xPos);
|
||||||
m_bIsCurrentPositionValidInY = mVolume->getEnclosingRegion().containsPointInY(yPos);
|
m_bIsCurrentPositionValidInY = this->mVolume->getEnclosingRegion().containsPointInY(yPos);
|
||||||
m_bIsCurrentPositionValidInZ = mVolume->getEnclosingRegion().containsPointInZ(zPos);
|
m_bIsCurrentPositionValidInZ = this->mVolume->getEnclosingRegion().containsPointInZ(zPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename VoxelType>
|
template <typename VoxelType>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user