Added support for readNode(istream,Options*) into OBJ to allow loading

over the internet
This commit is contained in:
Robert Osfield
2004-10-06 13:09:35 +00:00
parent 976140f1d7
commit 024044094e

View File

@@ -55,8 +55,9 @@ public:
return osgDB::equalCaseInsensitive(extension,"obj");
}
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*);
virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options* options);
virtual ReadResult readNode(std::istream& fin, const Options* options);
protected:
@@ -459,3 +460,16 @@ osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(const std::string& fil
return ReadResult::FILE_NOT_HANDLED;
}
osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(std::istream& fin, const Options*)
{
if (fin)
{
obj::Model model;
model.readOBJ(fin);
osg::Node* node = convertModelToSceneGraph(model);
return node;
}
return ReadResult::FILE_NOT_HANDLED;
}