Changeset 13041 for OpenSceneGraph/trunk/include/osg/BoundingBox
 Timestamp:
 03/21/12 18:36:20 (2 years ago)
 Files:

 1 modified
Legend:
 Unmodified
 Added
 Removed

OpenSceneGraph/trunk/include/osg/BoundingBox
r9762 r13041 1 /* *c++* OpenSceneGraph  Copyright (C) 19982006 Robert Osfield 1 /* *c++* OpenSceneGraph  Copyright (C) 19982006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 36 36 typedef VT vec_type; 37 37 typedef typename VT::value_type value_type; 38 38 39 39 /** Minimum extent. (Smallest X, Y, and Z values of all coordinates.) */ 40 40 vec_type _min; … … 51 51 FLT_MAX) 52 52 {} 53 53 54 54 /** Creates a bounding box initialized to the given extents. */ 55 55 inline BoundingBoxImpl(value_type xmin, value_type ymin, value_type zmin, … … 59 59 60 60 /** Creates a bounding box initialized to the given extents. */ 61 inline BoundingBoxImpl(const vec_type& min,const vec_type& max) : 61 inline BoundingBoxImpl(const vec_type& min,const vec_type& max) : 62 62 _min(min), 63 63 _max(max) {} … … 73 73 FLT_MAX); 74 74 } 75 76 /** Returns true if the bounding box extents are valid, false otherwise. */ 75 76 /** Returns true if the bounding box extents are valid, false otherwise. */ 77 77 inline bool valid() const 78 78 { … … 98 98 inline value_type& xMin() { return _min.x(); } 99 99 inline value_type xMin() const { return _min.x(); } 100 100 101 101 inline value_type& yMin() { return _min.y(); } 102 102 inline value_type yMin() const { return _min.y(); } 103 103 104 104 inline value_type& zMin() { return _min.z(); } 105 105 inline value_type zMin() const { return _min.z(); } … … 107 107 inline value_type& xMax() { return _max.x(); } 108 108 inline value_type xMax() const { return _max.x(); } 109 109 110 110 inline value_type& yMax() { return _max.y(); } 111 111 inline value_type yMax() const { return _max.y(); } 112 112 113 113 inline value_type& zMax() { return _max.z(); } 114 114 inline value_type zMax() const { return _max.z(); } … … 203 203 if(sh._center.z()+sh._radius>_max.z()) _max.z() = sh._center.z()+sh._radius; 204 204 } 205 205 206 206 207 207 /** Returns the intersection of this bounding box and the specified bounding box. */ … … 223 223 inline bool contains(const vec_type& v) const 224 224 { 225 return valid() && 225 return valid() && 226 226 (v.x()>=_min.x() && v.x()<=_max.x()) && 227 227 (v.y()>=_min.y() && v.y()<=_max.y()) &&