#include <boundedObject.h>
Inheritance diagram for BoundedObject:
Public Types | |
enum | BoundingVolumeType { BVT_static, BVT_dynamic_sphere } |
Public Member Functions | |
BoundedObject () | |
BoundedObject (const BoundedObject ©) | |
void | operator= (const BoundedObject ©) |
virtual | ~BoundedObject () |
void | set_bound (BoundingVolumeType type) |
Sets the type of the bounding volume that will be dynamically computed for this particular node. | |
void | set_bound (const BoundingVolume &volume) |
Explicitly sets a new bounding volume on this node. | |
const BoundingVolume & | get_bound () const |
Returns the current bounding volume on this node, possibly forcing a recompute. | |
bool | mark_bound_stale () |
Marks the current bounding volume as stale, so that it will be recomputed later. | |
void | force_bound_stale () |
Marks the current volume as stale and propagates the effect at least one level, even if it had already been marked stale. | |
bool | is_bound_stale () const |
Returns true if the bound is currently marked stale and will be recomputed the next time get_bound() is called. | |
void | set_final (bool flag) |
Sets the "final" flag on this BoundedObject. | |
bool | is_final () const |
Returns the current state of the "final" flag. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Protected Member Functions | |
virtual void | propagate_stale_bound () |
Called by BoundedObject::mark_bound_stale(), this should make sure that all bounding volumes that depend on this one are marked stale also. | |
virtual BoundingVolume * | recompute_bound () |
Recomputes the dynamic bounding volume for this object. | |
const BoundingVolume * | get_bound_ptr () const |
Returns the state of the _bound pointer. | |
BoundingVolume * | set_bound_ptr (BoundingVolume *bound) |
Changes the _bound pointer. | |
Private Types | |
typedef CycleDataReader< CData > | CDReader |
typedef CycleDataWriter< CData > | CDWriter |
enum | Flags { F_bound_stale = 0x0001, F_final = 0x0002 } |
Private Attributes | |
PipelineCycler< CData > | _cycler |
Static Private Attributes | |
TypeHandle | _type_handle |
Friends | |
class | PandaNode |
class | CData |
The user may set a fixed bounding volume, or s/he may specify that the volume should be recomputed dynamically.
Definition at line 50 of file boundedObject.h.
|
Reimplemented in RopeNode, DirectionalLight, GeomNode, LODNode, PandaNode, PlaneNode, PointLight, SequenceNode, Spotlight, and SwitchNode. Definition at line 102 of file boundedObject.h. |
|
Reimplemented in RopeNode, DirectionalLight, GeomNode, LODNode, PandaNode, PlaneNode, PointLight, SequenceNode, Spotlight, and SwitchNode. Definition at line 103 of file boundedObject.h. |
|
Definition at line 58 of file boundedObject.h. |
|
Reimplemented in CollisionNode, PGItem, and TextNode. Definition at line 82 of file boundedObject.h. |
|
Definition at line 74 of file boundedObject.I. |
|
Definition at line 85 of file boundedObject.I. |
|
Definition at line 37 of file boundedObject.cxx. References _cycler, BVT_static, F_bound_stale, is_bound_stale(), and NULL. |
|
Marks the current volume as stale and propagates the effect at least one level, even if it had already been marked stale.
Definition at line 188 of file boundedObject.I. References _cycler, F_final, and INLINE. Referenced by PandaNode::remove_child(). |
|
Returns the current bounding volume on this node, possibly forcing a recompute. A node's bounding volume encloses only the node itself, irrespective of the nodes above or below it in the graph. This is different from the bounding volumes on the arcs, which enclose all geometry below them. Reimplemented in PandaNode. Definition at line 59 of file boundedObject.cxx. Referenced by PandaNode::clear_effect(), PandaNode::get_state(), and CollisionLevelState::reserve(). |
|
Returns the state of the _bound pointer. To be used only internally by derived classes. This returns a const pointer only; the bounding volume should not be modified directly, because that might interfere with pipelining. Instead, create a new copy with make_copy(), modify the copy, and set_bound_ptr() with the copy. Alternatively, if you have just called recompute_bound(), which is guaranteed to reset the pointer, just use the return value from that as a non-const BoundingVolume pointer. Definition at line 318 of file boundedObject.I. |
|
Reimplemented in AnimBundleNode, PartBundleNode, Character, CollisionNode, CollisionPlane, CollisionPolygon, CollisionRay, CollisionSegment, CollisionSolid, CollisionSphere, AnalogNode, ButtonNode, DialNode, MouseAndKeyboard, TrackerNode, VirtualMouse, DataNode, ProjectionScreen, dDrawable, Geom, GeomLine, GeomLinestrip, GeomPoint, GeomPolygon, GeomQuad, GeomSphere, GeomSprite, GeomTri, GeomTrifan, GeomTristrip, ClassicNurbsCurve, CubicCurveseg, HermiteCurve, NurbsPPCurve, ParametricCurve, PiecewiseCurve, RopeNode, AmbientLight, Camera, DirectionalLight, Fog, GeomNode, LensNode, LightLensNode, LightNode, LODNode, ModelNode, ModelRoot, PandaNode, PlaneNode, PointLight, SelectiveChildNode, SequenceNode, Spotlight, SwitchNode, PGButton, PGEntry, PGItem, PGTop, PGWaitBar, ActorNode, ForceNode, PhysicalNode, TextNode, ButtonThrower, DriveInterface, MouseWatcher, Trackball, and Transform2SG. Definition at line 106 of file boundedObject.h. Referenced by dDrawable::init_type(). |
|
Reimplemented in AnimBundleNode, PartBundleNode, Character, CollisionNode, CollisionPlane, CollisionPolygon, CollisionRay, CollisionSegment, CollisionSolid, CollisionSphere, AnalogNode, ButtonNode, DialNode, MouseAndKeyboard, TrackerNode, VirtualMouse, DataNode, ProjectionScreen, dDrawable, Geom, GeomLine, GeomLinestrip, GeomPoint, GeomPolygon, GeomQuad, GeomSphere, GeomSprite, GeomTri, GeomTrifan, GeomTristrip, ClassicNurbsCurve, CubicCurveseg, HermiteCurve, NurbsPPCurve, ParametricCurve, PiecewiseCurve, RopeNode, AmbientLight, Camera, DirectionalLight, Fog, GeomNode, LensNode, LightLensNode, LightNode, LODNode, ModelNode, ModelRoot, PandaNode, PlaneNode, PointLight, SelectiveChildNode, SequenceNode, Spotlight, SwitchNode, PGButton, PGEntry, PGItem, PGTop, PGWaitBar, ActorNode, ForceNode, PhysicalNode, TextNode, ButtonThrower, DriveInterface, MouseWatcher, Trackball, and Transform2SG. Definition at line 109 of file boundedObject.h. Referenced by dDrawable::init_type(). |
|
Returns true if the bound is currently marked stale and will be recomputed the next time get_bound() is called. This function is defined up at the top of this file, because several of the inline functions below reference it. Definition at line 217 of file boundedObject.I. References _cycler, and INLINE. Referenced by ~BoundedObject(). |
|
Returns the current state of the "final" flag. Initially, this flag is off (false), but it may be changed by an explicit call to set_final(). See set_final(). Definition at line 280 of file boundedObject.I. |
|
Marks the current bounding volume as stale, so that it will be recomputed later. This may have a cascading effect up to the root of all graphs of which the node is a part. Returns true if the setting was changed, or false if it was already marked stale (or if it is a static bounding volume). Definition at line 162 of file boundedObject.I. References _cycler, F_bound_stale, and INLINE. Referenced by CollisionSphere::CollisionSphere(), GeomNode::combine_with(), CollisionPlane::get_normal(), PGItem::instance_to_state_def(), CollisionPlane::make_copy(), PGItem::set_active(), CollisionSphere::set_center(), TextNode::set_coordinate_system(), PandaNode::set_effect(), CollisionNode::set_from_collide_mask(), GeomNode::set_geom_state(), CollisionRay::set_origin(), CollisionSegment::set_point_a(), CollisionSphere::test_intersection(), CollisionSegment::test_intersection(), CollisionRay::test_intersection(), and CollisionNode::xform(). |
|
Definition at line 98 of file boundedObject.I. |
|
Called by BoundedObject::mark_bound_stale(), this should make sure that all bounding volumes that depend on this one are marked stale also.
Reimplemented in dDrawable, and PandaNode. Definition at line 108 of file boundedObject.cxx. |
|
Recomputes the dynamic bounding volume for this object. The default behavior is the compute an empty bounding volume; this may be overridden to extend it to create a nonempty bounding volume. However, after calling this function, it is guaranteed that the _bound pointer will not be shared with any other stage of the pipeline, and this new pointer is returned. Reimplemented in CollisionNode, CollisionPlane, CollisionPolygon, CollisionRay, CollisionSegment, CollisionSphere, Geom, and PandaNode. Definition at line 134 of file boundedObject.cxx. Referenced by CollisionSphere::get_collision_origin(). |
|
Explicitly sets a new bounding volume on this node. This will be a static bounding volume that will no longer be recomputed automatically. Reimplemented in PandaNode. Definition at line 135 of file boundedObject.I. References F_bound_stale. |
|
Sets the type of the bounding volume that will be dynamically computed for this particular node. Presently, this should only be BVT_dynamic_sphere. Definition at line 115 of file boundedObject.I. |
|
Changes the _bound pointer. To be used only internally by derived classes, usually in recompute_bound(). The return value is the same pointer passed in, as a convenience (it will now be reference counted). Definition at line 340 of file boundedObject.I. |
|
Sets the "final" flag on this BoundedObject. If this is true, than no bounding volume need be tested below it; a positive intersection with this bounding volume is deemed to be a positive intersection with all geometry inside. This is useful to quickly force a larger bounding volume around a node when the GeomNodes themselves are inaccurate for some reason, without forcing a recompute of every nested bounding volume. It's also helpful when the bounding volume is tricked by some special properties, like billboards, that may move geometry out of its bounding volume otherwise. Definition at line 256 of file boundedObject.I. |
|
Definition at line 117 of file boundedObject.h. |
|
Definition at line 116 of file boundedObject.h. |
|
Reimplemented in RopeNode, DirectionalLight, GeomNode, LODNode, PandaNode, PlaneNode, PointLight, SequenceNode, Spotlight, and SwitchNode. Definition at line 101 of file boundedObject.h. Referenced by force_bound_stale(), is_bound_stale(), mark_bound_stale(), and ~BoundedObject(). |
|