| From b350bad4d772bdb062e63221adaf69da7d0cd720 Mon Sep 17 00:00:00 2001 |
| From: "Konstantin S. Matveyev" <root@zorro.ev> |
| Date: Tue, 28 Nov 2017 12:18:01 +0300 |
| Subject: [PATCH] [*] Compilation fixed for OpenSceneGraph 3.5.9 |
| |
| --- |
| src/osgwTools/GeometryModifier.cpp | 4 ++++ |
| src/osgwTools/Orientation.cpp | 11 +++++++++++ |
| 2 files changed, 15 insertions(+) |
| |
| diff --git a/src/osgwTools/GeometryModifier.cpp b/src/osgwTools/GeometryModifier.cpp |
| index 1202703..d988d33 100644 |
| --- a/src/osgwTools/GeometryModifier.cpp |
| +++ b/src/osgwTools/GeometryModifier.cpp |
| @@ -61,7 +61,11 @@ GeometryModifier::apply( osg::Geode& geode ) |
| { |
| osgUtil::Optimizer::MergeGeometryVisitor mgv; |
| mgv.setTargetMaximumNumberOfVertices(1000000); |
| +#if OSG_VERSION_LESS_OR_EQUAL(3, 5, 0) |
| mgv.mergeGeode(geode); |
| +#else |
| + mgv.mergeGroup(geode); |
| +#endif |
| } |
| |
| for(unsigned int i=0;i<geode.getNumDrawables();++i) |
| diff --git a/src/osgwTools/Orientation.cpp b/src/osgwTools/Orientation.cpp |
| index 7588b4d..bd15c6f 100644 |
| --- a/src/osgwTools/Orientation.cpp |
| +++ b/src/osgwTools/Orientation.cpp |
| @@ -21,6 +21,7 @@ |
| #include "osgwTools/Orientation.h" |
| #include <osg/Quat> |
| #include <osg/Matrix> |
| +#include <osg/Version> |
| #include <osg/Vec3> |
| |
| #include <osg/Notify> |
| @@ -169,14 +170,24 @@ void Orientation::makeMatrix( osg::Matrix& result, const double yaw, const doubl |
| |
| osg::Vec3d Orientation::getYPR( const osg::Quat& q ) const |
| { |
| +#if OSG_VERSION_LESS_OR_EQUAL(3, 5, 0) |
| osg::Matrix m; |
| m.set( q ); |
| +#else |
| + osg::Matrix m(q); |
| +#endif |
| + |
| return( getYPR( m ) ); |
| } |
| void Orientation::getYPR( const osg::Quat& q, double& yaw, double& pitch, double& roll ) const |
| { |
| +#if OSG_VERSION_LESS_OR_EQUAL(3, 5, 0) |
| osg::Matrix m; |
| m.set( q ); |
| +#else |
| + osg::Matrix m(q); |
| +#endif |
| + |
| getYPR( m, yaw, pitch, roll ); |
| } |
| osg::Vec3d Orientation::getYPR( const osg::Matrix& m ) const |