Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/Source Code/Graphs/Headers/SceneGraphNode.h

Diff revisions: vs.
  @@ -30,11 +30,13 @@
30 30
31 31 class Transform;
32 32 class SceneGraph;
33 + class SceneState;
33 34 class SceneRoot : public SceneNode{
34 35 public:
35 36 SceneRoot() : SceneNode("root",TYPE_ROOT)
36 37 {
37 38 _renderState.useDefaultMaterial(false);
39 + setState(RES_LOADED);
38 40 }
39 41
40 42 void render(SceneGraphNode* const sgn) {return;}
  @@ -43,7 +45,7 @@
43 45 void updateTransform(SceneGraphNode* const sgn) {return;}
44 46 bool unload() {return true;}
45 47 bool load(const std::string& name) {return true;}
46 - bool computeBoundingBox(SceneGraphNode* const sgn) {return true;}
48 + bool computeBoundingBox(SceneGraphNode* const sgn);
47 49
48 50 };
49 51
  @@ -73,11 +75,11 @@
73 75 /// Position, rotation, scale updates
74 76 void updateTransforms();
75 77 /// Apply current transform to the node's BB
76 - void updateBoundingBoxTransform();
78 + void updateBoundingBoxTransform(const mat4<F32>& transform);
77 79 /// Culling and visibility checks
78 80 void updateVisualInformation();
79 81 /// Called from SceneGraph "sceneUpdate"
80 - void sceneUpdate(const U32 sceneTime);
82 + void sceneUpdate(const U32 sceneTime, SceneState& sceneState);
81 83 /*Node Management*/
82 84 template<class T>
83 85 ///Always use the level of redirection needed to reduce virtual function overhead
  @@ -92,6 +94,10 @@
92 94 ///Find the graph node whom's bounding box intersects the given ray
93 95 SceneGraphNode* Intersect(const Ray& ray, F32 start, F32 end);
94 96
97 + ///Selection helper functions
98 + void setSelected(const bool state);
99 + inline bool isSelected() const {return _selected;}
100 +
95 101 const std::string& getName() const {return _name;}
96 102 /*Node Management*/
97 103
  @@ -115,6 +121,7 @@
115 121 _boundingBox = box;
116 122 }
117 123
124 + const BoundingBox& getBoundingBoxTransformed();
118 125 inline BoundingBox& getBoundingBox() {ReadLock r_lock(_queryLock); return _boundingBox;}
119 126 inline const BoundingBox& getInitialBoundingBox() {ReadLock r_lock(_queryLock); return _initialBoundingBox;}
120 127
  @@ -170,10 +177,12 @@
170 177 NodeChildren _children;
171 178 SceneGraphNode *_parent, *_grandParent;
172 179 SceneGraph *_sceneGraph;
173 -
180 + // keep track of the scene state
181 + SceneState* _currentSceneState;
174 182 boost::atomic<bool> _active;
175 183 //Used to skip certain BB's (sky, ligts, etc);
176 184 U32 _bbAddExclusionList;
185 + bool _selected;
177 186 bool _wasActive;
178 187 bool _noDefaultTransform;
179 188 bool _inView;