18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 02:42:46 +01:00
Commit Graph

120 Commits

Author SHA1 Message Date
maj00r db75e47615 Merge branch 'feat/eu07m-gref' into feat/eu07m-model-inspector 2026-11-30 22:27:03 +01:00
maj00r c446a1640d Merge branch 'feat/eu07m-clip-event' into feat/eu07m-gref
Brings the .ng3d extension and modelformat ng3d (8637101d9). Where both sides changed a line, this branch's text is kept with the names changed; what this branch adds is renamed with it: the model files .ng3d, the family store .ng3p.
2026-11-30 22:27:02 +01:00
maj00r ff55024be9 Merge branch 'feat/eu07m-skin-compute' into feat/eu07m-clip-event 2026-11-30 22:26:38 +01:00
maj00r 7cad10c39a Merge branch 'feat/eu07m-clips' into feat/eu07m-skin-compute 2026-11-30 22:26:38 +01:00
maj00r bf66a704b1 Merge branch 'feat/eu07m-skinning' into feat/eu07m-clips 2026-11-30 22:26:37 +01:00
maj00r 3be62b067e Merge branch 'feat/eu07m-instancing' into feat/eu07m-skinning 2026-11-30 22:26:36 +01:00
maj00r 3c7824199c Merge branch 'feat/e4d-compact' into feat/eu07m-instancing 2026-11-30 22:26:36 +01:00
maj00r 8637101d96 feat(model): the EU07M model files take the .ng3d extension, the switch is modelformat ng3d
In place of .r3a (2fe1064f9): the model files are .ng3d and eu07.ini selects them with modelformat ng3d. The format keeps its name (EU07M), its magic and the -eu07m command line tool. Neither name has been released.
2026-11-30 22:26:29 +01:00
maj00r d918d5f2f6 feat(model): .r3a and .r3p in what this branch adds, as below it
The model files are .r3a and the family store .r3p, selected with modelformat r3a (2fe1064f9 on feat/e4d-compact, merged up through feat/eu07m-gref).
2026-11-30 22:12:58 +01:00
maj00r c6fbd7801f Merge branch 'feat/eu07m-gref' into feat/eu07m-model-inspector 2026-11-30 22:12:57 +01:00
maj00r a669be8f8f Merge branch 'feat/eu07m-clip-event' into feat/eu07m-gref
Brings the .r3a extension and modelformat r3a (2fe1064f9). docs/eu07m-format.md keeps this branch's English text, with the names changed. What this branch adds is renamed with it: the model files .r3a, the family store .r3p (geometry.r3p).
2026-11-30 22:12:49 +01:00
maj00r 20f6b2f52f Merge branch 'feat/eu07m-skin-compute' into feat/eu07m-clip-event 2026-11-30 22:12:13 +01:00
maj00r 981640d6e0 Merge branch 'feat/eu07m-clips' into feat/eu07m-skin-compute 2026-11-30 22:12:12 +01:00
maj00r 13d40487f8 Merge branch 'feat/eu07m-skinning' into feat/eu07m-clips 2026-11-30 22:12:11 +01:00
maj00r 79c90368a3 Merge branch 'feat/e4d-compact' into feat/eu07m-instancing 2026-11-30 22:12:09 +01:00
maj00r d12d54a83c Merge branch 'feat/eu07m-instancing' into feat/eu07m-skinning 2026-11-30 22:12:09 +01:00
maj00r 2fe1064f9a feat(model): the EU07M model files take the .r3a extension, the switch is modelformat r3a
The model files of the format are named .r3a in place of .eu07m, and eu07.ini selects them with modelformat r3a in place of
modelformat eu07m. The format keeps its name (EU07M), its magic and the -eu07m command line tool. Neither the extension nor
the key has been released, so nothing reads the old ones.
2026-11-30 22:11:57 +01:00
maj00r 1cab605911 Merge branch 'feat/eu07m-gref' into feat/eu07m-model-inspector
The base split vehicle/DynObj.cpp into vehicle/dynamic/*: the holds of the editor on the parts and the pantographs move with
it. The table and the functions of the holds go to the end of vehicle/dynamic/visual.cpp, the held lamps and hooks are applied
in ABuLittleUpdate there, and a held pantograph is moved at the start of updatePantographMotion (vehicle/dynamic/update.cpp),
which skips the pressure-driven motion as the old loop did with continue. DynObj.h keeps both sides: the LightList of the
VehicleEnd rename and the holds.

The two reads of MoverParameters this branch added go through TDynamicObject, as the base's AGENTS.md asks outside physics/
and vehicle/: GetLength() for the fly-to distance, and a new query OccupiedCab() for the side of the cab entered.
2026-11-30 21:27:25 +01:00
maj00r 7ab6080096 docs(eu07m): the store as the game reads it now, the id of a block hashed again only with verify_hash, the store opened again when its file changes; the id to settle before packing 2026-11-30 05:24:20 +01:00
maj00r 5bfdd756de Merge feat/eu07m-channels into feat/eu07m-gref 2026-11-30 00:33:53 +01:00
maj00r 96198fa7a4 Merge feat/eu07m-clip-event into feat/eu07m-channels 2026-11-30 00:33:51 +01:00
maj00r e80cfc4f14 Merge feat/eu07m-skin-compute into feat/eu07m-clip-event 2026-11-30 00:33:50 +01:00
maj00r 91d334a484 Merge feat/eu07m-clips into feat/eu07m-skin-compute 2026-11-30 00:33:48 +01:00
maj00r f640657549 Merge feat/eu07m-skinning into feat/eu07m-clips 2026-11-30 00:33:46 +01:00
maj00r af3815eee3 feat(editor): a part of an EU07M model taken out with what it draws
"Remove this part" (Del) in the Models mode takes out any part without parts under it which nothing else
in the model points at (an animation, a light slot, a skin): with its components, its transform and its own
mesh. eu07m::remove_node now takes such a node with its geometry: its primitives go, and their vertices and
indices leave the streams where no other primitive shares them. The primitives after them move back, and
so do the meshes, the vertex groups and the references to the geometry store. A part whose mesh another
node draws too, or whose mesh has vertex groups, stays. Ctrl+Z puts the part back and picks it again.

So the flat glowing patch under a lamp post of E3D (placek) is taken out and a real light source put in the
lamp instead. Unit tests take out a part with geometry, check the streams and the primitive moved into its
place, write and read the model back, and keep a part whose mesh is shared.
2026-11-30 00:33:41 +01:00
maj00r 14dc873b05 Merge feat/eu07m-instancing into feat/eu07m-skinning
# Conflicts:
#	model/Model3d.h
#	rendering/common/scenewalk.cpp
#	rendering/common/scenewalk.h
#	rendering/opengl46/opengl46renderer.cpp
2026-11-30 00:33:39 +01:00
maj00r 470d4510ed Merge feat/e4d-compact into feat/eu07m-instancing
# Conflicts:
#	rendering/common/scenewalk.cpp
2026-11-30 00:33:16 +01:00
maj00r a4dd61cd2c Merge feat/e4d-load into feat/e4d-compact 2026-11-30 00:33:02 +01:00
maj00r 161a7762c9 Merge feat/model-format-e4d into feat/e4d-load 2026-11-30 00:33:00 +01:00
maj00r fc74ff0860 Merge origin/staging into feat/model-format-e4d 2026-11-30 00:32:49 +01:00
maj00r b3916500ce docs(eu07m): an animation event takes a node over from the clips and channels for good, and a sheared node loses its shear under a clip 2026-11-30 00:32:39 +01:00
maj00r 287424a3e1 fix(model): a light source added in the editor lights its surroundings
The renderer lights a light point of a model only past its threshold of self-illumination, which E3D keeps
in the material of the submodel. A LGHT node without an LMAT (made in the editor, or exported anew) had the
threshold -1, never lit, so a light added to a lamp post and saved lit nothing. Such a light now shines
whenever its node is shown, as one of a .t3d with "selfillum: true"; the lamp slot of its parent still
switches it. The converter gives every light of E3D an LMAT with the threshold it had, so the converted
models don't change. TModel3d::AddEditorLight gives the light it adds the same threshold.

Self-test: modelsave and modelbrightness, and modelplace takes the parameters of the node after the skin
(lights 3). Tested on a lamp post imported from E3D: a light added in the editor, saved, and after a new
run the lamp lights the vehicle beside it, both from the scenery file and when it is put in later.
2026-11-29 23:58:43 +01:00
maj00r 42e0884606 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.
2026-11-29 23:00:52 +01:00
maj00r 6828e52a45 feat(editor): the EU07M models as a field of work of their own, made for those who don't know the format
The window of an EU07M model becomes the field of work "Models" (F7) beside the surroundings, the tracks,
the roads, the terrain and the catenary. The node bank says what is edited and lists the vehicles, the tool
options hold the page of the tool chosen in the toolbar (Lights, Parts of the vehicle, All parts,
Animations), and the inspector the settings of the part picked, in plain words; the fields of the format
are kept under Advanced.

- A click on the model picks its part (the smallest box of geometry of a part shown holding the point);
  a light is added where the model is clicked, a spot shining towards the camera.
- A light which nothing else points at is taken out (eu07m::node_removable / remove_node, with
  TModel3d::UnlinkEditorSubmodel / LinkEditorSubmodel on the model the game has).
- Ctrl+Z / Ctrl+Y take the changes of the model back and make them again, a light added or taken out
  among them; another model asked for with changes not saved asks first.
- "Import to EU07M" writes <model>.eu07m beside the .e3d or .t3d of a model without one, made of the
  model as the game loaded it (eu07m::import_model), so a lamp post or a cab gets its lights here.
- "Put a model in the scenery" puts a model of the folder of the models in front of the camera, "Whole
  model" moves the scenery model with the gizmo of the editor, "Put a vehicle on a track..." opens the
  Trainset tool.
- The inspector of a scenery model with an .eu07m file offers "Edit this model (F7)"; the floating window
  is gone.
- Review: the model is written to its .tmp, closed and checked before it replaces the file, and a failed
  .tmp is removed; play_clip counts From only for a positive pace again, so a pace of 0 holds the clip
  and a negative one runs it backwards.

New icons at the end of editor_icons.png (the cells before them are unchanged), the strings in
lang/editor_pl.po, new self-test commands (modelmode, modeltool, modeladdlight, modelundo, modelredo,
modelremove, modelplace, modelimport) and unit tests of remove_node. No asset in the SVN is needed or
changed; the import writes an .eu07m file into the game data only when the user asks for it.
2026-11-29 22:17:14 +01:00
maj00r ecfb99db1a Merge branch 'feat/eu07m-gref' of https://github.com/MaSzyna-EU07/maszyna into feat/eu07m-model-inspector
# Conflicts:
#	model/AnimModel.h
2026-11-29 21:34:23 +01:00
Hirek 5d5e271edb Create vehicle-architecture.md 2026-11-29 18:32:22 +01:00
maj00r b03fff75df Merge the review fixes of the PRs below from feat/eu07m-channels into feat/eu07m-gref 2026-11-29 18:23:01 +01:00
maj00r 6efc1eb718 Merge the review fixes of the PRs below from feat/eu07m-clip-event into feat/eu07m-channels
RaPrepare() applies the clips, then the channels, then the animation events, so an event on a node takes over from both.
The spec has the fixes of #538, #540 and #542 in English.
2026-11-29 18:23:01 +01:00
maj00r 6402e2191b Merge the review fixes of the PRs below from feat/eu07m-skin-compute into feat/eu07m-clip-event
# Conflicts:
#	model/AnimModel.cpp
2026-11-29 18:22:25 +01:00
maj00r 49ef69bb34 Merge the review fixes of the PRs below from feat/eu07m-clips into feat/eu07m-skin-compute 2026-11-29 18:22:14 +01:00
maj00r c171e2e7d5 Merge the review fixes of the PRs below from feat/eu07m-skinning into feat/eu07m-clips 2026-11-29 18:22:13 +01:00
maj00r 05a8ddaabd Merge the review fixes of the PRs below from feat/eu07m-instancing into feat/eu07m-skinning 2026-11-29 18:22:12 +01:00
maj00r ce40e11b94 fix(model): EU07M review of #543: channel names keep their case, the joint moves from its rest value
- The channel event reads the name of the channel as written (getTokens lowercased it), and set_channel() finds it
  regardless of case: a channel named doorLeft couldn't be set from a scenery.
- JOIN.rest is read: the node is modelled at the rest value of its joint, which moves it by the value less rest (the
  limits stay values of the joint). A part modelled half open no longer jumps when its channel is set. Files without it
  (rest 0) move as before.
- The spec says so, and that no vehicle sets channels yet.

Test: a slider modelled half out.
2026-11-29 18:20:09 +01:00
maj00r 7b6bdf22bb fix(events): EU07M review of #542: clip names keep their case and match regardless of it, an event without a pace told
- The clip event reads the name of the clip as written (getTokens lowercased it), and play_clip() finds the clip
  regardless of case, as the submodels are found by their names: a clip named Open or Armature|Wave couldn't be started
  from a scenery.
- An event without a pace (clip <name> endevent) plays the clip at its own pace with a line in the log, and leaves the
  keyword it met to the event: before, endevent was read as a pace of 0 (stopping the clips) and the next token was
  swallowed.
- Pace 0 with several instances of one model is held by #540's fix (the clips stopped stay set per instance).
- The spec says so.
2026-11-29 18:19:19 +01:00
maj00r 474c9ab5ae fix(model): EU07M review of #540: stopped clips held per instance, events over clips, the rest of a matrix node from its matrix
- stop_clips() holds each clip at the moment it was stopped instead of dropping it: the pose lives in the submodels the
  instances of a model share, so an instance whose clips were cleared snapped back to rest as soon as another instance of
  the model played one (two doors of one model).
- RaPrepare() applies the clips before the animation events of the scenery, so an event moving a node (rotate,
  translate...) takes it over from a clip, one ended or stopped included; before, a finished clip overrode the events
  on its nodes on every draw.
- A node with a matrix (XFRM) has its TRS fields only as an approximation: the parts the tracks of a clip don't move are
  taken from the decomposed matrix, so the node no longer jumps or skews when a clip starts moving another part of it.
- The spec says so.
2026-11-29 18:17:49 +01:00
maj00r 99bc0b125c fix(render): EU07M review of #538: an instance with light colours of its own drawn alone, the light records locked only when stale
- An instance with lightcolors of its own isn't instanced: the colours go onto the shared submodels as the instance is
  prepared, which the instances of a bucket don't each get, so they all showed the colours of one of them.
- The walk takes the exclusive lock for the light records of a bucket only when they are stale in this frame
  (Refresh_Light_Records() checks again under it): the later passes of the frame no longer stop the other walkers.
- instance_cull.comp (both renderers) puts the word of the light parts into [0][3] after the product with the view, so a
  view with a translation can't stretch the first column of a lit instance.
- The spec: ls_Dark / ls_Home switch without the fade too, and the instances with light colours of their own.
2026-11-29 18:14:35 +01:00
maj00r 107cc3c927 feat(editor): the EU07M window edits in 3D, holds vehicle parts and adds lights
The window of an EU07M model gets tabs: the tree of the nodes beside
the properties of the node picked, the parts of the vehicle, the clips
and channels, and the components of the model. The texts are Polish in
lang/editor_pl.po.

- With nothing selected, it shows the model of the vehicle driven (its
  body or its cab).
- In the 3D view the node picked is framed and shows its axes and a
  gizmo to move or turn it. The light sources are marked in their colour,
  a spot with its axis, and a click on a mark picks its node. A press on
  the gizmo or a mark doesn't pick a scenery node, and the editor's own
  gizmo gives way. A double click in the tree flies the camera there.
- The settings of a node: its position, rotation (degrees) and scale,
  and the distances it is drawn from and up to.
- "Add a light source here" puts in a node light_<n> with a point or
  spot LGHT as the last child of the node. eu07m::insert_node moves
  every reference to the nodes after it, and eu07m::add_component
  appends a component; both have unit tests.
- Changes show at once on the model the game has, through new TModel3d
  methods for the editor (ApplyEU07MLight, AddEditorLight,
  SetEditorTransform, SetEditorRange). The spot's cones are edited as
  half angles in degrees.
- Parts of the vehicle: the editor holds the lamps, coupler hooks and
  hoses in their _off/_on/_xon state, and the pantographs up or down,
  whatever the vehicle does. A held pantograph moves at its own pace,
  in the editor too, up to the wire above it. Only the look changes:
  the electrics of the vehicle don't.
- Neither the empty-scenery line nor the no-tracks hint shows in a
  scenery of models alone.
- New editor self-test command: modelnode <name>.
2026-11-29 18:11:38 +01:00
maj00r 8b75db6b70 Merge the review fixes of #535 and #536 from feat/eu07m-channels into feat/eu07m-gref 2026-11-29 17:55:01 +01:00
maj00r c6ece72d6a Merge the review fixes of #535 and #536 from feat/eu07m-clip-event into feat/eu07m-channels 2026-11-29 17:54:59 +01:00
maj00r bf8bb0caa0 Merge the review fixes of #535 and #536 from feat/eu07m-skin-compute into feat/eu07m-clip-event 2026-11-29 17:54:53 +01:00