const LinAl::Vector<T, D> &get_dimensions() const { return dimensions; }
T get_dimension(unsigned) const;
const LinAl::Vector<T, D> &get_dimensions() const { return dimensions; }
T get_dimension(unsigned) const;
virtual unsigned get_max_ray_intersections() const { return 2; }
virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const;
};
virtual unsigned get_max_ray_intersections() const { return 2; }
virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const;
};
template<typename T, unsigned D>
inline HyperBox<T, D>::HyperBox(const LinAl::Vector<T, D> &d):
dimensions(d)
template<typename T, unsigned D>
inline HyperBox<T, D>::HyperBox(const LinAl::Vector<T, D> &d):
dimensions(d)
template<typename T, unsigned D>
inline HyperBox<T, D> *HyperBox<T, D>::clone() const
template<typename T, unsigned D>
inline HyperBox<T, D> *HyperBox<T, D>::clone() const
- for(unsigned i=0; i<D; ++i)
- if(abs(point[i])>dimensions[i]/2)
- return false;
- return true;
+ LinAl::Vector<T, D> half_dim = dimensions/T(2);
+ return BoundingBox<T, D>(-half_dim, half_dim);