From John Ivar Haugland and Michael Platings,
JIV:"I deleted a line from the ReaderWriterDAE.cpp file that was introduced in rev 11341. I got a crash on this line when the options pointer was NULL." MP:"Good spot John. The next line is also unnecessary and can be removed as well (attached, plus some minor code beautifying)"
This commit is contained in:
@@ -39,10 +39,10 @@ ReaderWriterDAE::readNode(const std::string& fname,
|
||||
|
||||
bool bOwnDAE = false;
|
||||
DAE* pDAE = NULL;
|
||||
|
||||
|
||||
if ( options )
|
||||
pDAE = (DAE*)options->getPluginData("DAE");
|
||||
|
||||
|
||||
std::string ext( osgDB::getLowerCaseFileExtension(fname) );
|
||||
if( ! acceptsExtension(ext) ) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
@@ -80,7 +80,7 @@ ReaderWriterDAE::readNode(const std::string& fname,
|
||||
*(float*)options->getPluginData("DAE-AssetUnitMeter") = daeReader.getAssetUnitMeter();
|
||||
if (options->getPluginData("DAE-AssetUp_axis"))
|
||||
*(domUpAxisType*)options->getPluginData("DAE-AssetUp_axis") = daeReader.getAssetUpAxis();
|
||||
}
|
||||
}
|
||||
|
||||
if (bOwnDAE)
|
||||
delete pDAE;
|
||||
@@ -97,9 +97,6 @@ ReaderWriterDAE::writeNode( const osg::Node& node,
|
||||
{
|
||||
SERIALIZER();
|
||||
|
||||
std::istringstream iss(options->getOptionString());
|
||||
std::string opt;
|
||||
|
||||
bool bOwnDAE = false;
|
||||
DAE* pDAE = NULL;
|
||||
|
||||
@@ -161,7 +158,7 @@ ReaderWriterDAE::writeNode( const osg::Node& node,
|
||||
std::string fileURI = ConvertFilePathToColladaCompatibleURI(fname);
|
||||
|
||||
osg::NodeVisitor::TraversalMode traversalMode = writeExtras ? osg::NodeVisitor::TRAVERSE_ALL_CHILDREN : osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN;
|
||||
|
||||
|
||||
osgDAE::daeWriter daeWriter(pDAE, fileURI, usePolygon, googleMode, traversalMode, writeExtras, earthTex, zUpAxis, forceTexture);
|
||||
daeWriter.setRootNode( node );
|
||||
const_cast<osg::Node*>(&node)->accept( daeWriter );
|
||||
@@ -172,7 +169,7 @@ ReaderWriterDAE::writeNode( const osg::Node& node,
|
||||
if (pDAE->write(fileURI))
|
||||
retVal = WriteResult::FILE_SAVED;
|
||||
}
|
||||
|
||||
|
||||
if ( options )
|
||||
{
|
||||
if (!bOwnDAE)
|
||||
|
||||
@@ -838,6 +838,8 @@ void GeometryTechnique::generateGeometry(BufferData& buffer, Locator* masterLoca
|
||||
// populate vertex and tex coord arrays
|
||||
//
|
||||
VNG.populateCenter(elevationLayer, layerToTexCoordMap);
|
||||
|
||||
#if 0
|
||||
if (terrain)
|
||||
{
|
||||
TileID tileID = _terrainTile->getTileID();
|
||||
@@ -954,6 +956,8 @@ void GeometryTechnique::generateGeometry(BufferData& buffer, Locator* masterLoca
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
osg::ref_ptr<osg::Vec3Array> skirtVectors = new osg::Vec3Array((*VNG._normals));
|
||||
VNG.computeNormals();
|
||||
|
||||
Reference in New Issue
Block a user