[osg-users] [osgPlugins] How to read/write/access OpenFlight Surface Material Code (SMC) and Feature ID (FID) ?

Robert Ioiart rioiart at gmail.com
Wed Apr 13 17:40:51 PDT 2011


I would like to include several attributes of openflight face records, namely Surface Material Code, and Feature ID into the scene graph. Essentialy I am looking at modifying the openflight plugin and the ive plugin to read/write these attributes.
I want to use this information as a "cost" of movement for entities, so that a vehicle moves slower over dirt than over tarmac. Basically I need to be able to get access to the data using intersectors under the wheels.

I am using OSG release 2.8.3 and I have noticed that in the source code of the openflight plugin src\osgPlugins\OpenFlight\GeometryRecords.cpp the data is skipped/discarded (lines 259,260 and lines 826,827)

/*int16 surface =*/ in.readInt16();
/*int16 feature =*/ in.readInt16();

My question is: where is the most logical place to store this data in the scene graph. Should I just store it as user data for the stateset or the geode or should I define a new class derived from osg::StateAttribute and add an instance of this object to the stateset of the face?
What would be the caveats of these aproaches?

P.S. I am fairly new to OpenSceneGraph and my knowledge of OpenGL is basic.

Thank you!


Read this topic online here:

More information about the osg-users mailing list