#include "network.h" #include #include template void NetworkOf::render(const Shader & shader) const { if constexpr (std::is_base_of_v) { shader.setModel(Location {}, Shader::Program::StaticPos); texture->Bind(); links.apply(&Renderable::render, shader); } } template void NetworkOf::joinLinks(const LinkPtr & l) const { for (const auto & ol : links.objects) { Network::joinLinks(l, ol); } } template LinkPtr NetworkOf::intersectRayLinks(const Ray & ray) const { // Click link if (const auto link = std::find_if(links.objects.begin(), links.objects.end(), [&ray](const std::shared_ptr & link) { return link->intersectRay(ray); }); link != links.objects.end()) { return *link; } return {}; } template LinkPtr NetworkOf::addStraight(glm::vec3 n1, glm::vec3 n2) { return addLink(n1, n2); }