root/OpenSceneGraph/trunk/src/osgWrappers/serializers/osgManipulator/TranslateAxisDragger.cpp @ 13855

Revision 13855, 0.7 kB (checked in by robert, 37 minutes ago)

From Miha Ravselj, "Regarding previous submission it was only partial solution. After further testing I found similar bug also in ClearNode? serializer.

This line was problematic since it produced incorrect result when let's say COLOR flag is serialized
it should be null as in Camera serializer or in a proposed BitFlagsSerializer?

This line of code caused that whenever only GL_COLOR_BUFFER_BIT bit was written and on value read GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT was restored instead of GL_COLOR_BUFFER_BIT only.

//GLbitfield mask = 0; //this resolves the issue same as in camera
Also same bit-wise comparison bug was also present in write method.

As you can see there are total 3 bit mask serializers in OSG and all 3 had bugs so I decided to add ADD_BITFLAGS_SERIALIZER and replace USER serializers in osg::Camera, osg::ClearNode? and osgText::TextBase?. I have made sure that bitflags serializer does not break backwards-compatibility since it uses same code as user serializer does in all 3 cases. (see tester.cpp on how compatibility test was performed)"

  • Property svn:eol-style set to native
1#include <osgManipulator/TranslateAxisDragger>
2#include <osgDB/ObjectWrapper>
3#include <osgDB/InputStream>
4#include <osgDB/OutputStream>
6REGISTER_OBJECT_WRAPPER( osgManipulator_TranslateAxisDragger,
7                         new osgManipulator::TranslateAxisDragger,
8                         osgManipulator::TranslateAxisDragger,
9                         "osg::Object osg::Node osg::Transform osg::MatrixTransform osgManipulator::Dragger "
10                         "osgManipulator::TranslateAxisDragger" )  // No need to contain CompositeDragger here
12    ADD_FLOAT_SERIALIZER(AxisLineWidth, 2.0f);
13    ADD_FLOAT_SERIALIZER(PickCylinderRadius, 0.015f);
14    ADD_FLOAT_SERIALIZER(ConeHeight, 0.1f);
Note: See TracBrowser for help on using the browser.