// 
// Copyright (C) 2009 Tero Pulkkinen
// Released under LGPL License.
//
// This file is part of Polygon.
//
// Polygon is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Polygon is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with Polygon.  If not, see <http://www.gnu.org/licenses/>.
//


#include "Effect.hh"

//
// Intersecion objects
//

class IntersectionObject : public Function<Point, float>
{
public:
};

class SphereIntersection : public IntersectionObject
{
public:
  SphereIntersection(Point center, float radius) : center(center), radius(radius) { }
  float Index(Point p) const 
  {
    Vector v = p-center;
    v /= radius;
    return v.Dist()-1.0;
  }
private:
  Point center;
  float radius;
};
