Changeset 9962

Show
Ignore:
Timestamp:
03/23/09 21:25:51 (6 years ago)
Author:
robert
Message:

From Aric Aumann, fixed handling of null texture coordinates

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/x/ReaderWriterDirectX.cpp

    r9527 r9962  
    156156    const DX::MeshTextureCoords* meshTexCoords = mesh.getMeshTextureCoords(); 
    157157    //std::cerr << "texcoord=" << meshTexCoords << std::endl; 
    158     if (!meshTexCoords) 
    159         return NULL; 
    160158 
    161159    /* 
     
    289287        osg::Vec3Array* vertexArray = (osg::Vec3Array*) geom->getVertexArray(); 
    290288        osg::Vec3Array* normalArray = (osg::Vec3Array*) geom->getNormalArray(); 
    291         osg::Vec2Array* texCoordArray = (osg::Vec2Array*) geom->getTexCoordArray(0); 
     289        osg::Vec2Array* texCoordArray=NULL; // only make them if the original has them 
     290        if(meshTexCoords) texCoordArray = (osg::Vec2Array*) geom->getTexCoordArray(0); 
    292291 
    293292        // Add vertices, normals, texcoords