15 #include "boundingPlane.h" 16 #include "boundingSphere.h" 17 #include "boundingBox.h" 18 #include "boundingHexahedron.h" 19 #include "config_mathutil.h" 39 get_approx_center()
const {
42 return _plane.get_point();
65 output(ostream &out)
const {
67 out <<
"bplane, empty";
69 out <<
"bplane, infinite";
71 out <<
"bplane: " << _plane;
94 return other->extend_by_plane(
this);
106 return other->around_planes(first, last);
116 return other->contains_plane(
this);
130 _plane = plane->get_plane();
148 PN_stdfloat r = sphere->get_radius();
149 PN_stdfloat d = _plane.dist_to_plane(sphere->get_center());
153 return IF_all | IF_possible | IF_some;
157 return IF_possible | IF_some;
161 return IF_no_intersection;
178 LPoint3 center = (min + max) * 0.5f;
179 PN_stdfloat radius2 = (max - center).length_squared();
181 int result = IF_possible | IF_some | IF_all;
183 PN_stdfloat dist = _plane.dist_to_plane(center);
184 PN_stdfloat dist2 = dist * dist;
186 if (dist2 <= radius2) {
193 for (
int i = 0; i < 8 && (all_in || all_out) ; ++i) {
194 if (_plane.dist_to_plane(box->
get_point(i)) < 0.0f) {
204 return IF_no_intersection;
205 }
else if (!all_in) {
209 }
else if (dist >= 0.0f) {
211 return IF_no_intersection;
249 int result = IF_possible | IF_some | IF_all;
253 for (
int i = 0; i < 8 && (all_in || all_out) ; ++i) {
254 if (_plane.dist_to_plane(hexahedron->
get_point(i)) < 0.0f) {
264 return IF_no_intersection;
265 }
else if (!all_in) {
LPoint3 get_point(int n) const
Returns the nth vertex of the hexahedron.
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple.
bool is_empty() const
Any kind of volume might be empty.
This defines a bounding sphere, consisting of a center and a radius.
bool is_infinite() const
The other side of the empty coin is an infinite volume.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
virtual const BoundingPlane * as_bounding_plane() const
Virtual downcast method.
bool is_nan() const
Returns true if any component of the matrix is not-a-number, false otherwise.
This funny bounding volume is an infinite plane that divides space into two regions: the part behind ...
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
This is a 4-by-4 transform matrix.
const LPoint3 & get_maxq() const
An inline accessor for the maximum value.
BoundingPlane()
Constructs an empty "plane" that has no intersections.
LPoint3 get_point(int n) const
Returns the nth vertex of the rectangular solid.
TypeHandle is the identifier used to differentiate C++ class types.
This defines a bounding convex hexahedron.
This funny bounding volume is an infinite line with no thickness and extending to infinity in both di...
const LPoint3 & get_minq() const
An inline accessor for the minimum value.