Panda3D
 All Classes Functions Variables Enumerations
omniBoundingVolume.cxx
1 // Filename: omniBoundingVolume.cxx
2 // Created by: drose (22Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "omniBoundingVolume.h"
16 #include "boundingHexahedron.h"
17 #include "config_mathutil.h"
18 
19 #include <math.h>
20 
21 TypeHandle OmniBoundingVolume::_type_handle;
22 
23 ////////////////////////////////////////////////////////////////////
24 // Function: OmniBoundingVolume::make_copy
25 // Access: Public, Virtual
26 // Description:
27 ////////////////////////////////////////////////////////////////////
28 BoundingVolume *OmniBoundingVolume::
29 make_copy() const {
30  return new OmniBoundingVolume(*this);
31 }
32 
33 ////////////////////////////////////////////////////////////////////
34 // Function: OmniBoundingVolume::get_approx_center
35 // Access: Public, Virtual
36 // Description:
37 ////////////////////////////////////////////////////////////////////
38 LPoint3 OmniBoundingVolume::
39 get_approx_center() const {
40  return LPoint3(0.0f, 0.0f, 0.0f);
41 }
42 
43 ////////////////////////////////////////////////////////////////////
44 // Function: OmniBoundingVolume::xform
45 // Access: Public, Virtual
46 // Description:
47 ////////////////////////////////////////////////////////////////////
48 void OmniBoundingVolume::
49 xform(const LMatrix4 &) {
50 }
51 
52 ////////////////////////////////////////////////////////////////////
53 // Function: OmniBoundingVolume::output
54 // Access: Public, Virtual
55 // Description:
56 ////////////////////////////////////////////////////////////////////
57 void OmniBoundingVolume::
58 output(ostream &out) const {
59  out << "omni";
60 }
61 
62 ////////////////////////////////////////////////////////////////////
63 // Function: OmniBoundingVolume::extend_other
64 // Access: Public, Virtual
65 // Description:
66 ////////////////////////////////////////////////////////////////////
67 bool OmniBoundingVolume::
68 extend_other(BoundingVolume *other) const {
69  other->set_infinite();
70  return true;
71 }
72 
73 ////////////////////////////////////////////////////////////////////
74 // Function: OmniBoundingVolume::around_other
75 // Access: Public, Virtual
76 // Description:
77 ////////////////////////////////////////////////////////////////////
78 bool OmniBoundingVolume::
79 around_other(BoundingVolume *other,
80  const BoundingVolume **,
81  const BoundingVolume **) const {
82  other->set_infinite();
83  return true;
84 }
85 
86 ////////////////////////////////////////////////////////////////////
87 // Function: OmniBoundingVolume::contains_other
88 // Access: Public, Virtual
89 // Description:
90 ////////////////////////////////////////////////////////////////////
91 int OmniBoundingVolume::
92 contains_other(const BoundingVolume *) const {
93  return IF_possible | IF_some | IF_all;
94 }
95 
96 ////////////////////////////////////////////////////////////////////
97 // Function: OmniBoundingVolume::extend_by_point
98 // Access: Public, Virtual
99 // Description:
100 ////////////////////////////////////////////////////////////////////
101 bool OmniBoundingVolume::
102 extend_by_point(const LPoint3 &) {
103  return true;
104 }
105 
106 ////////////////////////////////////////////////////////////////////
107 // Function: OmniBoundingVolume::extend_by_sphere
108 // Access: Public, Virtual
109 // Description:
110 ////////////////////////////////////////////////////////////////////
111 bool OmniBoundingVolume::
112 extend_by_sphere(const BoundingSphere *) {
113  return true;
114 }
115 
116 ////////////////////////////////////////////////////////////////////
117 // Function: OmniBoundingVolume::extend_by_box
118 // Access: Public, Virtual
119 // Description:
120 ////////////////////////////////////////////////////////////////////
121 bool OmniBoundingVolume::
122 extend_by_box(const BoundingBox *) {
123  return true;
124 }
125 
126 ////////////////////////////////////////////////////////////////////
127 // Function: OmniBoundingVolume::extend_by_hexahedron
128 // Access: Public, Virtual
129 // Description:
130 ////////////////////////////////////////////////////////////////////
131 bool OmniBoundingVolume::
132 extend_by_hexahedron(const BoundingHexahedron *) {
133  return true;
134 }
135 
136 ////////////////////////////////////////////////////////////////////
137 // Function: OmniBoundingVolume::around_points
138 // Access: Public, Virtual
139 // Description:
140 ////////////////////////////////////////////////////////////////////
141 bool OmniBoundingVolume::
142 around_points(const LPoint3 *, const LPoint3 *) {
143  return true;
144 }
145 
146 ////////////////////////////////////////////////////////////////////
147 // Function: OmniBoundingVolume::around_spheres
148 // Access: Public, Virtual
149 // Description:
150 ////////////////////////////////////////////////////////////////////
151 bool OmniBoundingVolume::
152 around_spheres(const BoundingVolume **,
153  const BoundingVolume **) {
154  return true;
155 }
156 
157 ////////////////////////////////////////////////////////////////////
158 // Function: OmniBoundingVolume::around_boxes
159 // Access: Public, Virtual
160 // Description:
161 ////////////////////////////////////////////////////////////////////
162 bool OmniBoundingVolume::
163 around_boxes(const BoundingVolume **,
164  const BoundingVolume **) {
165  return true;
166 }
167 
168 ////////////////////////////////////////////////////////////////////
169 // Function: OmniBoundingVolume::around_hexahedrons
170 // Access: Public, Virtual
171 // Description:
172 ////////////////////////////////////////////////////////////////////
173 bool OmniBoundingVolume::
174 around_hexahedrons(const BoundingVolume **,
175  const BoundingVolume **) {
176  return true;
177 }
178 
179 ////////////////////////////////////////////////////////////////////
180 // Function: OmniBoundingVolume::contains_point
181 // Access: Public, Virtual
182 // Description:
183 ////////////////////////////////////////////////////////////////////
184 int OmniBoundingVolume::
185 contains_point(const LPoint3 &) const {
186  return IF_possible | IF_some | IF_all;
187 }
188 
189 ////////////////////////////////////////////////////////////////////
190 // Function: OmniBoundingVolume::contains_lineseg
191 // Access: Public, Virtual
192 // Description:
193 ////////////////////////////////////////////////////////////////////
194 int OmniBoundingVolume::
195 contains_lineseg(const LPoint3 &, const LPoint3 &) const {
196  return IF_possible | IF_some | IF_all;
197 }
198 
199 ////////////////////////////////////////////////////////////////////
200 // Function: OmniBoundingVolume::contains_sphere
201 // Access: Public, Virtual
202 // Description:
203 ////////////////////////////////////////////////////////////////////
204 int OmniBoundingVolume::
205 contains_sphere(const BoundingSphere *) const {
206  return IF_possible | IF_some | IF_all;
207 }
208 
209 ////////////////////////////////////////////////////////////////////
210 // Function: OmniBoundingVolume::contains_box
211 // Access: Public, Virtual
212 // Description:
213 ////////////////////////////////////////////////////////////////////
214 int OmniBoundingVolume::
215 contains_box(const BoundingBox *) const {
216  return IF_possible | IF_some | IF_all;
217 }
218 
219 ////////////////////////////////////////////////////////////////////
220 // Function: OmniBoundingVolume::contains_hexahedron
221 // Access: Public, Virtual
222 // Description:
223 ////////////////////////////////////////////////////////////////////
224 int OmniBoundingVolume::
225 contains_hexahedron(const BoundingHexahedron *) const {
226  return IF_possible | IF_some | IF_all;
227 }
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple.
Definition: boundingBox.h:31
This defines a bounding sphere, consisting of a center and a radius.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
void set_infinite()
Marks the volume as infinite, even if it is normally finite.
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
This is a special kind of GeometricBoundingVolume that fills all of space.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This defines a bounding convex hexahedron.