If it can be stored as simple text, the DescriptionList (an attribute of Node) would be the best place for it. UserData is already used by the OpenFlight loader for other things.
The 2.9.x series has a new mechanism for storing such application-specifc data in the scene graph, but if you use DescriptionList instead, your change could be back-ported to the 2.8.5 release (if/when that happens).
-Paul
-------- Original Message --------
Subject: [osg-users] [osgPlugins] How to read/write/access OpenFlight
Surface Material Code (SMC) and Feature ID (FID) ?
From: "Robert Ioiart" <[email protected]>
Date: Wed, April 13, 2011 5:40 pm
To: [email protected]
Hi,
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)
Code:
/*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!
Cheers,
Robert
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=38454#38454
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

