- aabb_.min = Vector3(-1.0, -1.0, -1.0);
- aabb_.max = Vector3(1.0, 1.0, 1.0);
- sphere_.init(Vector3(0.0, 0.0, 0.0), 1.41421);
- }
+ std::list<InsertableP> objects;
+
+ Node(const Aabb<3>& aabb)
+ {
+ mAabb = aabb;
+ mSphere.point = mAabb.getCenter();
+ mSphere.radius = (mAabb.min - mSphere.point).length();
+ }
+
+ void draw(Scalar alpha) const
+ {
+ mAabb.draw(alpha);
+ }
+
+ void printSize()
+ {
+ logDebug << "size of node " << objects.size() << std::endl;
+ }
+
+ void getAll(std::list<InsertableP>& insertables) const
+ {
+ insertables.insert(insertables.end(), objects.begin(),
+ objects.end());
+ }
+
+ void getIfVisible(std::list<InsertableP>& insertables,
+ const Frustum& frustum) const
+ {
+ typename std::list<InsertableP>::const_iterator it;
+
+ for (it = objects.begin(); it != objects.end(); ++it)
+ {
+ if ((*it)->isVisible(frustum)) insertables.push_back(*it);
+ }
+ }
+ };
+
+
+public:
+
+ typedef boost::shared_ptr<Octree> Ptr;
+ typedef typename stlplus::ntree<Node>::iterator NodeP;
+
+private: