Panda3D
cullPlanes.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file cullPlanes.h
10  * @author drose
11  * @date 2005-08-23
12  */
13 
14 #ifndef CULLPLANES_H
15 #define CULLPLANES_H
16 
17 #include "pandabase.h"
18 #include "referenceCount.h"
19 #include "nodePath.h"
20 #include "boundingHexahedron.h"
21 #include "boundingPlane.h"
22 #include "pointerTo.h"
23 #include "luse.h"
24 #include "deletedChain.h"
25 
26 class ClipPlaneAttrib;
27 class OccluderEffect;
28 
29 /**
30  * This represents the set of clip planes and/or occluders that are definitely
31  * in effect for the current node of the CullTraverserData, as well as on all
32  * child nodes. Any clip planes and occluders in this list may be safely
33  * culled against.
34  *
35  * This does not include the clip planes that are in effect now, but might
36  * later be turned off by a child node, since we can't safely cull against
37  * such clip planes.
38  *
39  * The bounding volumes in this object are transformed for each level of the
40  * scene graph.
41  */
42 class EXPCL_PANDA_PGRAPH CullPlanes : public ReferenceCount {
43 protected:
44  INLINE CullPlanes();
45  INLINE CullPlanes(const CullPlanes &copy);
46  INLINE void operator = (const CullPlanes &copy);
47 
48 public:
49  INLINE ~CullPlanes();
50  ALLOC_DELETED_CHAIN(CullPlanes);
51 
52  INLINE bool is_empty() const;
53 
54  static CPT(CullPlanes) make_empty();
55  CPT(CullPlanes) xform(const LMatrix4 &mat) const;
56  CPT(CullPlanes) apply_state(const CullTraverser *trav,
57  const CullTraverserData *data,
58  const ClipPlaneAttrib *net_attrib,
59  const ClipPlaneAttrib *off_attrib,
60  const OccluderEffect *node_effect) const;
61  CPT(CullPlanes) do_cull(int &result, CPT(RenderState) &state,
62  const GeometricBoundingVolume *node_gbv) const;
63 
64  CPT(CullPlanes) remove_plane(const NodePath &clip_plane) const;
65  CPT(CullPlanes) remove_occluder(const NodePath &occluder) const;
66 
67  void write(std::ostream &out) const;
68 
69 private:
70  typedef pmap<NodePath, PT(BoundingPlane) > Planes;
71  Planes _planes;
72 
74  Occluders _occluders;
75 };
76 
77 // We can safely redefine this as a no-op.
78 template<>
79 INLINE void PointerToBase<CullPlanes>::update_type(To *ptr) {}
80 
81 #include "cullPlanes.I"
82 
83 #endif
This is our own Panda specialization on the default STL map.
Definition: pmap.h:49
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the base class for PointerTo and ConstPointerTo.
Definition: pointerToBase.h:29
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This functions similarly to a LightAttrib.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This represents the set of clip planes and/or occluders that are definitely in effect for the current...
Definition: cullPlanes.h:42
This funny bounding volume is an infinite plane that divides space into two regions: the part behind ...
Definition: boundingPlane.h:28
This is another abstract class, for a general class of bounding volumes that actually enclose points ...
This functions similarly to a LightAttrib or ClipPlaneAttrib.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:47
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for all things that want to be reference-counted.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
Definition: cullTraverser.h:45
This defines a bounding convex hexahedron.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.