Panda3D
|
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple. More...
#include "boundingBox.h"
Public Member Functions | |
BoundingBox () | |
Constructs an empty box object. More... | |
BoundingBox (const LPoint3 &min, const LPoint3 &max) | |
Constructs a specific box object. More... | |
virtual const BoundingBox * | as_bounding_box () const |
Virtual downcast method. More... | |
virtual TypeHandle | force_init_type () |
virtual LPoint3 | get_approx_center () const |
virtual LPoint3 | get_max () const |
const LPoint3 & | get_maxq () const |
An inline accessor for the maximum value. More... | |
virtual LPoint3 | get_min () const |
const LPoint3 & | get_minq () const |
An inline accessor for the minimum value. More... | |
int | get_num_planes () const |
Returns 6: the number of faces of a rectangular solid. More... | |
int | get_num_points () const |
Returns 8: the number of vertices of a rectangular solid. More... | |
LPlane | get_plane (int n) const |
Returns the nth face of the rectangular solid. More... | |
LPoint3 | get_point (int n) const |
Returns the nth vertex of the rectangular solid. More... | |
virtual TypeHandle | get_type () const |
virtual PN_stdfloat | get_volume () const |
virtual BoundingVolume * | make_copy () const |
MAKE_SEQ (get_points, get_num_points, get_point) | |
MAKE_SEQ (get_planes, get_num_planes, get_plane) | |
virtual void | output (ostream &out) const |
virtual void | xform (const LMatrix4 &mat) |
![]() | |
virtual const FiniteBoundingVolume * | as_finite_bounding_volume () const |
Virtual downcast method. More... | |
![]() | |
bool | around (const GeometricBoundingVolume **first, const GeometricBoundingVolume **last) |
Resets the volume to enclose only the volumes indicated. More... | |
bool | around (const LPoint3 *first, const LPoint3 *last) |
Resets the volume to enclose only the points indicated. More... | |
virtual const GeometricBoundingVolume * | as_geometric_bounding_volume () const |
Virtual downcast method. More... | |
int | contains (const GeometricBoundingVolume *vol) const |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated volume. More... | |
int | contains (const LPoint3 &point) const |
Returns the appropriate set of IntersectionFlags to indicate the amount of intersection with the indicated point. More... | |
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. More... | |
bool | extend_by (const GeometricBoundingVolume *vol) |
Increases the size of the volume to include the given volume. More... | |
bool | extend_by (const LPoint3 &point) |
Increases the size of the volume to include the given point. More... | |
![]() | |
bool | around (const BoundingVolume **first, const BoundingVolume **last) |
Resets the volume to enclose only the volumes indicated. 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... | |
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... | |
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... | |
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 TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
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 | BoundingSphere |
Additional Inherited Members | |
![]() | |
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 } |
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple.
This box is always axis-aligned. If you need a more general bounding box, try BoundingHexahedron.
Definition at line 31 of file boundingBox.h.
|
inline |
Constructs an empty box object.
Definition at line 22 of file boundingBox.I.
Constructs a specific box object.
Definition at line 31 of file boundingBox.I.
References get_minq(), and LVecBase3f::is_nan().
|
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 147 of file boundingBox.cxx.
References get_maxq(), get_minq(), BoundingVolume::is_empty(), BoundingVolume::is_infinite(), and LVecBase3f::is_nan().
|
inline |
An inline accessor for the maximum value.
get_max() would also work, but it is a virtual non-inline method.
Definition at line 64 of file boundingBox.I.
References get_num_points(), BoundingVolume::is_empty(), and BoundingVolume::is_infinite().
Referenced by as_bounding_box(), BoundingHexahedron::as_bounding_hexahedron(), BoundingLine::as_bounding_line(), BoundingPlane::as_bounding_plane(), BoundingSphere::as_bounding_sphere(), get_minq(), and PipeOcclusionCullTraverser::get_texture().
|
inline |
An inline accessor for the minimum value.
get_min() would also work, but it is a virtual non-inline method.
Definition at line 50 of file boundingBox.I.
References get_maxq(), BoundingVolume::is_empty(), and BoundingVolume::is_infinite().
Referenced by as_bounding_box(), BoundingHexahedron::as_bounding_hexahedron(), BoundingLine::as_bounding_line(), BoundingPlane::as_bounding_plane(), BoundingSphere::as_bounding_sphere(), BoundingBox(), and PipeOcclusionCullTraverser::get_texture().
|
inline |
Returns 6: the number of faces of a rectangular solid.
Definition at line 101 of file boundingBox.I.
References get_plane().
Referenced by get_point().
|
inline |
Returns 8: the number of vertices of a rectangular solid.
Definition at line 76 of file boundingBox.I.
References get_point().
Referenced by get_maxq().
|
inline |
Returns the nth face of the rectangular solid.
Definition at line 111 of file boundingBox.I.
References get_point().
Referenced by get_num_planes().
|
inline |
Returns the nth vertex of the rectangular solid.
Definition at line 86 of file boundingBox.I.
References get_num_planes(), and LPoint3f::zero().
Referenced by BoundingHexahedron::as_bounding_hexahedron(), BoundingPlane::as_bounding_plane(), BoundingSphere::as_bounding_sphere(), get_num_points(), and get_plane().