Add box::corner - N-d lerp inside a box
This commit is contained in:
parent
a7f067bedb
commit
c7b44a6925
1 changed files with 12 additions and 0 deletions
|
|
@ -65,6 +65,18 @@ namespace psemek::geom
|
|||
return p;
|
||||
}
|
||||
|
||||
template <typename ... Ts>
|
||||
point_type corner(Ts const & ... ts) const
|
||||
{
|
||||
static_assert(sizeof...(Ts) == N);
|
||||
|
||||
T w[N] = {ts...};
|
||||
point_type res;
|
||||
for (std::size_t i = 0; i < N; ++i)
|
||||
res[i] = lerp(axes[i], w[i]);
|
||||
return res;
|
||||
}
|
||||
|
||||
box & operator += (vector_type const & delta);
|
||||
box & operator -= (vector_type const & delta);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue