OpenFlight-plugin with extended attributes.

Added the addtional properties (terrain, roofline and footprint) alongside with the SMC/FID attributes. Also I added the newly added IRMaterial to the per-geode properties.
Added the Texture-EffectId and the mapping index as a user-value to the texture object.
Naming scheme is the same as for the per-vertex/geode attributes.
This commit is contained in:
Sebastian Messerschmidt
2016-06-09 10:15:38 +01:00
committed by Robert Osfield
parent 6db4ec5c08
commit 7ccf16b83d
2 changed files with 55 additions and 5 deletions

View File

@@ -474,6 +474,24 @@ protected:
{
_geometry->setUserValue("<UA:FID>", feature);
}
// terrain
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != isTerrain())
{
_geometry->setUserValue("<UA:Terrain>", true);
}
// roofline
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != isRoofline())
{
_geometry->setUserValue("<UA:Roofline>", true);
}
// footprint
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != isFootprint())
{
_geometry->setUserValue("<UA:Footprint>", true);
}
// Shaders
if (shaderIndex >= 0)
@@ -957,7 +975,7 @@ protected:
int materialIndex = in.readInt16(-1);
int16 surface = in.readInt16();
int16 feature = in.readInt16();
/*int32 IRMaterial =*/ in.readInt32(-1);
int32 IRMaterial = in.readInt32(-1);
_transparency = in.readUInt16(0);
// version > 13
/*uint8 influenceLOD =*/ in.readUInt8();
@@ -1048,6 +1066,12 @@ protected:
_geode->setUserValue("<UA:IRC>", IRColor);
}
// IR Material ID (IRM)
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != IRMaterial)
{
_geode->setUserValue("<UA:IRM>", IRMaterial);
}
// surface (SMC)
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != surface)
{
@@ -1060,6 +1084,24 @@ protected:
_geode->setUserValue("<UA:FID>", feature);
}
// terrain
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != isTerrain())
{
_geode->setUserValue("<UA:Terrain>", true);
}
// roofline
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != isRoofline())
{
_geode->setUserValue("<UA:Roofline>", true);
}
// footprint
if (document.getPreserveNonOsgAttrsAsUserData() && 0 != isFootprint())
{
_geode->setUserValue("<UA:Footprint>", true);
}
// Shaders
if (shaderIndex >= 0)
{