#include "circle.h"
#include "hyperbox.h"
#include "hypersphere.h"
+#include "ray.h"
#include "rectangle.h"
#include "shape.h"
#include "transformedshape.h"
using std::abs;
for(unsigned i=0; i<D; ++i)
- if(abs(point[i])>dimensions[i]/2)
+ if(abs(point[i])>dimensions[i]/T(2))
return false;
return true;
}
T radius;
public:
- HyperSphere();
+ HyperSphere(): radius(1) { }
explicit HyperSphere(T);
virtual HyperSphere *clone() const;
virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const;
};
-template<typename T, unsigned D>
-inline HyperSphere<T, D>::HyperSphere():
- radius(1)
-{ }
-
template<typename T, unsigned D>
inline HyperSphere<T, D>::HyperSphere(T r):
radius(r)
{ }
template<typename T, unsigned D>
-inline TransformedShape<T, D>::TransformedShape(const TransformedShape &other):
+inline TransformedShape<T, D>::TransformedShape(const TransformedShape<T, D> &other):
shape(other.shape->clone()),
transformation(other.transformation),
inverse_trans(other.inverse_trans)