Panda3D
|
This defines a bounding convex hexahedron. More...
#include "boundingHexahedron.h"
Public Member Functions | |
BoundingHexahedron (const LFrustum &frustum, bool is_ortho, CoordinateSystem cs=CS_default) | |
BoundingHexahedron (const LPoint3 &fll, const LPoint3 &flr, const LPoint3 &fur, const LPoint3 &ful, const LPoint3 &nll, const LPoint3 &nlr, const LPoint3 &nur, const LPoint3 &nul) | |
virtual const BoundingHexahedron * | as_bounding_hexahedron () const |
Virtual downcast method. | |
virtual TypeHandle | force_init_type () |
virtual LPoint3 | get_approx_center () const |
virtual LPoint3 | get_max () const |
virtual LPoint3 | get_min () const |
int | get_num_planes () const |
Returns 6: the number of faces of a hexahedron. | |
int | get_num_points () const |
Returns 8: the number of vertices of a hexahedron. | |
LPlane | get_plane (int n) const |
Returns the nth face of the hexahedron. | |
LPoint3 | get_point (int n) const |
Returns the nth vertex of the hexahedron. | |
virtual TypeHandle | get_type () const |
virtual BoundingVolume * | make_copy () const |
MAKE_SEQ (get_points, get_num_points, get_point) | |
MAKE_SEQ (get_planes, get_num_planes, get_plane) | |
virtual void | output (ostream &out) const |
virtual void | write (ostream &out, int indent_level=0) const |
virtual void | xform (const LMatrix4 &mat) |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Protected Member Functions | |
virtual bool | around_other (BoundingVolume *other, const BoundingVolume **first, const BoundingVolume **last) const |
virtual int | contains_box (const BoundingBox *box) const |
Double-dispatch support: called by contains_other() when the type we're testing for intersection is known to be a box. | |
virtual int | contains_hexahedron (const BoundingHexahedron *hexahedron) const |
Double-dispatch support: called by contains_other() when the type we're testing for intersection is known to be a hexahedron. | |
virtual int | contains_lineseg (const LPoint3 &a, const LPoint3 &b) const |
Tests whether the volume contains the indicated line segment. | |
virtual int | contains_other (const BoundingVolume *other) const |
virtual int | contains_point (const LPoint3 &point) const |
Tests whether the volume contains the indicated point. | |
virtual int | contains_sphere (const BoundingSphere *sphere) const |
Double-dispatch support: called by contains_other() when the type we're testing for intersection is known to be a sphere. | |
virtual bool | extend_other (BoundingVolume *other) const |
Friends | |
class | BoundingBox |
class | BoundingSphere |
This defines a bounding convex hexahedron.
It is typically used to represent a frustum, but may represent any enclosing convex hexahedron, including simple boxes. However, if all you want is an axis-aligned bounding box, you may be better off with the simpler BoundingBox class.
Definition at line 36 of file boundingHexahedron.h.
const BoundingHexahedron * BoundingHexahedron::as_bounding_hexahedron | ( | ) | const [virtual] |
Virtual downcast method.
Returns this object as a pointer of the indicated type, if it is in fact that type. Returns NULL if it is not that type.
Reimplemented from BoundingVolume.
Definition at line 211 of file boundingHexahedron.cxx.
int BoundingHexahedron::contains_box | ( | const BoundingBox * | box | ) | const [protected, virtual] |
Double-dispatch support: called by contains_other() when the type we're testing for intersection is known to be a box.
Reimplemented from BoundingVolume.
Definition at line 345 of file boundingHexahedron.cxx.
References BoundingBox::get_maxq(), BoundingBox::get_minq(), BoundingBox::get_point(), and BoundingVolume::is_empty().
Referenced by BoundingBox::contains_hexahedron().
int BoundingHexahedron::contains_hexahedron | ( | const BoundingHexahedron * | hexahedron | ) | const [protected, virtual] |
Double-dispatch support: called by contains_other() when the type we're testing for intersection is known to be a hexahedron.
Reimplemented from BoundingVolume.
Definition at line 400 of file boundingHexahedron.cxx.
References get_point(), and BoundingVolume::is_empty().
int BoundingHexahedron::contains_lineseg | ( | const LPoint3 & | a, |
const LPoint3 & | b | ||
) | const [protected, virtual] |
Tests whether the volume contains the indicated line segment.
Reimplemented from GeometricBoundingVolume.
Definition at line 279 of file boundingHexahedron.cxx.
References BoundingVolume::is_empty(), and BoundingVolume::is_infinite().
int BoundingHexahedron::contains_point | ( | const LPoint3 & | point | ) | const [protected, virtual] |
Tests whether the volume contains the indicated point.
Reimplemented from GeometricBoundingVolume.
Definition at line 253 of file boundingHexahedron.cxx.
References BoundingVolume::is_empty(), and BoundingVolume::is_infinite().
int BoundingHexahedron::contains_sphere | ( | const BoundingSphere * | sphere | ) | const [protected, virtual] |
Double-dispatch support: called by contains_other() when the type we're testing for intersection is known to be a sphere.
Reimplemented from BoundingVolume.
Definition at line 310 of file boundingHexahedron.cxx.
References BoundingVolume::is_empty().
Referenced by BoundingSphere::contains_hexahedron().
int BoundingHexahedron::get_num_planes | ( | ) | const [inline] |
Returns 6: the number of faces of a hexahedron.
Definition at line 52 of file boundingHexahedron.I.
int BoundingHexahedron::get_num_points | ( | ) | const [inline] |
Returns 8: the number of vertices of a hexahedron.
Definition at line 31 of file boundingHexahedron.I.
LPlane BoundingHexahedron::get_plane | ( | int | n | ) | const [inline] |
Returns the nth face of the hexahedron.
Definition at line 62 of file boundingHexahedron.I.
LPoint3 BoundingHexahedron::get_point | ( | int | n | ) | const [inline] |
Returns the nth vertex of the hexahedron.
Definition at line 41 of file boundingHexahedron.I.
References LPoint3f::zero().
Referenced by BoundingPlane::contains_hexahedron(), contains_hexahedron(), and PortalClipper::draw_hexahedron().
static void BoundingHexahedron::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from FiniteBoundingVolume.
Definition at line 103 of file boundingHexahedron.h.
References FiniteBoundingVolume::init_type().