Reverted some of ker's changes to bring back the concepts of width, height, and depth.

This commit is contained in:
David Williams
2011-03-11 22:14:51 +00:00
parent 624a192be4
commit 596dcf507e
10 changed files with 338 additions and 24 deletions

View File

@ -27,19 +27,17 @@ 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( g_uVolumeSideLength / 2, g_uVolumeSideLength / 2, g_uVolumeSideLength / 2);
Vector3DFloat v3dVolCenter(volData.getWidth() / 2, volData.getHeight() / 2, volData.getDepth() / 2);
//This three-level for loop iterates over every voxel in the volume
for (int z = 0; z < g_uVolumeSideLength ; z++)
for (int z = 0; z < volData.getWidth(); z++)
{
for (int y = 0; y < g_uVolumeSideLength; y++)
for (int y = 0; y < volData.getHeight(); y++)
{
for (int x = 0; x < g_uVolumeSideLength; x++)
for (int x = 0; x < volData.getDepth(); x++)
{
//Store our current position as a vector...
Vector3DFloat v3dCurrentPos(x,y,z);