Working on pathfinding, testing the Q16.16 format
This commit is contained in:
1 parent
2fe2ee6c2a
commit
8df016c0a4
13 files changed
+664
-112
No files matched your search
@@ -30,12 +30,12 @@ namespace FRG
|
||||
state->activeNavigationIndex >= static_cast<int>(state->navigationMaps.size())) return;
|
||||
const PathFinder& navigation =
|
||||
state->navigationMaps[state->activeNavigationIndex];
|
||||
const float y = navigation.getFloorY() + 0.02f;
|
||||
const float y = static_cast<float>(navigation.getFloorY()) + 0.02f;
|
||||
const Eigen::Vector3f red(1.0f, 0.0f, 0.0f);
|
||||
for (const auto& obs : navigation.getObstaclePolygons()) {
|
||||
if (obs.polygon.size() < 3) continue;
|
||||
VertexRenderStruct mesh;
|
||||
mesh.data = CreatePolygonFloor(obs.polygon, y, red);
|
||||
mesh.data = CreatePolygonFloor(toEigenVector(obs.polygon), y, red);
|
||||
mesh.RefreshVBO();
|
||||
navigationEditorNavMeshes.push_back(std::move(mesh));
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace FRG
|
||||
if (!state || state->activeNavigationIndex < 0 ||
|
||||
state->activeNavigationIndex >= static_cast<int>(state->navigationMaps.size())) return;
|
||||
const float y =
|
||||
state->navigationMaps[state->activeNavigationIndex].getFloorY() + 0.05f;
|
||||
static_cast<float>(state->navigationMaps[state->activeNavigationIndex].getFloorY()) + 0.05f;
|
||||
const float s = 0.2f;
|
||||
|
||||
for (const auto& pt : navigationEditorPoints) {
|
||||
@@ -133,7 +133,7 @@ namespace FRG
|
||||
PathFinder::ObstaclePolygon poly;
|
||||
poly.name = "editor_obstacle_" + std::to_string(++navigationEditorObstacleCounter);
|
||||
for (const auto& pt : navigationEditorPoints) {
|
||||
poly.polygon.emplace_back(pt.x(), pt.z());
|
||||
poly.polygon.emplace_back(static_cast<FRG::fp>(pt.x()), static_cast<FRG::fp>(pt.z()));
|
||||
}
|
||||
|
||||
loc.gameServer_.submit(AddNavigationObstacleCommand{
|
||||
@@ -146,10 +146,10 @@ namespace FRG
|
||||
if (!state || state->activeNavigationIndex < 0 ||
|
||||
state->activeNavigationIndex >= static_cast<int>(state->navigationMaps.size())) return;
|
||||
const float y =
|
||||
state->navigationMaps[state->activeNavigationIndex].getFloorY() + 0.02f;
|
||||
static_cast<float>(state->navigationMaps[state->activeNavigationIndex].getFloorY()) + 0.02f;
|
||||
const Eigen::Vector3f red(1.0f, 0.0f, 0.0f);
|
||||
VertexRenderStruct mesh;
|
||||
mesh.data = CreatePolygonFloor(poly.polygon, y, red);
|
||||
mesh.data = CreatePolygonFloor(toEigenVector(poly.polygon), y, red);
|
||||
mesh.RefreshVBO();
|
||||
navigationEditorNavMeshes.push_back(std::move(mesh));
|
||||
}
|
||||
@@ -379,9 +379,9 @@ namespace FRG
|
||||
|
||||
auto& target = loc.interactiveObjects[selectedInteractiveObjectIndex];
|
||||
target.state.boundsMin = Eigen::Vector3f(
|
||||
min(localA.x(), localB.x()), 0.f, min(localA.z(), localB.z()));
|
||||
std::min(localA.x(), localB.x()), 0.f, std::min(localA.z(), localB.z()));
|
||||
target.state.boundsMax = Eigen::Vector3f(
|
||||
max(localA.x(), localB.x()), 1.f, max(localA.z(), localB.z()));
|
||||
std::max(localA.x(), localB.x()), 1.f, std::max(localA.z(), localB.z()));
|
||||
|
||||
boundsClickCount = 0;
|
||||
buildInteractiveObjectBoundsMeshes();
|
||||
|
||||
Reference in new issue
Block a user