diff --git a/src/osgPlugins/obj/obj.cpp b/src/osgPlugins/obj/obj.cpp index 9a2ce62e0..354e46d83 100644 --- a/src/osgPlugins/obj/obj.cpp +++ b/src/osgPlugins/obj/obj.cpp @@ -11,6 +11,7 @@ * OpenSceneGraph Public License for more details. */ +#include #include #include @@ -283,6 +284,17 @@ bool Model::readMTL(std::istream& fin) return true; } +std::string trim(const std::string& s) +{ + if(s.length() == 0) + return s; + int b = s.find_first_not_of(" \t"); + int e = s.find_last_not_of(" \t"); + if(b == -1) // No non-spaces + return ""; + return std::string(s, b, e - b + 1); +} + bool Model::readOBJ(std::istream& fin, const osgDB::ReaderWriter::Options* options) { osg::notify(osg::INFO)<<"Reading OBJ file"<