point/vector: give homog a default dimensionality

This commit is contained in:
Danny Robson 2018-03-06 18:13:46 +11:00
parent d29f2ed235
commit ba19aebe88
2 changed files with 3 additions and 2 deletions

View File

@ -39,7 +39,7 @@ namespace util {
/// expand point to use homogenous coordinates of a higher dimension.
/// ie, fill with (0,..,0,1)
template <size_t D>
template <size_t D = 4>
point<D,T>
homog (void) const
{

View File

@ -35,7 +35,8 @@ namespace util {
using coord::base<S,T,vector<S,T>>::base;
// representations
template <size_t D> vector<D,T> homog (void) const
template <size_t D = 4>
vector<D,T> homog (void) const
{
static_assert (D > S, "reducing size loses data");
return (*this).template redim<D> (0.f);