Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
IntersectionBoundingVolume Class Reference

This special bounding volume is the intersection of all of its constituent bounding volumes. More...

`#include "intersectionBoundingVolume.h"`

Inheritance diagram for IntersectionBoundingVolume:

## Public Member Functions
| IntersectionBoundingVolume ()
| Constructs an empty intersection.
| IntersectionBoundingVolume (const IntersectionBoundingVolume &copy)
void | add_component (const GeometricBoundingVolume *component)
| Adds a new component to the volume.
void | clear_components ()
| Removes all components from the volume.
virtual TypeHandle | force_init_type ()
virtual LPoint3 | get_approx_center () const
const GeometricBoundingVolume * | get_component (int n) const
int | get_num_components () const
virtual TypeHandle | get_type () const
virtual BoundingVolume * | make_copy () const
virtual void | output (std::ostream &out) const
virtual void | write (std::ostream &out, int indent_level) const
virtual void | xform (const LMatrix4 &mat)
Public Member Functions inherited from GeometricBoundingVolume
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 final
| Virtual downcast method.
virtual GeometricBoundingVolume * | as_geometric_bounding_volume () final
| 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 &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 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.
Public Member Functions inherited from BoundingVolume
bool | around (const BoundingVolume **first, const BoundingVolume **last)
| Resets the volume to enclose only the volumes indicated.
virtual const BoundingBox * | as_bounding_box () const
| Virtual downcast method.
virtual const BoundingHexahedron * | as_bounding_hexahedron () const
| Virtual downcast method.
virtual const BoundingLine * | as_bounding_line () const
| Virtual downcast method.
virtual const BoundingPlane * | as_bounding_plane () const
| Virtual downcast method.
virtual const BoundingSphere * | as_bounding_sphere () const
| Virtual downcast method.
virtual const FiniteBoundingVolume * | as_finite_bounding_volume () const
| Virtual downcast method.
int | contains (const BoundingVolume *vol) const
| Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated volume.
bool | extend_by (const BoundingVolume *vol)
| Increases the size of the volume to include the given volume.
bool | is_empty () const
| Any kind of volume might be empty.
bool | is_infinite () const
| The other side of the empty coin is an infinite volume.
void | set_infinite ()
| Marks the volume as infinite, even if it is normally finite.
Public Member Functions inherited from TypedReferenceCount
| TypedReferenceCount (const TypedReferenceCount &copy)
void | operator= (const TypedReferenceCount &copy)
Public Member Functions inherited from TypedObject
| TypedObject (const TypedObject &copy)=default
TypedObject * | as_typed_object ()
| Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObject * | as_typed_object () const
| Returns the object, upcast (if necessary) to a TypedObject pointer.
int | get_best_parent_from_Set (const std::set< int > &) const
int | get_type_index () const
| Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
bool | is_exact_type (TypeHandle handle) const
| Returns true if the current object is the indicated type exactly.
bool | is_of_type (TypeHandle handle) const
| Returns true if the current object is or derives from the indicated type.
TypedObject & | operator= (const TypedObject &copy)=default
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)
Public Member Functions inherited from ReferenceCount
int | get_ref_count () const
WeakReferenceList * | get_weak_list () const
| Returns the WeakReferenceList associated with this ReferenceCount object.
bool | has_weak_list () const
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
void | local_object ()
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void | ref () const
| Explicitly increments the reference count.
bool | ref_if_nonzero () const
| Atomically increases the reference count of this object if it is not zero.
bool | test_ref_count_integrity () const
| Does some easy checks to make sure that the reference count isn't completely bogus.
bool | test_ref_count_nonzero () const
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
virtual bool | unref () const
| Explicitly decrements the reference count.
bool | unref_if_one () const
| Atomically decreases the reference count of this object if it is one.
WeakReferenceList * | weak_ref ()
| Adds the indicated PointerToVoid as a weak reference to this object.
void | weak_unref ()
| Removes the indicated PointerToVoid as a weak reference to this object.

## Static Public Member Functions
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from GeometricBoundingVolume
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from BoundingVolume
static TypeHandle | get_class_type ()
static void | init_type ()
static BoundsType | string_bounds_type (const std::string &str)
| Returns the BoundsType corresponding to the indicated string.
Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedObject
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.
Static Public Member Functions inherited from ReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()

## Public Attributes
| get_component
| Returns the nth component in the intersection.
| get_num_components
| Returns the number of components in the intersection.
Public Attributes inherited from TypedObject
| get_type
Public Attributes inherited from ReferenceCount
| get_ref_count
| Returns the current reference count.

## Friends
class | BoundingVolume

