17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-09 00:17:39 +01:00

Draw the cab probe with all the lights of the cab

This commit is contained in:
2026-10-29 20:05:03 +01:00
parent 8bd41f431d
commit 96100f1155
14 changed files with 143 additions and 89 deletions

View File

@@ -350,6 +350,7 @@ void gfx::local_lights::gather_cab_lights(gfx::geometrybank_manager const &Geome
cab_light cablight;
cablight.source = m_lights[idx];
cablight.local = glm::vec3{m_lights[idx].position};
cablight.local_direction = m_lights[idx].direction;
cablight.source.position = vehicle->GetWorldPosition(m_lights[idx].position);
auto const direction{glm::vec3{rotation * glm::dvec3{m_lights[idx].direction}}};
cablight.source.direction = (glm::length2(direction) > 0.f ? glm::normalize(direction) : glm::vec3{0.f, -1.f, 0.f});