00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CULLTRAVERSERDATA_H
00016 #define CULLTRAVERSERDATA_H
00017
00018 #include "pandabase.h"
00019 #include "cullPlanes.h"
00020 #include "workingNodePath.h"
00021 #include "renderState.h"
00022 #include "transformState.h"
00023 #include "geometricBoundingVolume.h"
00024 #include "pointerTo.h"
00025 #include "drawMask.h"
00026 #include "cullTraverser.h"
00027
00028 class PandaNode;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 class EXPCL_PANDA_PGRAPH CullTraverserData {
00045 public:
00046 INLINE CullTraverserData(const NodePath &start,
00047 const TransformState *net_transform,
00048 const RenderState *state,
00049 GeometricBoundingVolume *view_frustum,
00050 Thread *current_thread);
00051 INLINE CullTraverserData(const CullTraverserData ©);
00052 INLINE void operator = (const CullTraverserData ©);
00053 INLINE CullTraverserData(const CullTraverserData &parent,
00054 PandaNode *child);
00055 INLINE ~CullTraverserData();
00056
00057 PUBLISHED:
00058 INLINE PandaNode *node() const;
00059
00060 public:
00061 INLINE PandaNodePipelineReader *node_reader();
00062 INLINE const PandaNodePipelineReader *node_reader() const;
00063
00064 PUBLISHED:
00065 CPT(TransformState) get_modelview_transform(const CullTraverser *trav) const;
00066 INLINE const TransformState *get_net_transform(const CullTraverser *trav) const;
00067
00068 INLINE bool is_in_view(const DrawMask &camera_mask);
00069 INLINE bool is_this_node_hidden(const CullTraverser *trav) const;
00070
00071 void apply_transform_and_state(CullTraverser *trav);
00072 void apply_transform_and_state(CullTraverser *trav,
00073 CPT(TransformState) node_transform,
00074 CPT(RenderState) node_state,
00075 CPT(RenderEffects) node_effects,
00076 const RenderAttrib *off_clip_planes);
00077
00078 public:
00079 WorkingNodePath _node_path;
00080 PandaNodePipelineReader _node_reader;
00081 CPT(TransformState) _net_transform;
00082 CPT(RenderState) _state;
00083 PT(GeometricBoundingVolume) _view_frustum;
00084 CPT(CullPlanes) _cull_planes;
00085 DrawMask _draw_mask;
00086 int _portal_depth;
00087
00088 private:
00089 bool is_in_view_impl();
00090
00091 static CPT(RenderState) get_fake_view_frustum_cull_state();
00092 };
00093
00094 #include "cullTraverserData.I"
00095
00096 #endif