Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
BoundingLine Class Reference

This funny bounding volume is an infinite line with no thickness and extending to infinity in both directions. More...

#include "boundingLine.h"

Inheritance diagram for BoundingLine:
GeometricBoundingVolume BoundingVolume TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Public Member Functions

 BoundingLine (const LPoint3 &a, const LPoint3 &b)
virtual const BoundingLineas_bounding_line () const
 Virtual downcast method.
virtual TypeHandle force_init_type ()
virtual LPoint3 get_approx_center () const
const LPoint3get_point_a () const
 Returns the first point that defines the line.
LPoint3 get_point_b () const
 Returns the second point that defines the line.
virtual TypeHandle get_type () const
virtual BoundingVolumemake_copy () const
virtual void output (ostream &out) 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_other (const BoundingVolume *other) const
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_by_line (const BoundingLine *line)
 Double-dispatch support: called by extend_other() when the type we're extending by is known to be a line.
virtual bool extend_other (BoundingVolume *other) const
PN_stdfloat sqr_dist_to_line (const LPoint3 &point) const

Friends

class BoundingBox
class BoundingSphere

Detailed Description

This funny bounding volume is an infinite line with no thickness and extending to infinity in both directions.

Note that it *always* extends in both directions, despite the fact that you specify two points to the constructor. These are not endpoints, they are two arbitrary points on the line.

Definition at line 33 of file boundingLine.h.


Member Function Documentation

const BoundingLine * BoundingLine::as_bounding_line ( ) 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 89 of file boundingLine.cxx.

int BoundingLine::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 170 of file boundingLine.cxx.

References BoundingBox::get_maxq(), BoundingBox::get_minq(), BoundingVolume::is_empty(), and BoundingVolume::is_infinite().

Referenced by BoundingBox::contains_line().

int BoundingLine::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 151 of file boundingLine.cxx.

References BoundingVolume::is_empty(), and BoundingVolume::is_infinite().

Referenced by BoundingSphere::contains_line().

bool BoundingLine::extend_by_line ( const BoundingLine line) [protected, virtual]

Double-dispatch support: called by extend_other() when the type we're extending by is known to be a line.

Reimplemented from BoundingVolume.

Definition at line 131 of file boundingLine.cxx.

References BoundingVolume::is_empty(), and BoundingVolume::is_infinite().

const LPoint3 & BoundingLine::get_point_a ( ) const [inline]

Returns the first point that defines the line.

Definition at line 47 of file boundingLine.I.

References BoundingVolume::is_empty(), and BoundingVolume::is_infinite().

LPoint3 BoundingLine::get_point_b ( ) const [inline]

Returns the second point that defines the line.

Definition at line 59 of file boundingLine.I.

References BoundingVolume::is_empty(), and BoundingVolume::is_infinite().

static void BoundingLine::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 GeometricBoundingVolume.

Definition at line 79 of file boundingLine.h.

References GeometricBoundingVolume::init_type().


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