TORCS  1.3.9
The Open Racing Car Simulator
Convex.h
Go to the documentation of this file.
1 /*
2  SOLID - Software Library for Interference Detection
3  Copyright (C) 1997-1998 Gino van den Bergen
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public
16  License along with this library; if not, write to the Free
17  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 
19  Please send remarks, questions and bug reports to gino@win.tue.nl,
20  or write to:
21  Gino van den Bergen
22  Department of Mathematics and Computing Science
23  Eindhoven University of Technology
24  P.O. Box 513, 5600 MB Eindhoven, The Netherlands
25 */
26 
27 #ifndef _CONVEX_H_
28 #define _CONVEX_H_
29 
30 #ifdef _MSC_VER
31 #pragma warning(disable:4786) // identifier was truncated to '255'
32 #endif // _MSC_VER
33 
34 #include <3D/Point.h>
35 #include "Shape.h"
36 #include "BBox.h"
37 #include "Transform.h"
38 
39 class Convex : public Shape {
40 public:
41  ShapeType getType() const { return CONVEX; }
42 
43  virtual ~Convex() {}
44  virtual Point support(const Vector& v) const = 0;
45  virtual BBox bbox(const Transform& t) const;
46 };
47 
48 
49 bool intersect(const Convex& a, const Convex& b,
50  const Transform& a2w, const Transform& b2w,
51  Vector& v);
52 
53 bool intersect(const Convex& a, const Convex& b, const Transform& b2a,
54  Vector& v);
55 
56 bool common_point(const Convex& a, const Convex& b,
57  const Transform& a2w, const Transform& b2w,
58  Vector& v, Point& pa, Point& pb);
59 
60 bool common_point(const Convex& a, const Convex& b, const Transform& b2a,
61  Vector& v, Point& pa, Point& pb);
62 
63 void closest_points(const Convex&, const Convex&,
64  const Transform&, const Transform&,
65  Point&, Point&);
66 
67 #endif
Definition: Convex.h:39
void closest_points(const Convex &, const Convex &, const Transform &, const Transform &, Point &, Point &)
Definition: Convex.cpp:386
virtual Point support(const Vector &v) const =0
ShapeType getType() const
Definition: Convex.h:41
ShapeType
Definition: Shape.h:39
Definition: Shape.h:44
Definition: BBox.h:36
bool intersect(const Convex &a, const Convex &b, const Transform &a2w, const Transform &b2w, Vector &v)
Definition: Convex.cpp:212
virtual BBox bbox(const Transform &t) const
Definition: Convex.cpp:38
Definition: Shape.h:41
virtual ~Convex()
Definition: Convex.h:43
Definition: Vector.h:32
bool common_point(const Convex &a, const Convex &b, const Transform &a2w, const Transform &b2w, Vector &v, Point &pa, Point &pb)
Definition: Convex.cpp:296
Definition: Point.h:34