mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-07 01:23:52 +00:00
feat(editor): visualize patrol path of selected NPC as ribbon with waypoints
Adds setPatrolPath() that draws a multi-segment orange ribbon between the NPC's spawn position and each waypoint, plus diamond markers at each point (green for start = NPC home, white for waypoints). Renders only while the NPC is selected and has a patrol path defined.
This commit is contained in:
parent
191ff9ec16
commit
eb8f5a09b1
3 changed files with 109 additions and 0 deletions
|
|
@ -133,6 +133,18 @@ void EditorApp::run() {
|
|||
gizmo.setMode(TransformMode::None);
|
||||
}
|
||||
|
||||
// Patrol path visualization for the selected NPC
|
||||
if (auto* selNpc = npcSpawner_.getSelected();
|
||||
selNpc && !selNpc->patrolPath.empty()) {
|
||||
std::vector<glm::vec3> pts;
|
||||
pts.reserve(selNpc->patrolPath.size() + 1);
|
||||
pts.push_back(selNpc->position);
|
||||
for (const auto& wp : selNpc->patrolPath) pts.push_back(wp.position);
|
||||
viewport_.setPatrolPath(pts);
|
||||
} else {
|
||||
viewport_.clearPatrolPath();
|
||||
}
|
||||
|
||||
uint32_t imageIndex = 0;
|
||||
VkCommandBuffer cmd = vkCtx->beginFrame(imageIndex);
|
||||
if (cmd == VK_NULL_HANDLE) continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue