Panda3D
 All Classes Functions Variables Enumerations
cullPlanes.h
1 // Filename: cullPlanes.h
2 // Created by: drose (23Aug05)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef CULLPLANES_H
16 #define CULLPLANES_H
17 
18 #include "pandabase.h"
19 #include "referenceCount.h"
20 #include "nodePath.h"
21 #include "boundingHexahedron.h"
22 #include "boundingPlane.h"
23 #include "pointerTo.h"
24 #include "luse.h"
25 #include "deletedChain.h"
26 
27 class ClipPlaneAttrib;
28 class OccluderEffect;
29 
30 ////////////////////////////////////////////////////////////////////
31 // Class : CullPlanes
32 // Description : This represents the set of clip planes and/or
33 // occluders that are definitely in effect for the
34 // current node of the CullTraverserData, as well as on
35 // all child nodes. Any clip planes and occluders in
36 // this list may be safely culled against.
37 //
38 // This does not include the clip planes that are in
39 // effect now, but might later be turned off by a child
40 // node, since we can't safely cull against such clip
41 // planes.
42 //
43 // The bounding volumes in this object are transformed
44 // for each level of the scene graph.
45 ////////////////////////////////////////////////////////////////////
46 class EXPCL_PANDA_PGRAPH CullPlanes : public ReferenceCount {
47 protected:
48  INLINE CullPlanes();
49  INLINE CullPlanes(const CullPlanes &copy);
50  INLINE void operator = (const CullPlanes &copy);
51 
52 public:
53  INLINE ~CullPlanes();
54  ALLOC_DELETED_CHAIN(CullPlanes);
55 
56  INLINE bool is_empty() const;
57 
58  static CPT(CullPlanes) make_empty();
59  CPT(CullPlanes) xform(const LMatrix4 &mat) const;
60  CPT(CullPlanes) apply_state(const CullTraverser *trav,
61  const CullTraverserData *data,
62  const ClipPlaneAttrib *net_attrib,
63  const ClipPlaneAttrib *off_attrib,
64  const OccluderEffect *node_effect) const;
65  CPT(CullPlanes) do_cull(int &result, CPT(RenderState) &state,
66  const GeometricBoundingVolume *node_gbv) const;
67 
68  CPT(CullPlanes) remove_plane(const NodePath &clip_plane) const;
69  CPT(CullPlanes) remove_occluder(const NodePath &occluder) const;
70 
71  void write(ostream &out) const;
72 
73 private:
75  Planes _planes;
76 
78  Occluders _occluders;
79 };
80 
81 #include "cullPlanes.I"
82 
83 #endif
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This functions similarly to a LightAttrib.
This represents the set of clip planes and/or occluders that are definitely in effect for the current...
Definition: cullPlanes.h:46
This is another abstract class, for a general class of bounding volumes that actually enclose points ...
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
This functions similarly to a LightAttrib or ClipPlaneAttrib.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:53
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:165
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...
Definition: cullTraverser.h:48