add 'mayBeIncomplete' parameter

This commit is contained in:
MihailRis
2025-08-02 23:03:40 +03:00
parent caab689731
commit be3fb8346f
4 changed files with 82 additions and 42 deletions
+30 -21
View File
@@ -387,33 +387,42 @@ void WorldRenderer::renderFrame(
skybox->draw(ctx, camera, assets, worldInfo.daytime, clouds);
// In-world lines
for (const auto& [_, agent] : level.pathfinding->getAgents()) {
const auto& route = agent.route;
if (!route.found)
continue;
for (int i = 1; i < route.nodes.size(); i++) {
const auto& a = route.nodes.at(i - 1);
const auto& b = route.nodes.at(i);
if (debug) {
for (const auto& [_, agent] : level.pathfinding->getAgents()) {
const auto& route = agent.route;
if (!route.found)
continue;
for (const auto& blocked : route.visited) {
lines->pushLine(
glm::vec3(blocked) + glm::vec3(0.5f),
glm::vec3(blocked) + glm::vec3(0.5f, 1.0f, 0.5f),
glm::vec4(1, 0, 0, 1)
);
}
for (int i = 1; i < route.nodes.size(); i++) {
const auto& a = route.nodes.at(i - 1);
const auto& b = route.nodes.at(i);
if (i == 1) {
lines->pushLine(
glm::vec3(a.pos) + glm::vec3(0.5f),
glm::vec3(a.pos) + glm::vec3(0.5f, 1.0f, 0.5f),
glm::vec4(1, 1, 1, 1)
);
}
if (i == 1) {
lines->pushLine(
glm::vec3(a.pos) + glm::vec3(0.5f),
glm::vec3(a.pos) + glm::vec3(0.5f, 1.0f, 0.5f),
glm::vec3(b.pos) + glm::vec3(0.5f),
glm::vec4(1, 0, 1, 1)
);
lines->pushLine(
glm::vec3(b.pos) + glm::vec3(0.5f),
glm::vec3(b.pos) + glm::vec3(0.5f, 1.0f, 0.5f),
glm::vec4(1, 1, 1, 1)
);
}
lines->pushLine(
glm::vec3(a.pos) + glm::vec3(0.5f),
glm::vec3(b.pos) + glm::vec3(0.5f),
glm::vec4(1, 0, 1, 1)
);
lines->pushLine(
glm::vec3(b.pos) + glm::vec3(0.5f),
glm::vec3(b.pos) + glm::vec3(0.5f, 1.0f, 0.5f),
glm::vec4(1, 1, 1, 1)
);
}
}