TORCS
1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
BBoxTree.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 _BBOXTREE_H_
28
#define _BBOXTREE_H_
29
30
#ifdef _MSC_VER
31
#pragma warning(disable:4786)
// identifier was truncated to '255'
32
#endif
// _MSC_VER
33
34
#include "
BBox.h
"
35
#include "
Polytope.h
"
36
37
class
Convex
;
38
class
Transform
;
39
class
Matrix
;
40
41
class
BBoxNode
{
42
public
:
43
enum
TagType
{
LEAF
,
INTERNAL
};
44
45
BBox
bbox
;
46
47
TagType
tag
;
48
};
49
50
class
BBoxLeaf
:
public
BBoxNode
{
51
public
:
52
const
Polytope
*
poly
;
53
54
BBoxLeaf
() {}
55
BBoxLeaf
(
const
Polytope
*
p
) :
poly
(
p
) {
56
tag
=
LEAF
;
57
fitBBox
();
58
}
59
60
void
fitBBox
();
61
};
62
63
class
BBoxInternal
:
public
BBoxNode
{
64
public
:
65
BBoxNode
*
lson
;
66
BBoxNode
*
rson
;
67
68
BBoxInternal
() {}
69
BBoxInternal
(
int
n,
BBoxLeaf
*l);
70
71
void
refitBBox
() {
bbox
.enclose(
lson
->bbox,
rson
->bbox); }
72
};
73
74
75
76
bool
intersect
(
const
BBoxNode
*tree,
const
Convex
& c,
const
BBox
& bb,
77
const
Transform
& b2a,
Vector
& v);
78
79
bool
intersect
(
const
BBoxNode
*a,
const
BBoxNode
*b,
80
const
Transform
& b2a,
const
Matrix
& abs_b2a,
81
const
Transform
& a2b,
const
Matrix
& abs_a2b,
Vector
& v);
82
83
bool
find_prim
(
const
BBoxNode
*tree,
const
Convex
& c,
const
BBox
& bb,
84
const
Transform
& b2a,
Vector
& v,
ShapePtr
&
p
);
85
86
bool
find_prim
(
const
BBoxNode
*a,
const
BBoxNode
*b,
87
const
Transform
& b2a,
const
Matrix
& abs_b2a,
88
const
Transform
& a2b,
const
Matrix
& abs_a2b,
89
Vector
& v,
ShapePtr
& pa,
ShapePtr
& pb);
90
91
bool
common_point
(
const
BBoxNode
*tree,
const
Convex
& c,
const
BBox
& bb,
92
const
Transform
& b2a,
Vector
& v,
Point
& pa,
Point
& pb);
93
94
bool
common_point
(
const
BBoxNode
*a,
const
BBoxNode
*b,
95
const
Transform
& b2a,
const
Matrix
& abs_b2a,
96
const
Transform
& a2b,
const
Matrix
& abs_a2b,
97
Vector
& v,
Point
& pa,
Point
& pb);
98
99
#endif
100
101
102
103
104
105
BBox.h
intersect
bool intersect(const BBoxNode *tree, const Convex &c, const BBox &bb, const Transform &b2a, Vector &v)
Definition
BBoxTree.cpp:115
find_prim
bool find_prim(const BBoxNode *tree, const Convex &c, const BBox &bb, const Transform &b2a, Vector &v, ShapePtr &p)
Definition
BBoxTree.cpp:154
common_point
bool common_point(const BBoxNode *tree, const Convex &c, const BBox &bb, const Transform &b2a, Vector &v, Point &pa, Point &pb)
Definition
BBoxTree.cpp:204
p
static Point p[4]
Definition
Convex.cpp:54
Polytope.h
ShapePtr
const Shape * ShapePtr
Definition
Shape.h:51
BBox
Definition
BBox.h:36
BBoxInternal::lson
BBoxNode * lson
Definition
BBoxTree.h:65
BBoxInternal::BBoxInternal
BBoxInternal()
Definition
BBoxTree.h:68
BBoxInternal::rson
BBoxNode * rson
Definition
BBoxTree.h:66
BBoxInternal::refitBBox
void refitBBox()
Definition
BBoxTree.h:71
BBoxLeaf
Definition
BBoxTree.h:50
BBoxLeaf::BBoxLeaf
BBoxLeaf()
Definition
BBoxTree.h:54
BBoxLeaf::BBoxLeaf
BBoxLeaf(const Polytope *p)
Definition
BBoxTree.h:55
BBoxLeaf::poly
const Polytope * poly
Definition
BBoxTree.h:52
BBoxLeaf::fitBBox
void fitBBox()
Definition
BBoxTree.cpp:49
BBoxNode
Definition
BBoxTree.h:41
BBoxNode::TagType
TagType
Definition
BBoxTree.h:43
BBoxNode::LEAF
@ LEAF
Definition
BBoxTree.h:43
BBoxNode::INTERNAL
@ INTERNAL
Definition
BBoxTree.h:43
BBoxNode::bbox
BBox bbox
Definition
BBoxTree.h:45
BBoxNode::tag
TagType tag
Definition
BBoxTree.h:47
Convex
Definition
Convex.h:39
Matrix
Definition
Matrix.h:37
Point
Definition
Point.h:34
Polytope
Definition
Polytope.h:38
Transform
Definition
Transform.h:41
Vector
Definition
Vector.h:32
C:
Users
berni
Development
torcs_git
torcs-code
torcs
torcs
src
modules
simu
simuv2
SOLID-2.0
src
BBoxTree.h
Generated by
1.14.0