diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-09 01:57:27 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-09 01:57:27 +0000 |
commit | d771fbda2c171cfbc36cc0eb3122c1a02ffbb081 (patch) | |
tree | 69d2879e41da2b79264b6c3b8500b5d18383ae85 /game/network | |
parent | WIP typedefing all the things - sources (diff) | |
download | ilt-d771fbda2c171cfbc36cc0eb3122c1a02ffbb081.tar.bz2 ilt-d771fbda2c171cfbc36cc0eb3122c1a02ffbb081.tar.xz ilt-d771fbda2c171cfbc36cc0eb3122c1a02ffbb081.zip |
WIP typedefing just about everything else
Diffstat (limited to 'game/network')
-rw-r--r-- | game/network/network.h | 2 | ||||
-rw-r--r-- | game/network/rail.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/game/network/network.h b/game/network/network.h index 02f8c30..8af06a9 100644 --- a/game/network/network.h +++ b/game/network/network.h @@ -16,7 +16,7 @@ class Texture; class SceneShader; class Ray; -template<size_t... n> using GenDef = std::tuple<glm::vec<n, float>...>; +template<size_t... n> using GenDef = std::tuple<glm::vec<n, Distance>...>; using GenCurveDef = GenDef<3, 3, 2>; class Network { diff --git a/game/network/rail.cpp b/game/network/rail.cpp index f46504b..cc61db9 100644 --- a/game/network/rail.cpp +++ b/game/network/rail.cpp @@ -133,7 +133,7 @@ RailLinkStraight::RailLinkStraight(Node::Ptr a, Node::Ptr b, const Position3D & for (auto ei : {1U, 0U}) { const auto trans {glm::translate(ends[ei].node->pos) * e}; for (const auto & rcs : railCrossSection) { - const Position3D m {(trans * glm::vec4 {rcs.first, 1})}; + const Position3D m {(trans * (rcs.first ^ 1))}; vertices.emplace_back(m, Position2D {rcs.second, len * static_cast<float>(ei)}, up); } } @@ -166,7 +166,7 @@ RailLinkCurve::RailLinkCurve(const Node::Ptr & a, const Node::Ptr & b, Position3 const auto t { trans * glm::rotate(half_pi - swing.x, up) * glm::translate(Position3D {radius, 0.F, swing.y})}; for (const auto & rcs : railCrossSection) { - const Position3D m {(t * glm::vec4 {rcs.first, 1})}; + const Position3D m {(t * (rcs.first ^ 1))}; vertices.emplace_back(m, Position2D {rcs.second, swing.z}, up); } } |