Unverified Commit ba62a938 authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #2461 from peastman/voxellimit

Prevent memory from exploding when particles get too spread out
parents 5312c2fe 9930e6f6
...@@ -80,8 +80,8 @@ public: ...@@ -80,8 +80,8 @@ public:
voxelSizeZ = boxVectors[2][2]/nz; voxelSizeZ = boxVectors[2][2]/nz;
} }
else { else {
ny = max(1, (int) floorf((maxy-miny)/voxelSizeY+0.5f)); ny = max(1, min(500, (int) floorf((maxy-miny)/voxelSizeY+0.5f)));
nz = max(1, (int) floorf((maxz-minz)/voxelSizeZ+0.5f)); nz = max(1, min(500, (int) floorf((maxz-minz)/voxelSizeZ+0.5f)));
if (maxy > miny) if (maxy > miny)
voxelSizeY = (maxy-miny)/ny; voxelSizeY = (maxy-miny)/ny;
if (maxz > minz) if (maxz > minz)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment