namespace Msp {
namespace Geometry {
+/**
+A directed line segment. Can be used to point at things.
+*/
template<typename T, unsigned D>
class Ray
{
inline Ray<T, D>::Ray():
limit(0)
{
- direction[0] = 1;
+ direction[0] = T(1);
}
template<typename T, unsigned D>
direction(normalize(d)),
limit(l)
{
- if(l<0)
+ if(l<T(0))
throw std::invalid_argument("Ray::Ray");
}
template<typename T, unsigned D>
inline bool Ray<T, D>::check_limits(T x) const
{
- return x>=0 && (!limit || x<=limit);
+ return x>=T(0) && (!limit || x<=limit);
}
} // namespace Geometry