#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "BoardManager.h"
#include "UiTypingGuard.h"
#include "Renderer.h"
#include "Shader.h"
#include "VertexBuffer.h"
#include "IndexBuffer.h"
#include "VertexArray.h"
#include "VertexBufferLayout.h"
#include "Texture.h"
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include <glm/gtc/round.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/common.hpp>
#include "Components.h"
#include <filesystem>
#include <random>
#include <atomic>
#include <cstdint>
#include "Serializer.h"
#include "NetworkManager.h"
#include "Logger.h"
#include <chrono>
#include <cstdlib>
#include <functional>
#include <string>
#include <thread>
#include <unordered_map>
Go to the source code of this file.
◆ snapToGridCenter()
| static glm::vec2 snapToGridCenter |
( |
const glm::vec2 & | worldPos, |
|
|
const Grid & | grid ) |
|
inlinestatic |
Definition at line 830 of file BoardManager.cpp.
831{
833 return worldPos;
835}
static glm::vec2 snapToSquareCenter(const glm::vec2 &worldPos, const glm::vec2 &offset, float cell)
◆ snapToSquareCenter()
| static glm::vec2 snapToSquareCenter |
( |
const glm::vec2 & | worldPos, |
|
|
const glm::vec2 & | offset, |
|
|
float | cell ) |
|
inlinestatic |
Definition at line 817 of file BoardManager.cpp.
818{
819
820 const glm::vec2 local = worldPos - offset;
821
822
823 const glm::vec2 half(cell * 0.5f);
824
825
826 const glm::vec2 snappedLocal = glm::round((local - half) / cell) * cell + half;
827 return snappedLocal + offset;
828}