Skip to content

Commit

Permalink
OpenFlight-plugin with Surface Material Codes. There is one additiona…
Browse files Browse the repository at this point in the history
…l 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 <UA:IRM>
  • Loading branch information
minghia authored and robertosfield committed May 30, 2016
1 parent 260cbab commit 759b537
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/osgPlugins/OpenFlight/GeometryRecords.cpp
Expand Up @@ -362,7 +362,7 @@ class Face : public PrimaryRecord
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();
Expand Down Expand Up @@ -457,6 +457,12 @@ class Face : public PrimaryRecord
_geometry->setUserValue("<UA:IRC>", IRColor);
}

// IR Material ID (IRM)
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != IRMaterial)
{
_geometry->setUserValue("<UA:IRM>", IRMaterial);
}

// surface (SMC)
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != surface)
{
Expand Down

0 comments on commit 759b537

Please sign in to comment.