18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 11:47:06 +01:00

feat(editor): the cab of a vehicle edited in the Models mode, from the seat of the driver

The cab of a vehicle is loaded only by getting in. "Get in the cab" in the Models mode does what the
simulation does then: it makes the train of the vehicle (TTrain::Init loads the cab, its controls and its
sounds), makes it the vehicle driven, and puts the camera in the seat of the driver. While the cab is edited
the editor draws it as from that seat: FreeFlyModeFlag is off and the vehicle owns the camera, which moves
with it by its offset (the sounds read the owner of the camera then). With the body picked, or in another
field of work, the view is free again.

A new self-test command, modelvehicle <name> [cab], picks a vehicle and gets in its cab. Tested on the
EU07-424 (303e-tv) with a light added to its cab.
This commit is contained in:
maj00r
2026-11-29 23:00:52 +01:00
parent 6828e52a45
commit 42e0884606
7 changed files with 173 additions and 8 deletions
+10
View File
@@ -401,6 +401,16 @@ editor_mode::selftest_result editor_mode::selftest_scene(std::string const &comm
WriteLog("SELFTEST modelplace " + file + (m_node != nullptr ? "" : ": not placed"));
return selftest_result::handled;
}
if (command == "modelvehicle")
{
// a vehicle of the name, its body or its cab ("cab")
std::string name;
std::string part;
words >> name >> part;
auto const picked{ui()->model_panel().pick_vehicle(name, part == "cab" ? 1 : 0)};
WriteLog("SELFTEST modelvehicle " + name + " " + part + (picked ? "" : ": no such vehicle"));
return selftest_result::handled;
}
if (command == "modelimport")
{
auto const imported{ui()->model_panel().import_model()};