feat(editor): facing arrow on NPC markers + Ctrl+Wheel hint in object panel

NPC markers now show a yellow ground-triangle pointing in the orientation
direction so users can see facing without selecting. Object panel gained
the Ctrl+Wheel rotation hint to match the NPC panel.
This commit is contained in:
Kelsi 2026-05-06 01:08:32 -07:00
parent b736c6b2e1
commit 35ad340ccc
2 changed files with 12 additions and 0 deletions

View file

@ -552,6 +552,17 @@ void EditorViewport::updateNpcMarkers(const std::vector<CreatureSpawn>& npcs) {
v.pos[0]=x+ts; v.pos[1]=y; v.pos[2]=tz; verts.push_back(v);
v.pos[0]=x-ts; v.pos[1]=y; v.pos[2]=tz; verts.push_back(v);
v.pos[0]=x; v.pos[1]=y-ts; v.pos[2]=tz; verts.push_back(v);
// Facing arrow on the ground: triangle pointing in the orientation direction.
// Helps users see which way each NPC faces without selecting it.
float yaw = glm::radians(npc.orientation);
float fx = std::cos(yaw), fy = std::sin(yaw);
float perpX = -fy, perpY = fx;
float arrowLen = s * 2.5f, arrowHalfW = s * 0.8f;
v.color[0]=1.0f; v.color[1]=0.9f; v.color[2]=0.2f; v.color[3]=0.85f;
v.pos[0]=x + fx*arrowLen; v.pos[1]=y + fy*arrowLen; v.pos[2]=z+0.25f; verts.push_back(v);
v.pos[0]=x + perpX*arrowHalfW; v.pos[1]=y + perpY*arrowHalfW; v.pos[2]=z+0.25f; verts.push_back(v);
v.pos[0]=x - perpX*arrowHalfW; v.pos[1]=y - perpY*arrowHalfW; v.pos[2]=z+0.25f; verts.push_back(v);
}
npcMarkerVertCount_ = static_cast<uint32_t>(verts.size());
VkBufferCreateInfo bi{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO};