00001 /* -*-c++-*- 00002 * 00003 * Copyright (C) 2006-2007 Mathias Froehlich 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License as 00007 * published by the Free Software Foundation; either version 2 of the 00008 * License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00018 * MA 02110-1301, USA. 00019 * 00020 */ 00021 00022 #ifndef SG_ENLARGE_BOUNDING_BOX_HXX 00023 #define SG_ENLARGE_BOUNDING_BOX_HXX 00024 00025 #include <osg/Drawable> 00026 00027 // Helper class to enlarge a bounding box of a drawable. 00028 // Is usefull to enlarge the mounding box of single point lights that would 00029 // be victim to small feature culling otherwise. 00030 class SGEnlargeBoundingBox : public osg::Drawable::ComputeBoundingBoxCallback { 00031 public: 00032 SGEnlargeBoundingBox(float offset = 0); 00033 SGEnlargeBoundingBox(const SGEnlargeBoundingBox& cb, const osg::CopyOp&); 00034 META_Object(osg, SGEnlargeBoundingBox); 00035 virtual osg::BoundingBox computeBound(const osg::Drawable& drawable) const; 00036 00037 private: 00038 float _offset; 00039 }; 00040 00041 #endif