From a6e28fe377b41500d6ce3e0a9a4d6e6288d97f61 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 17 Jan 2024 01:08:54 +0000 Subject: Copy render vital link data to vertex buffer --- game/network/network.impl.h | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'game/network/network.impl.h') diff --git a/game/network/network.impl.h b/game/network/network.impl.h index f9595ed..c1f079d 100644 --- a/game/network/network.impl.h +++ b/game/network/network.impl.h @@ -2,9 +2,9 @@ #include #include -template +template void -NetworkOf::render(const SceneShader & shader) const +NetworkOf::render(const SceneShader & shader) const { if constexpr (std::is_base_of_v) { shader.absolute.use(); @@ -13,18 +13,18 @@ NetworkOf::render(const SceneShader & shader) const } } -template +template void -NetworkOf::joinLinks(const Link::Ptr & l) const +NetworkOf::joinLinks(const Link::Ptr & l) const { for (const auto & ol : links.objects) { Network::joinLinks(l, ol); } } -template +template Link::Ptr -NetworkOf::intersectRayLinks(const Ray & ray) const +NetworkOf::intersectRayLinks(const Ray & ray) const { // Click link if (const auto link = std::find_if(links.objects.begin(), links.objects.end(), @@ -37,9 +37,9 @@ NetworkOf::intersectRayLinks(const Ray & ray) const return {}; } -template +template float -NetworkOf::findNodeDirection(Node::AnyCPtr n) const +NetworkOf::findNodeDirection(Node::AnyCPtr n) const { for (const auto & l : links.objects) { for (const auto & e : l->ends) { @@ -52,16 +52,16 @@ NetworkOf::findNodeDirection(Node::AnyCPtr n) const throw std::runtime_error("Node exists but couldn't find it"); } -template +template Link::CCollection -NetworkOf::candidateStraight(GlobalPosition3D n1, GlobalPosition3D n2) +NetworkOf::candidateStraight(GlobalPosition3D n1, GlobalPosition3D n2) { return {candidateLink(n1, n2)}; } -template +template Link::CCollection -NetworkOf::candidateJoins(GlobalPosition3D start, GlobalPosition3D end) +NetworkOf::candidateJoins(GlobalPosition3D start, GlobalPosition3D end) { if (glm::length(RelativePosition3D(start - end)) < 2000.F) { return {}; @@ -73,24 +73,24 @@ NetworkOf::candidateJoins(GlobalPosition3D start, GlobalPosition3D end) return {candidateLink(c1s, c1e, c1c), candidateLink(c2s, c2e, c2c)}; } -template +template Link::CCollection -NetworkOf::candidateExtend(GlobalPosition3D start, GlobalPosition3D end) +NetworkOf::candidateExtend(GlobalPosition3D start, GlobalPosition3D end) { const auto [cstart, cend, centre] = genCurveDef(start, end, findNodeDirection(candidateNodeAt(start).first)); return {candidateLink(cstart, cend, centre)}; } -template +template Link::CCollection -NetworkOf::addStraight(GlobalPosition3D n1, GlobalPosition3D n2) +NetworkOf::addStraight(GlobalPosition3D n1, GlobalPosition3D n2) { return {addLink(n1, n2)}; } -template +template Link::CCollection -NetworkOf::addJoins(GlobalPosition3D start, GlobalPosition3D end) +NetworkOf::addJoins(GlobalPosition3D start, GlobalPosition3D end) { if (glm::length(RelativePosition3D(start - end)) < 2000.F) { return {}; @@ -101,9 +101,9 @@ NetworkOf::addJoins(GlobalPosition3D start, GlobalPosition3D end) return {addLink(c1s, c1e, c1c), addLink(c2s, c2e, c2c)}; } -template +template Link::CCollection -NetworkOf::addExtend(GlobalPosition3D start, GlobalPosition3D end) +NetworkOf::addExtend(GlobalPosition3D start, GlobalPosition3D end) { const auto [cstart, cend, centre] = genCurveDef(start, end, findNodeDirection(nodeAt(start))); return {addLink(cstart, cend, centre)}; -- cgit v1.2.3 From c7af64b7061c59c987958d0830838f1c05caeb29 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 19 Jan 2024 00:23:56 +0000 Subject: Render rail network using new shaders Non-functional, totally unimplemented at this stage --- game/network/network.impl.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'game/network/network.impl.h') diff --git a/game/network/network.impl.h b/game/network/network.impl.h index c1f079d..ff29088 100644 --- a/game/network/network.impl.h +++ b/game/network/network.impl.h @@ -2,17 +2,6 @@ #include #include -template -void -NetworkOf::render(const SceneShader & shader) const -{ - if constexpr (std::is_base_of_v) { - shader.absolute.use(); - texture->bind(); - links.apply(&Renderable::render, shader); - } -} - template void NetworkOf::joinLinks(const Link::Ptr & l) const -- cgit v1.2.3