Applying ker's patch unmodified.

This commit is contained in:
David Williams
2011-03-10 20:31:11 +00:00
parent d7cea1b72e
commit 8e6b1a3b7e
14 changed files with 300 additions and 378 deletions

View File

@ -27,17 +27,19 @@ freely, subject to the following restrictions:
using namespace PolyVox;
const uint16_t g_uVolumeSideLength = 128;
void createSphereInVolume(Volume<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);
Vector3DFloat v3dVolCenter( g_uVolumeSideLength / 2, g_uVolumeSideLength / 2, g_uVolumeSideLength / 2);
//This three-level for loop iterates over every voxel in the volume
for (int z = 0; z < volData.getWidth(); z++)
for (int z = 0; z < g_uVolumeSideLength ; z++)
{
for (int y = 0; y < volData.getHeight(); y++)
for (int y = 0; y < g_uVolumeSideLength; y++)
{
for (int x = 0; x < volData.getDepth(); x++)
for (int x = 0; x < g_uVolumeSideLength; x++)
{
//Store our current position as a vector...
Vector3DFloat v3dCurrentPos(x,y,z);