+bool Scene::frustum_cull(const Renderable &renderable) const
+{
+ const Matrix *matrix = renderable.get_matrix();
+ const Geometry::BoundingSphere<float, 3> *bsphere = renderable.get_bounding_sphere();
+ if(!matrix || !bsphere)
+ return false;
+
+ Vector4 center = culling_matrix*(*matrix*compose(bsphere->get_center(), 1.0f));
+ Vector4 x_axis = *matrix*Vector4(bsphere->get_radius(), 0.0f, 0.0f, 0.0f);
+ float radius_sq = inner_product(x_axis, x_axis);
+
+ for(unsigned i=0; i<6; ++i)
+ {
+ float distance = inner_product(center, frustum_edges[i]);
+ if(distance>0 && distance*distance>radius_sq)
+ return true;
+ }
+
+ return false;
+}
+
+
+Scene::Loader::Loader(Scene &s, Collection &c):
+ DataFile::CollectionObjectLoader<Scene>(s, &c)