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 #include "pvector.h"
00028
00029 class PandaNode;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 class EXPCL_PANDA_PGRAPH CullTraverserData {
00046 public:
00047 INLINE CullTraverserData(const NodePath &start,
00048 const TransformState *net_transform,
00049 const RenderState *state,
00050 GeometricBoundingVolume *view_frustum,
00051 Thread *current_thread);
00052 INLINE CullTraverserData(const CullTraverserData ©);
00053 INLINE void operator = (const CullTraverserData ©);
00054 INLINE CullTraverserData(const CullTraverserData &parent,
00055 PandaNode *child);
00056 INLINE ~CullTraverserData();
00057
00058 PUBLISHED:
00059 INLINE PandaNode *node() const;
00060
00061 public:
00062 INLINE PandaNodePipelineReader *node_reader();
00063 INLINE const PandaNodePipelineReader *node_reader() const;
00064
00065 PUBLISHED:
00066 CPT(TransformState) get_modelview_transform(const CullTraverser *trav) const;
00067 INLINE const TransformState *get_net_transform(const CullTraverser *trav) const;
00068
00069 INLINE bool is_in_view(const DrawMask &camera_mask);
00070 INLINE bool is_this_node_hidden(const CullTraverser *trav) const;
00071
00072 void apply_transform_and_state(CullTraverser *trav);
00073 void apply_transform_and_state(CullTraverser *trav,
00074 CPT(TransformState) node_transform,
00075 CPT(RenderState) node_state,
00076 CPT(RenderEffects) node_effects,
00077 const RenderAttrib *off_clip_planes);
00078
00079 public:
00080 WorkingNodePath _node_path;
00081 PandaNodePipelineReader _node_reader;
00082 CPT(TransformState) _net_transform;
00083 CPT(RenderState) _state;
00084 PT(GeometricBoundingVolume) _view_frustum;
00085 CPT(CullPlanes) _cull_planes;
00086 DrawMask _draw_mask;
00087 int _portal_depth;
00088
00089 private:
00090 bool is_in_view_impl();
00091 static CPT(RenderState) get_fake_view_frustum_cull_state();
00092 };
00093
00094 #include "cullTraverserData.I"
00095
00096 #endif