diff --git a/cookbook/chapter2/ch02_03/bounding_box.cpp b/cookbook/chapter2/ch02_03/bounding_box.cpp index d81a896..ee5c0d9 100644 --- a/cookbook/chapter2/ch02_03/bounding_box.cpp +++ b/cookbook/chapter2/ch02_03/bounding_box.cpp @@ -97,5 +97,6 @@ int main( int argc, char** argv ) osgViewer::Viewer viewer; viewer.setSceneData( root.get() ); + return viewer.run(); } diff --git a/cookbook/chapter3/ch03_03/NurbsSurface b/cookbook/chapter3/ch03_03/NurbsSurface index 79659a3..ad239ef 100644 --- a/cookbook/chapter3/ch03_03/NurbsSurface +++ b/cookbook/chapter3/ch03_03/NurbsSurface @@ -7,6 +7,7 @@ #define H_COOKBOOK_CH3_NURBSSURFACE #include +#include class NurbsSurface : public osg::Drawable { @@ -43,8 +44,12 @@ public: void setOrders( int s, int t ) { _sOrder = s; _tOrder = t; } int getSOrder() const { return _sOrder; } int getTOrder() const { return _tOrder; } - + +#if OSG_VERSION_GREATER_THAN(3,2,1) + virtual osg::BoundingBox computeBoundingBox() const; +#else virtual osg::BoundingBox computeBound() const; +#endif virtual void drawImplementation( osg::RenderInfo& renderInfo ) const; diff --git a/cookbook/chapter3/ch03_03/NurbsSurface.cpp b/cookbook/chapter3/ch03_03/NurbsSurface.cpp index 91f62e4..71d290a 100644 --- a/cookbook/chapter3/ch03_03/NurbsSurface.cpp +++ b/cookbook/chapter3/ch03_03/NurbsSurface.cpp @@ -24,7 +24,11 @@ NurbsSurface::~NurbsSurface() { } +#if OSG_VERSION_GREATER_THAN(3,2,1) +osg::BoundingBox NurbsSurface::computeBoundingBox() const +#else osg::BoundingBox NurbsSurface::computeBound() const +#endif { osg::BoundingBox bb; if ( _vertices.valid() ) diff --git a/cookbook/chapter6/ch06_09/CloudBlock b/cookbook/chapter6/ch06_09/CloudBlock index 7015e72..4cf8f11 100644 --- a/cookbook/chapter6/ch06_09/CloudBlock +++ b/cookbook/chapter6/ch06_09/CloudBlock @@ -7,6 +7,7 @@ #define H_COOKBOOK_CH6_CLOUDBLOCK #include +#include class CloudBlock : public osg::Drawable { @@ -53,8 +54,13 @@ public: void setCloudCells( const CloudCells& cells ) { _cells = cells; dirtyBound(); } CloudCells& getCloudCells() { return _cells; } const CloudCells& getCloudCells() const { return _cells; } - + +#if OSG_VERSION_GREATER_THAN(3,2,1) + virtual osg::BoundingBox computeBoundingBox() const; +#else virtual osg::BoundingBox computeBound() const; +#endif + virtual void drawImplementation( osg::RenderInfo& renderInfo ) const; protected: diff --git a/cookbook/chapter6/ch06_09/CloudBlock.cpp b/cookbook/chapter6/ch06_09/CloudBlock.cpp index a57a0f5..30523bf 100644 --- a/cookbook/chapter6/ch06_09/CloudBlock.cpp +++ b/cookbook/chapter6/ch06_09/CloudBlock.cpp @@ -19,7 +19,11 @@ CloudBlock::CloudBlock( const CloudBlock& copy, const osg::CopyOp& copyop ) { } +#if OSG_VERSION_GREATER_THAN(3,2,1) +osg::BoundingBox CloudBlock::computeBoundingBox() const +#else osg::BoundingBox CloudBlock::computeBound() const +#endif { osg::BoundingBox bb; for ( CloudCells::const_iterator itr=_cells.begin(); itr!=_cells.end(); ++itr )