mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 17:13:51 +00:00
feat(editor): NPC context menu adds Snap to Ground and Face Camera
Right-click context menu on a selected NPC now mirrors the object menu: Snap to Ground drops it to terrain elevation, Face Camera rotates the NPC to face the current camera position. Also annotates Duplicate with the Ctrl+D shortcut hint.
This commit is contained in:
parent
ec50c41044
commit
b49cb344ac
1 changed files with 10 additions and 1 deletions
|
|
@ -2300,12 +2300,21 @@ void EditorUI::renderContextMenu(EditorApp& app) {
|
|||
if (npcSel) {
|
||||
if (ImGui::MenuItem("Fly To"))
|
||||
app.flyToSelected();
|
||||
if (ImGui::MenuItem("Duplicate")) {
|
||||
if (ImGui::MenuItem("Snap to Ground"))
|
||||
app.snapSelectedToGround();
|
||||
if (ImGui::MenuItem("Duplicate", "Ctrl+D")) {
|
||||
CreatureSpawn copy = *npcSel;
|
||||
copy.position += glm::vec3(10, 10, 0);
|
||||
app.getNpcSpawner().placeCreature(copy);
|
||||
app.markObjectsDirty();
|
||||
}
|
||||
if (ImGui::MenuItem("Face Camera")) {
|
||||
glm::vec3 cam = app.getEditorCamera().getCamera().getPosition();
|
||||
glm::vec3 to = cam - npcSel->position;
|
||||
npcSel->orientation = glm::degrees(std::atan2(to.y, to.x));
|
||||
if (npcSel->orientation < 0.0f) npcSel->orientation += 360.0f;
|
||||
app.markObjectsDirty();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue