#pragma once #define TOOFAST 1.f namespace math { template inline int sgn(T t) { return t == 0 ? 0 : t > 0 ? 1 : -1; } inline float dist(sf::Vector2f p1, sf::Vector2f p2) { float dx = p1.x - p2.x; float dy = p1.y - p2.y; return std::sqrt(dx * dx + dy * dy); } inline float non_negative(float x) { return x >= 0.f ? x : 0.f; } }