]> Dogcows Code - chaz/yoink/blob - src/moof/shape.hh
remove some unused stlplus modules
[chaz/yoink] / src / moof / shape.hh
1
2 /*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
3 **] All rights reserved.
4 *
5 * Distributable under the terms and conditions of the 2-clause BSD license;
6 * see the file COPYING for a complete text of the license.
7 *
8 *****************************************************************************/
9
10 #ifndef _MOOF_SHAPE_HH_
11 #define _MOOF_SHAPE_HH_
12
13 /**
14 * \file shape.hh
15 * Declares an interface for shapes.
16 */
17
18 #include <moof/drawable.hh>
19 #include <moof/math.hh>
20 #include <moof/opengl.hh>
21 #include <moof/ray.hh>
22
23 // frustum
24 // plane (can construct from triangle2)
25 // ray
26 // shape<>
27 // +- line<>
28 // - line2 line<2>
29 // - line3 line<3>
30 // +- sphere<>
31 // | sphere2, circle sphere<2>
32 // | sphere3 sphere<3>
33 // +- aabb<>
34 // | aabb2, rectangle aabb<2>
35 // | aabb3 aabb<3>
36 // +- polygon<>
37 // | triangle2 polygon<2,3>
38 // | triangle3 polygon<3,3>
39
40
41 namespace moof {
42
43
44 template <int D>
45 class shape
46 {
47 public:
48
49 virtual ~shape() {}
50
51 /**
52 * Checks if this shape is intersected by a given ray. If so, returns
53 * the distance from the start of the ray to the shape and information
54 * about the contact via the 2nd parameter. A negative value is
55 * returned if there is no contact.
56 */
57 virtual bool intersect_ray(const ray<D>& ray,
58 typename moof::ray<D>::contact& hit) const
59 {
60 return false;
61 }
62 };
63
64 typedef shape<2> shape2;
65 typedef shape<3> shape3;
66
67
68 } // namespace moof
69
70 #endif // _MOOF_SHAPE_HH_
71
This page took 0.03386 seconds and 4 git commands to generate.