corrected collision of tree
This commit is contained in:
1 parent
cebbb8bb5d
commit
8b0a18a6cf
5 files changed
+1204
-88
No files matched your search
+3
-16
@@ -197,22 +197,9 @@ namespace ZL
|
||||
|
||||
void Location::setupNavigation(const std::string& navigationJsonPath)
|
||||
{
|
||||
std::vector<PathFinder::ObstacleMesh> obstacles;
|
||||
obstacles.reserve(gameObjects.size() + interactiveObjects.size());
|
||||
|
||||
for (const auto& item : gameObjects) {
|
||||
const LoadedGameObject& gameObj = item.second;
|
||||
obstacles.push_back({ &gameObj.mesh.data, Eigen::Vector3f::Zero() });
|
||||
}
|
||||
|
||||
for (const InteractiveObject& intObj : interactiveObjects) {
|
||||
if (!intObj.isActive) {
|
||||
continue;
|
||||
}
|
||||
obstacles.push_back({ &intObj.mesh.data, intObj.position });
|
||||
}
|
||||
|
||||
navigation.build(obstacles, navigationJsonPath, CONST_ZIP_FILE);
|
||||
// Static navigation blockers are defined in the navigation JSON as polygons.
|
||||
// NPC + player are handled as dynamic obstacles, so they are intentionally NOT in JSON.
|
||||
navigation.build({}, navigationJsonPath, CONST_ZIP_FILE);
|
||||
|
||||
#ifdef SHOW_PATH
|
||||
buildDebugNavMeshes();
|
||||
|
||||
Reference in new issue
Block a user