GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
IntersectObject.hh
Go to the documentation of this file.
1//
2// Copyright (C) 2009 Tero Pulkkinen
3// Released under LGPL License.
4//
5// This file is part of Polygon.
6//
7// Polygon is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// Polygon is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU Library General Public License
18// along with Polygon. If not, see <http://www.gnu.org/licenses/>.
19//
20
21
22#include "Effect.hh"
23
24//
25// Intersecion objects
26//
27
28class IntersectionObject : public Function<Point, float>
29{
30public:
31};
32
34{
35public:
36 SphereIntersection(Point center, float radius) : center(center), radius(radius) { }
37 float Index(Point p) const
38 {
39 Vector v = p-center;
40 v /= radius;
41 return v.Dist()-1.0;
42 }
43private:
44 Point center;
45 float radius;
46};
Definition EffectI.hh:11
Definition IntersectObject.hh:29
float Index(Point p) const
Definition IntersectObject.hh:37
SphereIntersection(Point center, float radius)
Definition IntersectObject.hh:36
Definition VectorTools.hh:125
float Dist() const
Definition VectorTools.cc:141
border radius
Definition gameapi_example.php:45
Definition Parser.cc:60