18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-28 02:25:37 +01:00
Commit Graph

3 Commits

Author SHA1 Message Date
jerrrrycho
aa2200418a fix(doors): an animdoor entry without its } leaves the rest of the .mmd to be read
read_spec() took every token up to the end of the file into the block when the closing brace was
missing, so endmodels, sounds:, the lights and the rest were lost. The block now ends at the first
token that is neither a key nor the value right after one (or at endmodels), and that token is
put back for the caller.
2026-11-17 10:06:41 +01:00
jerrrrycho
8d2d9badb5 feat: own kind of animation for a door wing in the .mmd (eu07/maszyna#70)
A vehicle can now have door wings of different kinds on one side, e.g.
111Ainw (Bdhinu) with folding doors at one end and wider ones at the other.
A new optional entry in the models section of the .mmd:

  animdoor: <wing number> { type: <Shift|Rotate|Fold|Plug> range: <m or deg> rangeout: <m> }

gives one wing (door1, door2... of animdoorprefix) its own kind of
animation and range; the keys left out keep the values of the .fiz. The
wing still follows the door of its side: it is as far along its own range
as the door is along DoorMaxShift. The entry may come before or after
animdoorprefix; a faulty one is logged and the wing keeps the .fiz kind.

Wings without an entry get the same update functions as before, so the
existing vehicles, .mmd and .fiz files are unchanged. The door state, the
physics, AI, cab controls, sounds and exports are not touched.

The parsing and the wing position live in vehicle/doorwings.h, tested in
test_door_wings.cpp.
2026-11-16 23:36:26 +01:00
jerrrrycho
5d6f734b04 feat: pose door wings of the low poly interior along with the main model (eu07/maszyna#512)
The door wings are in the main model, where the door animation finds them, so seen from inside the
vehicle they are lit like the exterior and ignore the compartment lights. A door panel put into the low
poly interior instead stayed closed, since nothing moved it.

A door wing animation now also picks up the submodel of the same name in the low poly interior, if it
has one, and gives it the same pose (shift, rotate, fold with its child wings, plug). Placed under a
compartment section, such a wing is lit with the section and follows its light switch.

The pose maths moved unchanged to vehicle/doorwings.h, with unit tests.

Assets: optional. No low poly interior in the SVN or in the Steam install has a submodel named like a
door wing, so nothing changes for existing vehicles. To use it, a low poly interior gets the inside of
each door wing as a submodel named like the wing in the main model (door1, door01, drzwi1, ...), with
the same pivot and transform, under the compartment section it belongs to, with a SelfIllum threshold
like the section's, and slightly inside the wing of the main model.
2026-11-08 06:05:37 +01:00