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

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.
This commit is contained in:
jerrrrycho
2026-11-08 06:05:37 +01:00
parent 68fdf1efdf
commit 5d6f734b04
4 changed files with 192 additions and 57 deletions

View File

@@ -157,6 +157,9 @@ public:
float fMaxDist; // do jakiej odległości wykonywana jest animacja NOTE: square of actual distance
float fSpeed; // parametr szybkości animacji
int iNumber; // numer kolejny obiektu
// door wings only: the submodel of the same name in the low poly interior, if it has one, posed along with
// smAnimated, so the inside of the door can be part of the interior and lit with it
TSubModel *smInterior { nullptr };
TUpdate yUpdate; // metoda TDynamicObject aktualizująca animację
/*
@@ -694,6 +697,8 @@ private:
float Load, std::string LoadType, bool Reversed, std::string);
int init_sections( TModel3d const *Model, std::string const &Nameprefix, bool const Overrideselfillum );
bool init_destination( TModel3d *Model );
// pairs the animated door wings with their namesakes in the low poly interior
void init_interior_doors();
void create_controller( std::string const Type, bool const Trainset );
void AttachNext(TDynamicObject *Object, int iType = 1);
bool UpdateForce(double dt);