Commit b26a52a4 authored by Julian Schakib's avatar Julian Schakib

fix intersection test for box

parent 71aeccbb
......@@ -1255,14 +1255,12 @@ template <class ScalarT>
auto const v = b.half_extents[1];
auto const w = b.half_extents[2];
auto const n_proj = normalize(tg::vec3(dot(p.normal, u), dot(p.normal, v), dot(p.normal, w)));
auto const dist = distance(p,;
auto const dist = distance(, p);
// half length of projected diagonals
auto pu = abs(dot(u, n_proj));
auto pv = abs(dot(v, n_proj));
auto pw = abs(dot(w, n_proj));
auto pu = abs(dot(u, p.normal));
auto pv = abs(dot(v, p.normal));
auto pw = abs(dot(w, p.normal));
return dist < pu + pv + pw;
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