I've created a custom 'VoxelType' class called Block that I use to instantiate and create the volume with as per below:
Code:
PolyVox::Volume<Block> *volData;
volData = new PolyVox::Volume<Block>(144, 144, 1);
I get and set the block data like so:
Code:
Block block = volData->getVoxelAt(
(currentCell.X - firstCell.X) * 16 + lx,
(currentCell.Y - firstCell.Y) * 16 + ly,
(currentCell.Z - firstCell.Y) * 16);
block.x = gx;
block.y = gy;
block.z = currentCell.Z;
block.blockClass = tileTypeTable[tiletypes[lx][ly]].c;
block.blockMaterial = tileTypeTable[tiletypes[lx][ly]].m;
volData->setVoxelAt(
(currentCell.X - firstCell.X) * 16 + lx,
(currentCell.Y - firstCell.Y) * 16 + ly,
(currentCell.Z - firstCell.Y) * 16, block);
But unfortunately I get the following compile fatal error:
Code:
1>e:\programming\libraries\polyvox\library\polyvoxcore\include\Volume.inl(243): error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'Block' (or there is no acceptable conversion)
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error(425): could be 'bool std::operator !=(const std::error_code &,const std::error_condition &)'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\system_error(432): or 'bool std::operator !=(const std::error_condition &,const std::error_code &)'
1> e:\programming\libraries\leadwerks engine sdk\cpp\mathlib.h(82): or 'const bool LE::operator !=(const LE::TVec2 &,const LE::TVec2 &)'
1> e:\programming\libraries\leadwerks engine sdk\cpp\mathlib.h(83): or 'const bool LE::operator !=(const LE::TVec2 &,const LE::flt)'
1> e:\programming\libraries\leadwerks engine sdk\cpp\mathlib.h(84): or 'const bool LE::operator !=(const LE::TVec3 &,const LE::TVec3 &)'
1> e:\programming\libraries\leadwerks engine sdk\cpp\mathlib.h(85): or 'const bool LE::operator !=(const LE::TVec3 &,const LE::flt)'
1> e:\programming\libraries\leadwerks engine sdk\cpp\mathlib.h(86): or 'const bool LE::operator !=(const LE::TVec4 &,const LE::TVec4 &)'
1> e:\programming\libraries\leadwerks engine sdk\cpp\mathlib.h(87): or 'const bool LE::operator !=(const LE::TVec4 &,const LE::flt)'
1> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\guiddef.h(197): or 'int operator !=(const GUID &,const GUID &)'
1> while trying to match the argument list '(Block, Block)'
1> e:\programming\libraries\polyvox\library\polyvoxcore\include\Volume.inl(220) : while compiling class template member function 'bool PolyVox::Volume<VoxelType>::setVoxelAt(uint16_t,uint16_t,uint16_t,VoxelType)'
1> with
1> [
1> VoxelType=Block
1> ]
1> DFWorld.cpp(104) : see reference to class template instantiation 'PolyVox::Volume<VoxelType>' being compiled
1> with
1> [
1> VoxelType=Block
1> ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any ideas? Is PolyVox Volume incompatible with some custom VoxelTypes?