skipping chunks added.
This commit is contained in:
@@ -267,15 +267,17 @@ public:
|
|||||||
|
|
||||||
float dist = 0;
|
float dist = 0;
|
||||||
|
|
||||||
while (lv != cv && visitedVoxel.size() < 10 && dist < maxDist) {
|
while (lv != cv && visitedVoxel.size() < 10 && dist < maxDist && inGrid(cv)) {
|
||||||
|
|
||||||
Vec3i currentChunk = getChunkCoord(cv);
|
Vec3i currentChunk = getChunkCoord(cv);
|
||||||
|
|
||||||
auto it = activeChunks.find(currentChunk);
|
auto it = activeChunks.find(currentChunk);
|
||||||
bool isChunkActive = (it != activeChunks.end() && it->second);
|
bool isChunkActive = (it != activeChunks.end() && it->second);
|
||||||
|
|
||||||
|
if (get(cv).active) {
|
||||||
|
visitedVoxel.push_back(cv);
|
||||||
|
}
|
||||||
if (!isChunkActive) {
|
if (!isChunkActive) {
|
||||||
while (getChunkCoord(cv) == currentChunk && inGrid(cv)) {
|
|
||||||
Vec3f chunkStep = step * CHUNK_THRESHOLD / 2;
|
Vec3f chunkStep = step * CHUNK_THRESHOLD / 2;
|
||||||
Vec3d chunkDelta = tDelta * CHUNK_THRESHOLD / 2;
|
Vec3d chunkDelta = tDelta * CHUNK_THRESHOLD / 2;
|
||||||
if (tMax.x < tMax.y) {
|
if (tMax.x < tMax.y) {
|
||||||
@@ -299,14 +301,9 @@ public:
|
|||||||
tMax.z += chunkDelta.z;
|
tMax.z += chunkDelta.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
} else {
|
||||||
if (get(cv).active) {
|
|
||||||
visitedVoxel.push_back(cv);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tMax.x < tMax.y) {
|
if (tMax.x < tMax.y) {
|
||||||
if (tMax.x < tMax.z) {
|
if (tMax.x < tMax.z) {
|
||||||
dist += tDelta.x;
|
dist += tDelta.x;
|
||||||
@@ -329,6 +326,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -260,6 +260,10 @@ public:
|
|||||||
return Vec3<int>(static_cast<int>(std::floor(x)), static_cast<int>(std::floor(x)), static_cast<int>(std::floor(z)));
|
return Vec3<int>(static_cast<int>(std::floor(x)), static_cast<int>(std::floor(x)), static_cast<int>(std::floor(z)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vec3<uint8_t> floorToI8() const {
|
||||||
|
return Vec3<uint8_t>(static_cast<uint8_t>(std::floor(x)), static_cast<uint8_t>(std::floor(x)), static_cast<uint8_t>(std::floor(z)));
|
||||||
|
}
|
||||||
|
|
||||||
Vec3<size_t> floorToT() const {
|
Vec3<size_t> floorToT() const {
|
||||||
return Vec3<size_t>(static_cast<size_t>(std::floor(x)), static_cast<size_t>(std::floor(x)), static_cast<size_t>(std::floor(z)));
|
return Vec3<size_t>(static_cast<size_t>(std::floor(x)), static_cast<size_t>(std::floor(x)), static_cast<size_t>(std::floor(z)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user