SurfacePoint<T, D-1> *base_points = 0;
if(points)
- /* Shamelessly reuse the provided storage. Align to the end of the array
- so processing can start from the first (nearest) point. */
+ /* Shamelessly reuse the provided storage. Align to the end of the
+ array so processing can start from the first (nearest) point. */
base_points = reinterpret_cast<SurfacePoint<T, D-1> *>(points+size)-size;
unsigned count = base->get_intersections(base_ray, base_points, size);
namespace Geometry {
/**
-An infinite shape consisting of the space on one side of a plane. Mostly
-useful when composited with other shapes.
+An unbounded shape consisting of the space on one side of a plane. Mostly
+useful when intersected with other shapes.
*/
template<typename T, unsigned D>
class HalfSpace: public Shape<T, D>
namespace Msp {
namespace Geometry {
-/**
-Forms a shape from the common parts of component shapes.
-*/
template<typename T, unsigned D>
struct IntersectionOps
{
static bool combine_surface(bool a, bool b) { return a && b; }
};
+/**
+Forms a shape from the common parts of component shapes.
+*/
template<typename T, unsigned D>
class Intersection: public CompositeShape<T, D, IntersectionOps<T, D> >
{
namespace Msp {
namespace Geometry {
+/**
+A directed line segment. Can be used to point at things.
+*/
template<typename T, unsigned D>
class Ray
{
namespace Msp {
namespace Geometry {
-/**
-Joins component shapes together into one.
-*/
template<typename T, unsigned D>
struct UnionOps
{
static bool combine_surface(bool a, bool b) { return a && !b; }
};
+/**
+Joins component shapes together into one.
+*/
template<typename T, unsigned D>
class Union: public CompositeShape<T, D, UnionOps<T, D> >
{