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 OmniBoundingVolume 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 LPoint3f *first, const LPoint3f *last)
 Resets the volume to enclose only the points indicated.
virtual const
GeometricBoundingVolume
as_geometric_bounding_volume () const
 Virtual downcast method.
int contains (const LPoint3f &a, const LPoint3f &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 LPoint3f &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 LPoint3f &point)
 Increases the size of the volume to include the given point.
virtual TypeHandle force_init_type ()
virtual LPoint3f get_approx_center () const =0
virtual TypeHandle get_type () const
virtual void xform (const LMatrix4f &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 LPoint3f *first, const LPoint3f *last)
 Puts the volume around the indicated list of points, identified by an STL-style begin/end list.
virtual int contains_lineseg (const LPoint3f &a, const LPoint3f &b) const
 Tests whether the volume contains the indicated line segment.
virtual int contains_point (const LPoint3f &point) const
 Tests whether the volume contains the indicated point.
virtual bool extend_by_point (const LPoint3f &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 TextNode::compute_internal_bounds(), and PortalNode::compute_internal_bounds().

bool GeometricBoundingVolume::around ( const LPoint3f first,
const LPoint3f 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 LPoint3f first,
const LPoint3f 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 CollisionLevelState< MaskType >::any_in_bounds(), LensNode::is_in_view(), and PortalClipper::is_whole_portal_in_view().

int GeometricBoundingVolume::contains ( const LPoint3f 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 LPoint3f a,
const LPoint3f 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 LPoint3f a,
const LPoint3f b 
) const [protected, virtual]

Tests whether the volume contains the indicated line segment.

Reimplemented in BoundingBox, BoundingHexahedron, BoundingSphere, and OmniBoundingVolume.

Definition at line 73 of file geometricBoundingVolume.cxx.

Referenced by contains().

int GeometricBoundingVolume::contains_point ( const LPoint3f point) const [protected, virtual]

Tests whether the volume contains the indicated point.

Reimplemented in BoundingBox, BoundingHexahedron, BoundingSphere, and OmniBoundingVolume.

Definition at line 62 of file geometricBoundingVolume.cxx.

Referenced by contains().

bool GeometricBoundingVolume::extend_by ( const LPoint3f 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 LPoint3f 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, and OmniBoundingVolume.

Definition at line 72 of file geometricBoundingVolume.h.

References BoundingVolume::init_type().

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


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