Panda3D
omniBoundingVolume.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file omniBoundingVolume.cxx
10  * @author drose
11  * @date 2000-06-22
12  */
13 
14 #include "omniBoundingVolume.h"
15 #include "boundingHexahedron.h"
16 #include "config_mathutil.h"
17 
18 #include <math.h>
19 
20 TypeHandle OmniBoundingVolume::_type_handle;
21 
22 /**
23  *
24  */
25 BoundingVolume *OmniBoundingVolume::
26 make_copy() const {
27  return new OmniBoundingVolume(*this);
28 }
29 
30 /**
31  *
32  */
33 LPoint3 OmniBoundingVolume::
34 get_approx_center() const {
35  return LPoint3(0.0f, 0.0f, 0.0f);
36 }
37 
38 /**
39  *
40  */
41 void OmniBoundingVolume::
42 xform(const LMatrix4 &) {
43 }
44 
45 /**
46  *
47  */
48 void OmniBoundingVolume::
49 output(std::ostream &out) const {
50  out << "omni";
51 }
52 
53 /**
54  *
55  */
56 bool OmniBoundingVolume::
57 extend_other(BoundingVolume *other) const {
58  other->set_infinite();
59  return true;
60 }
61 
62 /**
63  *
64  */
65 bool OmniBoundingVolume::
66 around_other(BoundingVolume *other,
67  const BoundingVolume **,
68  const BoundingVolume **) const {
69  other->set_infinite();
70  return true;
71 }
72 
73 /**
74  *
75  */
76 int OmniBoundingVolume::
77 contains_other(const BoundingVolume *) const {
78  return IF_possible | IF_some | IF_all;
79 }
80 
81 /**
82  *
83  */
84 bool OmniBoundingVolume::
85 extend_by_point(const LPoint3 &) {
86  return true;
87 }
88 
89 /**
90  *
91  */
92 bool OmniBoundingVolume::
93 extend_by_sphere(const BoundingSphere *) {
94  return true;
95 }
96 
97 /**
98  *
99  */
100 bool OmniBoundingVolume::
101 extend_by_box(const BoundingBox *) {
102  return true;
103 }
104 
105 /**
106  *
107  */
108 bool OmniBoundingVolume::
109 extend_by_hexahedron(const BoundingHexahedron *) {
110  return true;
111 }
112 
113 /**
114  *
115  */
116 bool OmniBoundingVolume::
117 around_points(const LPoint3 *, const LPoint3 *) {
118  return true;
119 }
120 
121 /**
122  *
123  */
124 bool OmniBoundingVolume::
125 around_spheres(const BoundingVolume **,
126  const BoundingVolume **) {
127  return true;
128 }
129 
130 /**
131  *
132  */
133 bool OmniBoundingVolume::
134 around_boxes(const BoundingVolume **,
135  const BoundingVolume **) {
136  return true;
137 }
138 
139 /**
140  *
141  */
142 bool OmniBoundingVolume::
143 around_hexahedrons(const BoundingVolume **,
144  const BoundingVolume **) {
145  return true;
146 }
147 
148 /**
149  *
150  */
151 int OmniBoundingVolume::
152 contains_point(const LPoint3 &) const {
153  return IF_possible | IF_some | IF_all;
154 }
155 
156 /**
157  *
158  */
159 int OmniBoundingVolume::
160 contains_lineseg(const LPoint3 &, const LPoint3 &) const {
161  return IF_possible | IF_some | IF_all;
162 }
163 
164 /**
165  *
166  */
167 int OmniBoundingVolume::
168 contains_sphere(const BoundingSphere *) const {
169  return IF_possible | IF_some | IF_all;
170 }
171 
172 /**
173  *
174  */
175 int OmniBoundingVolume::
176 contains_box(const BoundingBox *) const {
177  return IF_possible | IF_some | IF_all;
178 }
179 
180 /**
181  *
182  */
183 int OmniBoundingVolume::
184 contains_hexahedron(const BoundingHexahedron *) const {
185  return IF_possible | IF_some | IF_all;
186 }
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple.
Definition: boundingBox.h:29
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This defines a bounding sphere, consisting of a center and a radius.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 special kind of GeometricBoundingVolume that fills all of space.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
This defines a bounding convex hexahedron.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.