Commit 25cfdc08 authored by Philip Trettner's avatar Philip Trettner
Browse files

small fixes

parent 9567cc62
......@@ -417,7 +417,7 @@ template <class ScalarT>
// line - line
template <class ScalarT>
[[nodiscard]] constexpr hits<1, ScalarT> intersection_parameter(line<2, ScalarT> const& l0, line<2, ScalarT> const& l1)
[[nodiscard]] constexpr ScalarT intersection_parameter(line<2, ScalarT> const& l0, line<2, ScalarT> const& l1)
{
// l0.pos + l0.dir * t.x == l1.pos + l1.dir * t.y <=> (l0.dir | -l1.dir) * (t.x | t.y)^T == l1.pos - l0.pos
auto M = mat<2, 2, ScalarT>::from_cols(l0.dir, -l1.dir);
......
......@@ -31,10 +31,10 @@ template <int D, class ScalarT>
template <class ScalarT, class TraitsT>
[[nodiscard]] constexpr array<pos<2, ScalarT>, 4> vertices_of(aabb<2, ScalarT, TraitsT> const& bb)
{
auto p00 = pos<3, ScalarT>(bb.min.x, bb.min.y);
auto p10 = pos<3, ScalarT>(bb.max.x, bb.min.y);
auto p11 = pos<3, ScalarT>(bb.max.x, bb.max.y);
auto p01 = pos<3, ScalarT>(bb.min.x, bb.max.y);
auto p00 = pos<2, ScalarT>(bb.min.x, bb.min.y);
auto p10 = pos<2, ScalarT>(bb.max.x, bb.min.y);
auto p11 = pos<2, ScalarT>(bb.max.x, bb.max.y);
auto p01 = pos<2, ScalarT>(bb.min.x, bb.max.y);
return {{p00, p10, p11, p01}}; // in ccw order
}
......
Supports Markdown
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