Panda3D
|
This is another abstract class, for a general class of bounding volumes that actually enclose points in 3-d space, such as BSP's and bounding spheres. More...
#include "geometricBoundingVolume.h"
Public Member Functions | |
bool | around (const GeometricBoundingVolume **first, const GeometricBoundingVolume **last) |
Resets the volume to enclose only the volumes indicated. | |
bool | around (const LPoint3 *first, const LPoint3 *last) |
Resets the volume to enclose only the points indicated. | |
virtual const GeometricBoundingVolume * | as_geometric_bounding_volume () const |
Virtual downcast method. | |
int | contains (const LPoint3 &a, const LPoint3 &b) const |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated line segment. | |
int | contains (const GeometricBoundingVolume *vol) const |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated volume. | |
int | contains (const LPoint3 &point) const |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated point. | |
bool | extend_by (const GeometricBoundingVolume *vol) |
Increases the size of the volume to include the given volume. | |
bool | extend_by (const LPoint3 &point) |
Increases the size of the volume to include the given point. | |
virtual TypeHandle | force_init_type () |
virtual LPoint3 | get_approx_center () const =0 |
virtual TypeHandle | get_type () const |
virtual void | xform (const LMatrix4 &mat)=0 |
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_points (const LPoint3 *first, const LPoint3 *last) |
Puts the volume around the indicated list of points, identified by an STL-style begin/end list. | |
virtual int | contains_lineseg (const LPoint3 &a, const LPoint3 &b) const |
Tests whether the volume contains the indicated line segment. | |
virtual int | contains_point (const LPoint3 &point) const |
Tests whether the volume contains the indicated point. | |
virtual bool | extend_by_point (const LPoint3 &point) |
Extends the volume to include the indicated point. |
This is another abstract class, for a general class of bounding volumes that actually enclose points in 3-d space, such as BSP's and bounding spheres.
Definition at line 31 of file geometricBoundingVolume.h.
bool GeometricBoundingVolume::around | ( | const GeometricBoundingVolume ** | first, |
const GeometricBoundingVolume ** | last | ||
) | [inline] |
Resets the volume to enclose only the volumes indicated.
Definition at line 53 of file geometricBoundingVolume.I.
Referenced by TextNode::compute_internal_bounds(), PortalNode::compute_internal_bounds(), and OccluderNode::compute_internal_bounds().
Resets the volume to enclose only the points indicated.
Definition at line 66 of file geometricBoundingVolume.I.
References around_points().
bool GeometricBoundingVolume::around_points | ( | const LPoint3 * | first, |
const LPoint3 * | last | ||
) | [protected, virtual] |
Puts the volume around the indicated list of points, identified by an STL-style begin/end list.
Reimplemented in BoundingBox, BoundingSphere, and OmniBoundingVolume.
Definition at line 50 of file geometricBoundingVolume.cxx.
Referenced by around().
const GeometricBoundingVolume * GeometricBoundingVolume::as_geometric_bounding_volume | ( | ) | 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 28 of file geometricBoundingVolume.cxx.
int GeometricBoundingVolume::contains | ( | const GeometricBoundingVolume * | vol | ) | const [inline] |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated volume.
Definition at line 83 of file geometricBoundingVolume.I.
Referenced by UnionBoundingVolume::add_component(), IntersectionBoundingVolume::add_component(), CollisionLevelState< MaskType >::any_in_bounds(), LensNode::is_in_view(), and PortalClipper::is_whole_portal_in_view().
int GeometricBoundingVolume::contains | ( | const LPoint3 & | point | ) | const [inline] |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated point.
Definition at line 95 of file geometricBoundingVolume.I.
References contains_point(), and BoundingVolume::is_empty().
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated line segment.
Definition at line 111 of file geometricBoundingVolume.I.
References contains_lineseg(), and BoundingVolume::is_empty().
int GeometricBoundingVolume::contains_lineseg | ( | const LPoint3 & | a, |
const LPoint3 & | b | ||
) | const [protected, virtual] |
Tests whether the volume contains the indicated line segment.
Reimplemented in BoundingBox, BoundingHexahedron, BoundingSphere, IntersectionBoundingVolume, OmniBoundingVolume, and UnionBoundingVolume.
Definition at line 73 of file geometricBoundingVolume.cxx.
Referenced by contains().
int GeometricBoundingVolume::contains_point | ( | const LPoint3 & | point | ) | const [protected, virtual] |
Tests whether the volume contains the indicated point.
Reimplemented in BoundingBox, BoundingHexahedron, BoundingSphere, IntersectionBoundingVolume, OmniBoundingVolume, and UnionBoundingVolume.
Definition at line 62 of file geometricBoundingVolume.cxx.
Referenced by contains().
bool GeometricBoundingVolume::extend_by | ( | const LPoint3 & | point | ) | [inline] |
Increases the size of the volume to include the given point.
Definition at line 42 of file geometricBoundingVolume.I.
References extend_by_point().
bool GeometricBoundingVolume::extend_by | ( | const GeometricBoundingVolume * | vol | ) | [inline] |
Increases the size of the volume to include the given volume.
Definition at line 31 of file geometricBoundingVolume.I.
Referenced by CollisionLevelStateBase::prepare_collider().
bool GeometricBoundingVolume::extend_by_point | ( | const LPoint3 & | point | ) | [protected, virtual] |
Extends the volume to include the indicated point.
Returns true if possible, false if not.
Reimplemented in BoundingBox, BoundingSphere, and OmniBoundingVolume.
Definition at line 39 of file geometricBoundingVolume.cxx.
Referenced by extend_by().
static void GeometricBoundingVolume::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 BoundingVolume.
Reimplemented in BoundingBox, BoundingHexahedron, BoundingLine, BoundingPlane, BoundingSphere, FiniteBoundingVolume, IntersectionBoundingVolume, OmniBoundingVolume, and UnionBoundingVolume.
Definition at line 71 of file geometricBoundingVolume.h.
References BoundingVolume::init_type().
Referenced by UnionBoundingVolume::init_type(), OmniBoundingVolume::init_type(), IntersectionBoundingVolume::init_type(), FiniteBoundingVolume::init_type(), BoundingPlane::init_type(), and BoundingLine::init_type().