/*] Copyright (c) 2009-2010, Charles McGarvey [************************** **] All rights reserved. * * vi:ts=4 sw=4 tw=75 * * Distributable under the terms and conditions of the 2-clause BSD license; * see the file COPYING for a complete text of the license. * **************************************************************************/ #ifndef _MOOF_SHAPE_HH_ #define _MOOF_SHAPE_HH_ #include #include #include #include // Frustum // Plane (can construct from Triangle<3>) // Ray // Shape<> // +- Line<> // +- Ball<> // | Circle <- Ball<2> // | Sphere <- Ball<3> // +- Box<> // | Rectangle <- Box<2> // | Aabb <- Box<3> // +- Polygon<> // | Triangle <- Polygon<3> // +- Cylinder // +- Cone namespace Mf { template class Shape { public: virtual ~Shape() {} /** * Checks if this shape is intersected by a given ray. If so, returns * the distance from the start of the ray to the shape and information * about the intersection via the 2nd parameter. A negative value is * returned if there is no intersection. */ virtual bool intersectRay(const Ray& ray, typename Ray::Intersection& hit) { return SCALAR(-1.0); } }; } // namespace Mf #endif // _MOOF_SHAPE_HH_