diff --git a/src/osgPlugins/OpenFlight/Document.cpp b/src/osgPlugins/OpenFlight/Document.cpp index 6a650edaf..b5076bda5 100644 --- a/src/osgPlugins/OpenFlight/Document.cpp +++ b/src/osgPlugins/OpenFlight/Document.cpp @@ -30,6 +30,7 @@ Document::Document() : _useTextureAlphaForTransparancyBinning(true), _useBillboardCenter(false), _doUnitsConversion(true), + _readObjectRecordData(false), _desiredUnits(METERS), _done(false), _level(0), diff --git a/src/osgPlugins/OpenFlight/Document.h b/src/osgPlugins/OpenFlight/Document.h index 41a10f8f5..748a8b2d4 100644 --- a/src/osgPlugins/OpenFlight/Document.h +++ b/src/osgPlugins/OpenFlight/Document.h @@ -185,8 +185,11 @@ class Document void setDesiredUnits(CoordUnits units ) { _desiredUnits=units; } CoordUnits getDesiredUnits() const { return _desiredUnits; } - bool getKeepExternalReferences() const { return _keepExternalReferences; } void setKeepExternalReferences( bool flag) { _keepExternalReferences=flag; } + bool getKeepExternalReferences() const { return _keepExternalReferences; } + + void setReadObjectRecordData(bool flag) { _readObjectRecordData = flag; } + bool getReadObjectRecordData() const { return _readObjectRecordData; } protected: @@ -199,6 +202,7 @@ class Document bool _useTextureAlphaForTransparancyBinning; bool _useBillboardCenter; bool _doUnitsConversion; + bool _readObjectRecordData; CoordUnits _desiredUnits; bool _keepExternalReferences; diff --git a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp index aaab5808d..45b7c3ea5 100644 --- a/src/osgPlugins/OpenFlight/PrimaryRecords.cpp +++ b/src/osgPlugins/OpenFlight/PrimaryRecords.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include "Registry.h" #include "Document.h" #include "RecordInputStream.h" @@ -861,11 +862,27 @@ protected: virtual void readRecord(RecordInputStream& in, Document& document) { std::string id = in.readString(8); - /*uint32 flags =*/ in.readUInt32(); _object = new osg::Group; _object->setName(id); + if (document.getReadObjectRecordData()) + { + osgSim::ObjectRecordData* ord = new osgSim::ObjectRecordData; + ord->_flags = in.readUInt32(); + ord->_relativePriority = in.readInt16(); + ord->_transparency = in.readUInt16(); + ord->_effectID1 = in.readInt16(); + ord->_effectID2 = in.readInt16(); + ord->_significance = in.readInt16(); + + _object->setUserData( ord ); + } + else + { + /*uint32 flags =*/ in.readUInt32(); + } + // Postpone add-to-parent until we know a bit more. } diff --git a/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp b/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp index c78ea3f79..71655b6e5 100644 --- a/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp +++ b/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp @@ -203,6 +203,9 @@ class FLTReaderWriter : public ReaderWriter document.setUseTextureAlphaForTransparancyBinning(options->getOptionString().find("noTextureAlphaForTransparancyBinning")==std::string::npos); osg::notify(osg::DEBUG_INFO) << readerMsg << "noTextureAlphaForTransparancyBinning=" << !document.getUseTextureAlphaForTransparancyBinning() << std::endl; + document.setReadObjectRecordData(options->getOptionString().find("readObjectRecordData")==std::string::npos); + osg::notify(osg::DEBUG_INFO) << readerMsg << "readObjectRecordData=" << !document.getReadObjectRecordData() << std::endl; + document.setDoUnitsConversion((options->getOptionString().find("noUnitsConversion")==std::string::npos)); // default to true, unless noUnitsConversion is specified. osg::notify(osg::DEBUG_INFO) << readerMsg << "noUnitsConversion=" << !document.getDoUnitsConversion() << std::endl; diff --git a/src/osgPlugins/osgSim/CMakeLists.txt b/src/osgPlugins/osgSim/CMakeLists.txt index e341b7567..ead995379 100644 --- a/src/osgPlugins/osgSim/CMakeLists.txt +++ b/src/osgPlugins/osgSim/CMakeLists.txt @@ -1,16 +1,14 @@ -#this file is automatically generated - - SET(TARGET_SRC -IO_ShapeAttribute.cpp -IO_BlinkSequence.cpp -IO_DOFTransform.cpp -IO_Impostor.cpp -IO_LightPoint.cpp -IO_LightPointNode.cpp -IO_MultiSwitch.cpp -IO_Sector.cpp -IO_VisibilityGroup.cpp + IO_ShapeAttribute.cpp + IO_BlinkSequence.cpp + IO_DOFTransform.cpp + IO_Impostor.cpp + IO_LightPoint.cpp + IO_LightPointNode.cpp + IO_MultiSwitch.cpp + IO_Sector.cpp + IO_VisibilityGroup.cpp + IO_ObjectRecordData.cpp ) SET(TARGET_H IO_LightPoint.h ) SET(TARGET_ADDED_LIBRARIES osgSim )