17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-18 18:29:40 +02:00

feat(editor): edit tracks loaded from the scenery

This commit is contained in:
maj00r
2026-10-01 23:00:16 +02:00
parent e46fe6d06c
commit b93c5dde60
11 changed files with 1507 additions and 6 deletions

View File

@@ -709,6 +709,8 @@ void TTrack::init_segments( bool const Initial ) {
// so repeated initialization doesn't accumulate it
fTexHeight1 -= fTexHeightOffset;
fTexHeightOffset = 0.f;
// the roll flag is re-evaluated below, the transition flag is set again when the path gets connected
iTrapezoid = 0;
switch (eType) {
// Ra: łuki segmentowane co 5m albo 314-kątem foremnym
@@ -1355,10 +1357,9 @@ glm::vec3 TTrack::get_nearest_point(const glm::dvec3 &point) const
// wypełnianie tablic VBO
// discards references to current render geometry and generates it anew in specified bank
// NOTE: geometry banks can't release chunks, so the old data stays in the bank, unused
// with null bank the geometry is only discarded, to be created later along with the rest of the owning section
void TTrack::rebuild_geometry( gfx::geometrybank_handle const &Bank ) {
if( Bank == null_handle ) { return; }
Geometry1.clear();
Geometry2.clear();
if( SwitchExtension ) {
@@ -1366,6 +1367,8 @@ void TTrack::rebuild_geometry( gfx::geometrybank_handle const &Bank ) {
}
m_sleeper_local_transforms.clear();
if( Bank == null_handle ) { return; }
create_geometry( Bank );
}