summaryrefslogtreecommitdiff
path: root/game/network/rail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/network/rail.cpp')
-rw-r--r--game/network/rail.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/game/network/rail.cpp b/game/network/rail.cpp
index 69422aa..dc62cf3 100644
--- a/game/network/rail.cpp
+++ b/game/network/rail.cpp
@@ -1,4 +1,6 @@
#include "rail.h"
+#include "game/gamestate.h"
+#include "game/geoData.h"
#include "network.h"
#include <game/network/network.impl.h> // IWYU pragma: keep
#include <gfx/gl/sceneShader.h>
@@ -8,7 +10,7 @@
template class NetworkOf<RailLink, RailLinkStraight, RailLinkCurve>;
constexpr auto RAIL_CROSSSECTION_VERTICES {5U};
-constexpr Size3D RAIL_HEIGHT {0, 0, 250.F};
+constexpr Size3D RAIL_HEIGHT {0, 0, 50.F};
RailLinks::RailLinks() : NetworkOf<RailLink, RailLinkStraight, RailLinkCurve> {"rails.jpg"} { }
@@ -74,11 +76,11 @@ RailLinks::addLinksBetween(GlobalPosition3D start, GlobalPosition3D end)
}
constexpr const std::array<RelativePosition3D, RAIL_CROSSSECTION_VERTICES> railCrossSection {{
- {-1900.F, 0.F, 0.F},
+ {-1900.F, 0.F, -RAIL_HEIGHT.z * 2},
{-608.F, 0.F, RAIL_HEIGHT.z},
- {0, 0.F, RAIL_HEIGHT.z * .7F},
+ {0, 0.F, RAIL_HEIGHT.z / 2},
{608.F, 0.F, RAIL_HEIGHT.z},
- {1900.F, 0.F, 0.F},
+ {1900.F, 0.F, -RAIL_HEIGHT.z * 2},
}};
constexpr const std::array<float, RAIL_CROSSSECTION_VERTICES> railTexturePos {
0.F,
@@ -169,3 +171,15 @@ RailLinks::render(const SceneShader & shader) const
glBindVertexArray(0);
}
}
+
+const Surface *
+RailLinks::getBaseSurface() const
+{
+ return std::dynamic_pointer_cast<Surface>(gameState->assets.at("terrain.surface.gravel")).get();
+}
+
+RelativeDistance
+RailLinks::getBaseWidth() const
+{
+ return 5'700;
+}