From Tony Horrobin:
"This is a small fix for flt2osg.[cpp|h] that handles
old style road segments ( from Multigen II w/road
tools on IRIX ) in the same way as the newer road
constructions. ie create a group and do a nested
traversal.
This makes roads appear in older format files where
there was previously a gap. This actually works
properly with the paths which are marked as hidden in
the openflight database."
This commit is contained in:
@@ -370,6 +370,10 @@ osg::Group* ConvertFromFLT::visitPrimaryNode(osg::Group& osgParent, PrimNodeReco
|
||||
// treat road construction record as a group record for now
|
||||
osgPrim = visitRoadConstruction(osgParent, (GroupRecord*)child);
|
||||
break;
|
||||
case ROAD_SEGMENT_OP:
|
||||
// treat road segment record as a group record for now
|
||||
osgPrim = visitRoadSegment(osgParent, (GroupRecord*)child);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -1032,6 +1036,17 @@ osg::Group* ConvertFromFLT::visitRoadConstruction(osg::Group& osgParent, GroupRe
|
||||
return group;
|
||||
}
|
||||
|
||||
osg::Group* ConvertFromFLT::visitRoadSegment(osg::Group& osgParent, GroupRecord* rec)
|
||||
{
|
||||
osg::Group* group = new osg::Group;
|
||||
|
||||
group->setName(rec->getData()->szIdent);
|
||||
//cout<<"Converted a road segment node of ID "<<group->getName()<<" to group node."<<endl;
|
||||
visitAncillary(osgParent, *group, rec)->addChild( group );
|
||||
visitPrimaryNode(*group, rec);
|
||||
return group;
|
||||
}
|
||||
|
||||
osg::Group* ConvertFromFLT::visitLOD(osg::Group& osgParent, LodRecord* rec)
|
||||
{
|
||||
SLevelOfDetail* pSLOD = rec->getData();
|
||||
|
||||
@@ -127,7 +127,7 @@ class ConvertFromFLT
|
||||
|
||||
// Ancillary records
|
||||
osg::Group* visitMatrix(osg::Group& osgParent, const osg::Group& osgPrimary, MatrixRecord* rec);
|
||||
osg::Group* visitGeneralMatrix(osg::Group& osgParent, const osg::Group& osgPrimary, GeneralMatrixRecord* rec);
|
||||
osg::Group* visitGeneralMatrix(osg::Group& osgParent, const osg::Group& osgPrimary, GeneralMatrixRecord* rec);
|
||||
void visitLongID(osg::Group& osgParent, LongIDRecord* rec);
|
||||
void visitComment(osg::Node& osgParent, CommentRecord* rec);
|
||||
|
||||
@@ -151,6 +151,7 @@ class ConvertFromFLT
|
||||
osg::Group* visitBSP(osg::Group& osgParent, BSPRecord* rec);
|
||||
osg::Group* visitLightSource(osg::Group& osgParent, LightSourceRecord* rec);
|
||||
osg::Group* visitRoadConstruction(osg::Group& osgParent, GroupRecord* rec);
|
||||
osg::Group* visitRoadSegment(osg::Group& osgParent, GroupRecord* rec);
|
||||
osg::Group* visitLOD(osg::Group& osgParent, LodRecord* rec);
|
||||
osg::Group* visitOldLOD(osg::Group& osgParent, OldLodRecord* rec);
|
||||
osg::Group* visitDOF(osg::Group& osgParent, DofRecord* rec);
|
||||
|
||||
Reference in New Issue
Block a user