Changeset 4202 for OpenSceneGraph/trunk/examples/osgteapot/osgteapot.cpp
- Timestamp:
- 05/12/05 16:03:22 (8 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgteapot/osgteapot.cpp
r1844 r4202 227 227 228 228 229 protected:230 231 virtual ~Teapot() {}232 233 229 // we need to set up the bounding box of the data too, so that the scene graph knows where this 234 230 // objects is, for both positioning the camera at start up, and most importantly for culling. 235 virtual boolcomputeBound() const231 virtual osg::BoundingBox computeBound() const 236 232 { 237 _bbox.init();233 osg::BoundingBox bbox; 238 234 239 235 // follow is some truely horrible code required to calculate the … … 266 262 } 267 263 268 _bbox.expandBy(osg::Vec3(p[j][k][0],p[j][k][1],p[j][k][2]));269 _bbox.expandBy(osg::Vec3(q[j][k][0],q[j][k][1],q[j][k][2]));264 bbox.expandBy(osg::Vec3(p[j][k][0],p[j][k][1],p[j][k][2])); 265 bbox.expandBy(osg::Vec3(q[j][k][0],q[j][k][1],q[j][k][2])); 270 266 271 267 if (i < 6) 272 268 { 273 _bbox.expandBy(osg::Vec3(r[j][k][0],r[j][k][1],r[j][k][2]));274 _bbox.expandBy(osg::Vec3(s[j][k][0],s[j][k][1],s[j][k][2]));269 bbox.expandBy(osg::Vec3(r[j][k][0],r[j][k][1],r[j][k][2])); 270 bbox.expandBy(osg::Vec3(s[j][k][0],s[j][k][1],s[j][k][2])); 275 271 } 276 272 … … 280 276 } 281 277 282 _bbox_computed = true; 283 return true; 278 return bbox; 284 279 } 280 281 protected: 282 283 virtual ~Teapot() {} 284 285 285 }; 286 286
