Panda3D
|
This is an abstract class for any volume in any sense which can be said to define the locality of reference of a node in a graph, along with all of its descendants. More...
#include "boundingVolume.h"
Public Member Functions | |
bool | around (const BoundingVolume **first, const BoundingVolume **last) |
Resets the volume to enclose only the volumes indicated. More... | |
virtual const BoundingBox * | as_bounding_box () const |
Virtual downcast method. More... | |
virtual const BoundingHexahedron * | as_bounding_hexahedron () const |
Virtual downcast method. More... | |
virtual const BoundingLine * | as_bounding_line () const |
Virtual downcast method. More... | |
virtual const BoundingPlane * | as_bounding_plane () const |
Virtual downcast method. More... | |
virtual const BoundingSphere * | as_bounding_sphere () const |
Virtual downcast method. More... | |
virtual const FiniteBoundingVolume * | as_finite_bounding_volume () const |
Virtual downcast method. More... | |
virtual const GeometricBoundingVolume * | as_geometric_bounding_volume () const |
Virtual downcast method. More... | |
int | contains (const BoundingVolume *vol) const |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated volume. More... | |
bool | extend_by (const BoundingVolume *vol) |
Increases the size of the volume to include the given volume. More... | |
virtual TypeHandle | force_init_type () |
virtual TypeHandle | get_type () const |
bool | is_empty () const |
Any kind of volume might be empty. More... | |
bool | is_infinite () const |
The other side of the empty coin is an infinite volume. More... | |
virtual BoundingVolume * | make_copy () const =0 |
virtual void | output (ostream &out) const =0 |
void | set_infinite () |
Marks the volume as infinite, even if it is normally finite. More... | |
virtual void | write (ostream &out, int indent_level=0) const |
![]() | |
TypedReferenceCount (const TypedReferenceCount ©) | |
void | operator= (const TypedReferenceCount ©) |
![]() | |
TypedObject (const TypedObject ©) | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
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. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
void | operator= (const TypedObject ©) |
![]() | |
int | get_ref_count () const |
Returns the current reference count. More... | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static BoundsType | string_bounds_type (const string &str) |
Returns the BoundsType corresponding to the indicated string. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
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. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
Friends | |
class | BoundingBox |
class | BoundingHexahedron |
class | BoundingLine |
class | BoundingPlane |
class | BoundingSphere |
class | IntersectionBoundingVolume |
class | UnionBoundingVolume |
This is an abstract class for any volume in any sense which can be said to define the locality of reference of a node in a graph, along with all of its descendants.
It is not necessarily a geometric volume (although see GeometricBoundingVolume); this is simply an abstract interface for bounds of any sort.
Definition at line 45 of file boundingVolume.h.
bool BoundingVolume::around | ( | const BoundingVolume ** | first, |
const BoundingVolume ** | last | ||
) |
Resets the volume to enclose only the volumes indicated.
Returns true if successful, false if the volume doesn't know how to do that or can't do that.
Definition at line 39 of file boundingVolume.cxx.
References as_geometric_bounding_volume(), and is_empty().
Referenced by GeometricBoundingVolume::around(), and PandaNode::r_prepare_scene().
|
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 in BoundingBox.
Definition at line 131 of file boundingVolume.cxx.
References as_bounding_hexahedron().
Referenced by as_bounding_sphere(), and PandaNode::r_prepare_scene().
|
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 in BoundingHexahedron.
Definition at line 143 of file boundingVolume.cxx.
References as_bounding_line().
Referenced by as_bounding_box().
|
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 in BoundingLine.
Definition at line 155 of file boundingVolume.cxx.
References as_bounding_plane().
Referenced by as_bounding_hexahedron().
|
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 in BoundingPlane.
Definition at line 167 of file boundingVolume.cxx.
References string_bounds_type().
Referenced by as_bounding_line().
|
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 in BoundingSphere.
Definition at line 119 of file boundingVolume.cxx.
References as_bounding_box().
Referenced by as_finite_bounding_volume().
|
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 in FiniteBoundingVolume.
Definition at line 107 of file boundingVolume.cxx.
References as_bounding_sphere().
Referenced by as_geometric_bounding_volume().
|
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 in GeometricBoundingVolume.
Definition at line 95 of file boundingVolume.cxx.
References as_finite_bounding_volume().
Referenced by around().
|
inline |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated volume.
Definition at line 101 of file boundingVolume.I.
References is_empty(), and is_infinite().
Referenced by IntersectionBoundingVolume::add_component(), GeometricBoundingVolume::contains(), extend_by(), and UnionBoundingVolume::filter_intersection().
|
inline |
Increases the size of the volume to include the given volume.
Definition at line 79 of file boundingVolume.I.
References contains(), is_empty(), is_infinite(), and set_infinite().
Referenced by GeometricBoundingVolume::extend_by(), and set_infinite().
|
inline |
Any kind of volume might be empty.
This is a degenerate volume that contains no points; it's not the same as, for instance, a sphere with radius zero, since that contains one point (the center). It intersects with no other volumes.
Definition at line 35 of file boundingVolume.I.
References is_infinite().
Referenced by UnionBoundingVolume::add_component(), IntersectionBoundingVolume::add_component(), around(), BoundingBox::as_bounding_box(), BoundingHexahedron::as_bounding_hexahedron(), BoundingLine::as_bounding_line(), BoundingPlane::as_bounding_plane(), BoundingSphere::as_bounding_sphere(), BoundingPlane::BoundingPlane(), BoundingSphere::BoundingSphere(), SceneGraphReducer::check_live_flatten(), GeometricBoundingVolume::contains(), contains(), CullTraverser::draw_bounding_volume(), extend_by(), BoundingBox::get_maxq(), BoundingBox::get_minq(), BoundingLine::get_point_a(), BoundingLine::get_point_b(), PipeOcclusionCullTraverser::get_texture(), and PandaNode::r_prepare_scene().
|
inline |
The other side of the empty coin is an infinite volume.
This is a degenerate state of a normally finite volume that contains all points. (Note that some kinds of infinite bounding volumes, like binary separating planes, do not contain all points and thus correctly return is_infinite() == false, even though they are technically infinite. This is a special case of the word 'infinite' meaning the volume covers all points in space.)
It completely intersects with all other volumes except empty volumes.
Definition at line 56 of file boundingVolume.I.
References set_infinite().
Referenced by UnionBoundingVolume::add_component(), IntersectionBoundingVolume::add_component(), BoundingBox::as_bounding_box(), BoundingHexahedron::as_bounding_hexahedron(), BoundingLine::as_bounding_line(), BoundingPlane::as_bounding_plane(), BoundingSphere::as_bounding_sphere(), BoundingPlane::BoundingPlane(), BoundingSphere::BoundingSphere(), SceneGraphReducer::check_live_flatten(), contains(), CullTraverser::draw_bounding_volume(), extend_by(), BoundingBox::get_maxq(), BoundingBox::get_minq(), BoundingLine::get_point_a(), BoundingLine::get_point_b(), PipeOcclusionCullTraverser::get_texture(), is_empty(), and LODNode::verify_child_bounds().
|
inline |
Marks the volume as infinite, even if it is normally finite.
You can think of this as an infinite extend_by() operation.
Definition at line 68 of file boundingVolume.I.
References extend_by().
Referenced by BoundingSphere::as_bounding_sphere(), extend_by(), and is_infinite().
|
static |
Returns the BoundsType corresponding to the indicated string.
Definition at line 178 of file boundingVolume.cxx.
Referenced by as_bounding_plane().