TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
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
41class Object {
42public:
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
52 void setIdentity() { curr.setIdentity(); }
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
71bool intersect(const Object&, const Object&, Vector& v);
72bool common_point(const Object&, const Object&, Vector&, Point&, Point&);
73bool prev_closest_points(const Object&, const Object&,
74 Vector&, Point&, Point&);
75#endif
76
77
78
79
80
#define Scalar
Definition Basic.h:34
static Point q[4]
Definition Convex.cpp:55
static Vector y[4]
Definition Convex.cpp:56
bool intersect(const Object &, const Object &, Vector &v)
Definition Object.cpp:98
bool common_point(const Object &, const Object &, Vector &, Point &, Point &)
Definition Object.cpp:131
bool prev_closest_points(const Object &, const Object &, Vector &, Point &, Point &)
Definition Object.cpp:138
const Shape * ShapePtr
Definition Shape.h:51
Definition BBox.h:36
void multMatrix(const double v[16])
Definition Object.h:58
DtObjectRef ref
Definition Object.h:64
BBox bbox
Definition Object.h:66
void move()
Definition Object.cpp:54
void translate(const Vector &v)
Definition Object.h:48
Transform curr
Definition Object.h:62
void setIdentity()
Definition Object.h:52
void multMatrix(const float v[16])
Definition Object.h:57
void setMatrix(const float v[16])
Definition Object.h:54
void scale(Scalar x, Scalar y, Scalar z)
Definition Object.h:50
void setMatrix(const double v[16])
Definition Object.h:55
void rotate(const Quaternion &q)
Definition Object.h:49
Transform prev
Definition Object.h:63
Endpoint upper[3]
Definition Object.h:68
const BBox & getBBox() const
Definition Object.h:60
Object(DtObjectRef obj, ShapePtr shape)
Definition Object.cpp:38
void proceed()
Definition Object.cpp:64
Endpoint lower[3]
Definition Object.h:67
ShapePtr shapePtr
Definition Object.h:65
Definition Point.h:34
void * DtObjectRef
Definition solid.h:39