20 #ifndef ANTKEEPER_GEOM_SDF_HPP
21 #define ANTKEEPER_GEOM_SDF_HPP
45 return std::min<float>(std::max<float>(dx, dy), 0.0f) +
math::length(
math::fvec2{std::max<float>(dx, 0.0f), std::max<float>(dy, 0.0f)});
50 return std::min<float>(
a,
b);
55 return std::max<float>(-
a,
b);
60 return std::max<float>(
a,
b);
float op_round(float d, float r)
math::fvec3 translate(const math::fvec3 &sample, const math::fvec3 &offset)
float sphere(const math::fvec3 &p, float r)
float cylinder(const math::fvec3 &p, float r, float h)
float op_difference(float a, float b)
float op_intersection(float a, float b)
float op_union(float a, float b)
T length(const quaternion< T > &q)
Calculates the length of a quaternion.
constexpr vector< T, N > abs(const vector< T, N > &x)
Returns the absolute values of each element.
T offset(T longitude)
Calculates the UTC offset at a given longitude.