1 // Copyright (C) 2008 - 2012 Mathias Froehlich - Mathias.Froehlich@web.de
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Library General Public
5 // License as published by the Free Software Foundation; either
6 // version 2 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #ifndef BVHPageNodeOSG_hxx
19 #define BVHPageNodeOSG_hxx
21 #include "../../bvh/BVHPageNode.hxx"
23 #include <osg/ref_ptr>
24 #include <osg/Referenced>
28 class BVHPageNodeOSG : public BVHPageNode {
30 BVHPageNodeOSG(const std::string& name, const SGSphered& boundingSphere,
31 const osg::ref_ptr<const osg::Referenced>& options);
32 BVHPageNodeOSG(const std::vector<std::string>& nameList,
33 const SGSphered& boundingSphere,
34 const osg::ref_ptr<const osg::Referenced>& options);
35 virtual ~BVHPageNodeOSG();
37 virtual BVHPageRequest* newRequest();
39 void setBoundingSphere(const SGSphered& sphere);
41 static SGSharedPtr<BVHNode>
42 load(const std::string& name, const osg::ref_ptr<const osg::Referenced>& options);
45 virtual SGSphered computeBoundingSphere() const;
46 virtual void invalidateBound();
52 /// The submodels apropriate for intersection tests.
53 std::vector<std::string> _modelList;
54 /// The bounding sphere as given by the lod node.
55 SGSphered _boundingSphere;
56 /// The osg loader options that are active for this subtree
57 osg::ref_ptr<const osg::Referenced> _options;