Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions
GeometricBoundingVolume Class Reference

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"

Inheritance diagram for GeometricBoundingVolume:
BoundingVolume TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase BoundingLine BoundingPlane FiniteBoundingVolume IntersectionBoundingVolume OmniBoundingVolume UnionBoundingVolume BoundingBox BoundingHexahedron BoundingSphere

List of all members.

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 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.
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.
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.

Detailed Description

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.


Member Function Documentation

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 OccluderNode::compute_internal_bounds(), PortalNode::compute_internal_bounds(), and TextNode::compute_internal_bounds().

bool GeometricBoundingVolume::around ( const LPoint3 first,
const LPoint3 last 
) [inline]

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().

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().

int GeometricBoundingVolume::contains ( const LPoint3 a,
const LPoint3 b 
) const [inline]

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, UnionBoundingVolume, IntersectionBoundingVolume, and OmniBoundingVolume.

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, UnionBoundingVolume, IntersectionBoundingVolume, and OmniBoundingVolume.

Definition at line 62 of file geometricBoundingVolume.cxx.

Referenced by contains().

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 ( 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_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 BoundingHexahedron, BoundingBox, UnionBoundingVolume, BoundingSphere, IntersectionBoundingVolume, BoundingLine, BoundingPlane, OmniBoundingVolume, and FiniteBoundingVolume.

Definition at line 71 of file geometricBoundingVolume.h.

References BoundingVolume::init_type().

Referenced by FiniteBoundingVolume::init_type(), OmniBoundingVolume::init_type(), BoundingPlane::init_type(), BoundingLine::init_type(), IntersectionBoundingVolume::init_type(), and UnionBoundingVolume::init_type().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations