Added startup scripts
This commit is contained in:
1 parent
a479fa4ac1
commit
13ef92160d
26 files changed
+117164
-150
No files matched your search
+22
-4
@@ -19,6 +19,16 @@
|
||||
namespace ZL
|
||||
{
|
||||
|
||||
struct TriggerZone
|
||||
{
|
||||
std::string id;
|
||||
Eigen::Vector3f position = Eigen::Vector3f::Zero();
|
||||
float radius = 1.5f;
|
||||
float hysteresis = 0.3f; // exit fires at radius + hysteresis to prevent flickering
|
||||
bool enabled = true;
|
||||
bool playerInside = false; // runtime tracking state, not serialized
|
||||
};
|
||||
|
||||
struct LocationSetup
|
||||
{
|
||||
std::string roomMeshPath;
|
||||
@@ -26,9 +36,10 @@ namespace ZL
|
||||
std::string gameObjectsJsonPath;
|
||||
std::string npcsJsonPath;
|
||||
std::string dialoguesJsonPath;
|
||||
std::string navigationJsonPath;
|
||||
std::vector<std::string> navigationJsonPaths;
|
||||
std::string scriptPath;
|
||||
std::string teleportsJsonPath;
|
||||
std::string triggerZonesJsonPath;
|
||||
Eigen::Vector3f playerPosition = Eigen::Vector3f::Zero();
|
||||
};
|
||||
|
||||
@@ -52,7 +63,9 @@ namespace ZL
|
||||
float cameraAzimuth = 0.0f;
|
||||
float cameraInclination = M_PI * 30.f / 180.f;
|
||||
|
||||
PathFinder navigation;
|
||||
std::vector<PathFinder> navigationMaps;
|
||||
PathFinder* navigation = nullptr;
|
||||
int activeNavigationIndex = 0;
|
||||
|
||||
std::unique_ptr<ShadowMap> shadowMap;
|
||||
Eigen::Matrix4f cameraViewMatrix = Eigen::Matrix4f::Identity();
|
||||
@@ -73,13 +86,15 @@ namespace ZL
|
||||
TeleportZone* targetTeleportZone = nullptr;
|
||||
std::function<void(const std::string&, const Eigen::Vector3f&, float)> onTeleport;
|
||||
|
||||
std::vector<TriggerZone> triggerZones;
|
||||
|
||||
// Navigation editor — toggle with 'N', save with 'B', right-click to finalize polygon
|
||||
bool navigationEditorMode = false;
|
||||
|
||||
std::vector<Eigen::Vector3f> navigationEditorPoints;
|
||||
VertexRenderStruct navigationEditorPointsMesh;
|
||||
std::vector<VertexRenderStruct> navigationEditorNavMeshes;
|
||||
std::string navigationEditorConfigPath;
|
||||
std::vector<std::string> navigationMapPaths;
|
||||
int navigationEditorObstacleCounter = 0;
|
||||
|
||||
void navigationEditorBuildNavMeshes();
|
||||
@@ -99,7 +114,8 @@ namespace ZL
|
||||
|
||||
|
||||
void setup(const LocationSetup& params);
|
||||
void setupNavigation(const std::string& navigationJsonPath);
|
||||
void setupNavigation(const std::vector<std::string>& paths);
|
||||
bool switchNavigation(int index);
|
||||
InteractiveObject* raycastInteractiveObjects(const Eigen::Vector3f& rayOrigin, const Eigen::Vector3f& rayDir);
|
||||
Character* raycastNpcs(const Eigen::Vector3f& rayOrigin, const Eigen::Vector3f& rayDir, float maxDistance = 100.0f);
|
||||
|
||||
@@ -127,6 +143,8 @@ namespace ZL
|
||||
void resolveCharacterCollisions();
|
||||
void updateDynamicReplans(int64_t deltaMs);
|
||||
void loadTeleportZones(const std::string& jsonPath, const char* zipFile);
|
||||
void loadTriggerZones(const std::string& jsonPath, const char* zipFile);
|
||||
void updateTriggerZones(const Eigen::Vector3f& playerPos);
|
||||
|
||||
std::unordered_map<Character*, Eigen::Vector3f> lastCharacterPositions;
|
||||
std::unordered_map<Character*, int64_t> replanCooldownRemainingMs;
|
||||
|
||||
Reference in new issue
Block a user