TORCS  1.3.9
The Open Racing Car Simulator
Object.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 _OBJECT_H_
28 #define _OBJECT_H_
29 
30 #ifdef _MSC_VER
31 #pragma warning(disable:4786) // identifier was truncated to '255'
32 #endif // _MSC_VER
33 
34 #include <SOLID/solid.h>
35 
36 #include "Transform.h"
37 #include "BBox.h"
38 #include "Endpoint.h"
39 #include "Shape.h"
40 
41 class Object {
42 public:
43  Object(DtObjectRef obj, ShapePtr shape);
44 
45  void move();
46  void proceed();
47 
48  void translate(const Vector& v) { curr.translate(v); }
49  void rotate(const Quaternion& q) { curr.rotate(q); }
50  void scale(Scalar x, Scalar y, Scalar z) { curr.scale(x, y, z); }
51 
53 
54  void setMatrix(const float v[16]) { curr.setValue(v); }
55  void setMatrix(const double v[16]) { curr.setValue(v); }
56 
57  void multMatrix(const float v[16]) { curr *= Transform(v); }
58  void multMatrix(const double v[16]) { curr *= Transform(v); }
59 
60  const BBox& getBBox() const { return bbox; }
61 
69 };
70 
71 bool intersect(const Object&, const Object&, Vector& v);
72 bool common_point(const Object&, const Object&, Vector&, Point&, Point&);
73 bool prev_closest_points(const Object&, const Object&,
74  Vector&, Point&, Point&);
75 #endif
76 
77 
78 
79 
80 
DtObjectRef ref
Definition: Object.h:64
void scale(Scalar x, Scalar y, Scalar z)
Definition: Transform.cpp:62
static Point q[4]
Definition: Convex.cpp:55
Transform curr
Definition: Object.h:62
Object(DtObjectRef obj, ShapePtr shape)
Definition: Object.cpp:38
void multMatrix(const double v[16])
Definition: Object.h:58
void rotate(const Quaternion &q)
Definition: Object.h:49
Endpoint upper[3]
Definition: Object.h:68
void multMatrix(const float v[16])
Definition: Object.h:57
Endpoint lower[3]
Definition: Object.h:67
void scale(Scalar x, Scalar y, Scalar z)
Definition: Object.h:50
void move()
Definition: Object.cpp:54
void translate(const Vector &v)
Definition: Transform.cpp:52
void setValue(const float m[16])
Definition: Transform.cpp:33
ShapePtr shapePtr
Definition: Object.h:65
BBox bbox
Definition: Object.h:66
void setMatrix(const double v[16])
Definition: Object.h:55
void translate(const Vector &v)
Definition: Object.h:48
Definition: Shape.h:44
Definition: BBox.h:36
bool common_point(const Object &, const Object &, Vector &, Point &, Point &)
Definition: Object.cpp:131
Transform prev
Definition: Object.h:63
void proceed()
Definition: Object.cpp:64
static Vector y[4]
Definition: Convex.cpp:56
void setIdentity()
Definition: Object.h:52
void setIdentity()
Definition: Transform.cpp:67
#define Scalar
Definition: Basic.h:34
bool intersect(const Object &, const Object &, Vector &v)
Definition: Object.cpp:98
Definition: Vector.h:32
Definition: Object.h:41
void * DtObjectRef
Definition: solid.h:39
const BBox & getBBox() const
Definition: Object.h:60
Definition: Point.h:34
void rotate(const Quaternion &q)
Definition: Transform.cpp:57
bool prev_closest_points(const Object &, const Object &, Vector &, Point &, Point &)
Definition: Object.cpp:138
void setMatrix(const float v[16])
Definition: Object.h:54