Commit e76242f6 authored by Philip Trettner's avatar Philip Trettner
Browse files

Merge branch 'agrabowy' into 'develop'

Fixes from visual testing

See merge request !101
parents a6c6371f 3f362346
......@@ -25,7 +25,7 @@ template <int D, class ScalarT>
template <int D, class ScalarT, class TraitsT>
[[nodiscard]] constexpr aabb<D, ScalarT> aabb_of(aabb<D, ScalarT, TraitsT> const& b)
{
return b;
return aabb<D, ScalarT>(b);
}
template <int D, class ScalarT, class TraitsT>
......
......@@ -34,8 +34,8 @@ template <int D, class ScalarT>
return h.normal;
}
template <class ScalarT>
[[nodiscard]] constexpr dir<3, ScalarT> normal_of(sphere<2, ScalarT, 3> const& d)
template <class ScalarT, class TraitsT>
[[nodiscard]] constexpr dir<3, ScalarT> normal_of(sphere<2, ScalarT, 3, TraitsT> const& d)
{
return d.normal;
}
......
......@@ -701,8 +701,9 @@ template <class ScalarT, class Rng>
template <class BaseT, class Rng>
[[nodiscard]] constexpr pos<3, typename BaseT::scalar_t> uniform(Rng& rng, pyramid<BaseT> const& p)
{
using ScalarT = typename BaseT::scalar_t;
const auto n = normal_of(p.base);
const auto h = pow2(detail::uniform01<typename BaseT::scalar_t>(rng));
const auto h = ScalarT(1) - cbrt(detail::uniform01<ScalarT>(rng));
const auto pBase = uniform(rng, p.base);
return mix(pBase, centroid_of(p.base), h) + h * p.height * n;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment