diff --git a/library/PolyVoxCore/include/PolyVoxCore/Array.h b/library/PolyVoxCore/include/PolyVoxCore/Array.h index 4ec0f616..276a4f1e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Array.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Array.h @@ -95,7 +95,7 @@ namespace PolyVox { static_assert(noOfDims == 3, "This accessor can only be used with a three-dimensional array"); POLYVOX_ASSERT(x < m_uDimensions[0] && y < m_uDimensions[1] && z < m_uDimensions[2], "Array access is out-of-range."); - return m_pElements[z * m_uDimensions[1] * m_uDimensions[1] + y * m_uDimensions[0] + x]; + return m_pElements[z * m_uDimensions[0] * m_uDimensions[1] + y * m_uDimensions[0] + x]; } uint32_t getDimension(uint32_t dimension) diff --git a/tests/TestArray.cpp b/tests/TestArray.cpp index 359a2abf..67e0143b 100644 --- a/tests/TestArray.cpp +++ b/tests/TestArray.cpp @@ -31,9 +31,9 @@ using namespace PolyVox; void TestArray::testCArraySpeed() { - const int width = 32; + const int width = 64; const int height = 32; - const int depth = 32; + const int depth = 16; int cArray[width][height][depth]; @@ -58,9 +58,9 @@ void TestArray::testCArraySpeed() void TestArray::testPolyVoxArraySpeed() { - const int width = 32; + const int width = 64; const int height = 32; - const int depth = 32; + const int depth = 16; Array<3, int> polyvoxArray(width, height, depth);