Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 826 vs 827 for /trunk/Source Code/Graphs/Headers/SceneGraphNode.h

Diff revisions: vs.
  @@ -52,7 +52,8 @@
52 52 // This is the scene root node. All scene node's are added to it as child nodes
53 53 class SceneRoot : public SceneNode {
54 54 public:
55 - SceneRoot(ResourceCache& parentCache) : SceneNode(parentCache, "root", SceneNodeType::TYPE_ROOT)
55 + SceneRoot(ResourceCache& parentCache)
56 + : SceneNode(parentCache, "root", SceneNodeType::TYPE_ROOT)
56 57 {
57 58 _renderState.useDefaultMaterial(false);
58 59 setState(ResourceState::RES_LOADED);
  @@ -78,7 +79,10 @@
78 79 // to create complex transforms in the scene
79 80 class SceneTransform : public SceneNode {
80 81 public:
81 - SceneTransform(ResourceCache& parentCache) : SceneNode(parentCache, "TransformNode", SceneNodeType::TYPE_TRANSFORM) {
82 + SceneTransform(ResourceCache& parentCache, vec3<F32> extents)
83 + : SceneNode(parentCache, "TransformNode", SceneNodeType::TYPE_TRANSFORM),
84 + _extents(extents)
85 + {
82 86 _renderState.useDefaultMaterial(false);
83 87 setState(ResourceState::RES_LOADED);
84 88 }
  @@ -88,6 +92,14 @@
88 92 void postLoad(SceneGraphNode& sgn) { return; }
89 93 bool unload() { return true; }
90 94 bool load() override { return true; }
95 +
96 + inline void updateBoundsInternal(SceneGraphNode& sgn) override {
97 + _boundingBox.setMin(-_extents * 0.5f);
98 + _boundingBox.setMax( _extents * 0.5f);
99 + }
100 +
101 + protected:
102 + vec3<F32> _extents;
91 103 };
92 104
93 105 TYPEDEF_SMART_POINTERS_FOR_CLASS(SceneTransform);