Merge branch 'master' into text_improvements

This commit is contained in:
Robert Osfield
2017-10-20 14:14:14 +01:00
25 changed files with 622 additions and 138 deletions

View File

@@ -142,7 +142,8 @@ public:
protected:
struct ObjOptionsStruct {
class ObjOptionsStruct {
public:
bool rotate;
bool noTesselateLargePolygons;
bool noTriStripPolygons;
@@ -155,6 +156,17 @@ protected:
TextureAllocationMap textureUnitAllocation;
/// Coordinates precision.
int precision;
ObjOptionsStruct()
{
rotate = true;
noTesselateLargePolygons = false;
noTriStripPolygons = false;
generateFacetNormals = false;
fixBlackMaterials = true;
noReverseFaces = false;
precision = std::numeric_limits<double>::digits10 + 2;
}
};
typedef std::map< std::string, osg::ref_ptr<osg::StateSet> > MaterialToStateSetMap;
@@ -831,13 +843,6 @@ osg::Node* ReaderWriterOBJ::convertModelToSceneGraph(obj::Model& model, ObjOptio
ReaderWriterOBJ::ObjOptionsStruct ReaderWriterOBJ::parseOptions(const osgDB::ReaderWriter::Options* options) const
{
ObjOptionsStruct localOptions;
localOptions.rotate = true;
localOptions.noTesselateLargePolygons = false;
localOptions.noTriStripPolygons = false;
localOptions.generateFacetNormals = false;
localOptions.fixBlackMaterials = true;
localOptions.noReverseFaces = false;
localOptions.precision = std::numeric_limits<double>::digits10 + 2;
if (options!=NULL)
{

View File

@@ -546,7 +546,7 @@ osg::Node* VertexData::readPlyFile( const char* filename, const bool ignoreColor
}
else if (_texcoord.valid())
{
geom->setTexCoordArray(0, _texcoord);
geom->setTexCoordArray(0, _texcoord.get());
}
// If the model has normals, add them to the geometry