point/vector: give homog a default dimensionality
This commit is contained in:
parent
d29f2ed235
commit
ba19aebe88
@ -39,7 +39,7 @@ namespace util {
|
|||||||
|
|
||||||
/// expand point to use homogenous coordinates of a higher dimension.
|
/// expand point to use homogenous coordinates of a higher dimension.
|
||||||
/// ie, fill with (0,..,0,1)
|
/// ie, fill with (0,..,0,1)
|
||||||
template <size_t D>
|
template <size_t D = 4>
|
||||||
point<D,T>
|
point<D,T>
|
||||||
homog (void) const
|
homog (void) const
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,8 @@ namespace util {
|
|||||||
using coord::base<S,T,vector<S,T>>::base;
|
using coord::base<S,T,vector<S,T>>::base;
|
||||||
|
|
||||||
// representations
|
// 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");
|
static_assert (D > S, "reducing size loses data");
|
||||||
return (*this).template redim<D> (0.f);
|
return (*this).template redim<D> (0.f);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user