From 8d08b75e19d39eacc4b4d87ce29c0cb9896ef5b4 Mon Sep 17 00:00:00 2001 From: Tony Vasile Date: Mon, 30 May 2016 12:41:25 +0100 Subject: [PATCH] OpenFlight-plugin with Surface Material Codes. There is one additional field that may be required by an existing application in addition to the IR Code is the IR Material. I have a small fix to include the IR Material as the User Value --- src/osgPlugins/OpenFlight/GeometryRecords.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/OpenFlight/GeometryRecords.cpp b/src/osgPlugins/OpenFlight/GeometryRecords.cpp index 575d3faeb..8006d0c3c 100644 --- a/src/osgPlugins/OpenFlight/GeometryRecords.cpp +++ b/src/osgPlugins/OpenFlight/GeometryRecords.cpp @@ -362,7 +362,7 @@ protected: int materialIndex = in.readInt16(-1); int16 surface = in.readInt16(); int16 feature = in.readInt16(); - /*int32 IRMaterial =*/ in.readInt32(-1); + int32 IRMaterial = in.readInt32(); _transparency = in.readUInt16(0); // version > 13 /*uint8 influenceLOD =*/ in.readUInt8(); @@ -457,6 +457,12 @@ protected: _geometry->setUserValue("", IRColor); } + // IR Material ID (IRM) + if (document.getPreserveNonOsgAttrsAsUserData() && 0 != IRMaterial) + { + _geometry->setUserValue("", IRMaterial); + } + // surface (SMC) if (document.getPreserveNonOsgAttrsAsUserData() && 0 != surface) {