Hi Ulises, I'm curious how a maxPixelSize of zero would be meant to be interpreted in OpenFlight files. My guess is that a max pixel size of 0 would indicate that you should never see a light point, so in fact one should simply disable rendering for LightPointNode's where this is set.
I do wonder if the maxPixelSize of zero might be a bug in the database, as why would you create a light point that can't be seen... Robert. On 13 July 2012 23:55, Ulises Rainoldi <[email protected]> wrote: > Hello everyone, > > I'm working on a project where I need to load and display OpenFlight files. > I've found that some of my test files make my program crash. The file is > loaded correctly but it crashes when rendering. I also noticed that > osgviewer doesn't make it with this files. > > After debuging a little, I've found out that the method > IndexedLightPoint::readRecord (RecordInputStream& in, Document& document) was > setting the osgSim::LightPointNode's maxPixelSize to zero. This is causing > a index out of range exception afterwards in the draw traversal... > > I've solved this problem by simply adding a check for zero before setting the > maxPixelSize read from the file. > >> >> --- /tmp/LightPointRecords-0.2.cpp >> +++ >> /home/ulises/Development/OpenSceneGrpah/trunk/src/osgPlugins/OpenFlight/LightPointRecords.cpp >> @@ -392,7 +392,8 @@ >> if (_appearance.valid()) >> { >> _lpn->setMinPixelSize(_appearance->minPixelSize); >> - _lpn->setMaxPixelSize(_appearance->maxPixelSize); >> + if (_appearance->maxPixelSize > 0) >> + _lpn->setMaxPixelSize(_appearance->maxPixelSize); >> >> if (_appearance->texturePatternIndex != -1) >> { >> >> > > > With this simple patch the flt files that made osgviewer to crash are now > loaded and displayed correctly. > I hope this helps. > Thank you! > > Cheers, > Ulises[/code] > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=48839#48839 > > > > > > _______________________________________________ > 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