## Additional Inherited Members
Public Types inherited from BoundingVolume
enum | BoundsType { BT_default , BT_best , BT_sphere , BT_box , BT_fastest }
enum | IntersectionFlags { IF_no_intersection = 0 , IF_possible = 0x01 , IF_some = 0x02 , IF_all = 0x04 , IF_dont_understand = 0x08 }

## Detailed Description

This special bounding volume is the intersection of all of its constituent bounding volumes.

A point is defined to be within an IntersectionBoundingVolume if it is within all of its component bounding volumes.

Definition at line 29 of file intersectionBoundingVolume.h.

## Constructor & Destructor Documentation

## ◆ IntersectionBoundingVolume() [1/2]

IntersectionBoundingVolume::IntersectionBoundingVolume | ( |  | ) |
| inline

Constructs an empty intersection.

Definition at line 17 of file intersectionBoundingVolume.I.

Referenced by add_component().

## ◆ IntersectionBoundingVolume() [2/2]

IntersectionBoundingVolume::IntersectionBoundingVolume | ( | const IntersectionBoundingVolume & | copy | ) |

Definition at line 24 of file intersectionBoundingVolume.cxx.

## Member Function Documentation

## ◆ add_component()

void IntersectionBoundingVolume::add_component | ( | const GeometricBoundingVolume * | component | ) |

Adds a new component to the volume.

This does not necessarily increase the total number of components by one, and you may or may not be able to find this component in the volume by a subsequent call to get_component(); certain optimizations may prevent the component from being added, or have other unexpected effects on the total set of components.

Definition at line 129 of file intersectionBoundingVolume.cxx.

References IntersectionBoundingVolume(), add_component(), GeometricBoundingVolume::contains(), BoundingVolume::is_empty(), TypedObject::is_exact_type(), and BoundingVolume::is_infinite().

Referenced by add_component().

## ◆ clear_components()

void IntersectionBoundingVolume::clear_components | ( |  | ) |

Removes all components from the volume.

Definition at line 116 of file intersectionBoundingVolume.cxx.

## ◆ force_init_type()

virtual TypeHandle IntersectionBoundingVolume::force_init_type | ( |  | ) |
| inline virtual

Reimplemented from GeometricBoundingVolume.

Definition at line 91 of file intersectionBoundingVolume.h.

## ◆ get_approx_center()

LPoint3 IntersectionBoundingVolume::get_approx_center | ( |  | ) | const
| virtual

Implements GeometricBoundingVolume.

Definition at line 42 of file intersectionBoundingVolume.cxx.

## ◆ get_class_type()

static TypeHandle IntersectionBoundingVolume::get_class_type | ( |  | ) |
| inline static

Definition at line 80 of file intersectionBoundingVolume.h.

## ◆ get_type()

virtual TypeHandle IntersectionBoundingVolume::get_type | ( |  | ) | const
| inline virtual

Reimplemented from GeometricBoundingVolume.

Definition at line 88 of file intersectionBoundingVolume.h.

## ◆ init_type()

static void IntersectionBoundingVolume::init_type | ( |  | ) |
| inline static

Definition at line 83 of file intersectionBoundingVolume.h.

## ◆ make_copy()

BoundingVolume * IntersectionBoundingVolume::make_copy | ( |  | ) | const
| virtual

Implements BoundingVolume.

Definition at line 34 of file intersectionBoundingVolume.cxx.

## ◆ output()

void IntersectionBoundingVolume::output | ( | std::ostream & | out | ) | const
| virtual

Implements BoundingVolume.

Definition at line 76 of file intersectionBoundingVolume.cxx.

## ◆ write()

void IntersectionBoundingVolume::write | ( | std::ostream & | out,
|  | int | indent_level ) const
| virtual

Reimplemented from BoundingVolume.

Definition at line 96 of file intersectionBoundingVolume.cxx.

## ◆ xform()

void IntersectionBoundingVolume::xform | ( | const LMatrix4 & | mat | ) |
| virtual

Implements GeometricBoundingVolume.

Definition at line 60 of file intersectionBoundingVolume.cxx.

## Friends And Related Symbol Documentation

## ◆ BoundingVolume

friend class BoundingVolume
| friend

Definition at line 96 of file intersectionBoundingVolume.h.

## Member Data Documentation

## ◆ get_component

const GeometricBoundingVolume * IntersectionBoundingVolume::get_component
| inline

Returns the nth component in the intersection.

Definition at line 49 of file intersectionBoundingVolume.h.

## ◆ get_num_components

int IntersectionBoundingVolume::get_num_components
| inline

Returns the number of components in the intersection.

Definition at line 49 of file intersectionBoundingVolume.h.

The documentation for this class was generated from the following files:

- panda/src/mathutil/intersectionBoundingVolume.h
- panda/src/mathutil/intersectionBoundingVolume.cxx
- panda/src/mathutil/intersectionBoundingVolume.I