Hi!

Just start the osgviewer with the attached file "simple_cube_noopt.osgt". On 
the console you will then see:

AsciiInputIterator::readProperty(): Unmatched property Matrixd, expecting 
Matrixf

--Alex


robertosfield wrote:
> Hi Alexander,
> 
> Thanks for the zipping up the changes, I was able to download this
> without any problems this time, thanks.
> 
> I've now done a review and believe I now understand the bug and the
> fix you've gone for.  I'm not sure replacing the >> (Matrixf&) and >>
> (Matrixd&) operators with a single Matrix& appropriate though as in
> some case in the OSG a Matrixd or Matrixf is specifically read rather
> than a osg::Matrix.  osg::Matrix by default is typedef'd to Matrixd
> but users can override this via Cmake and set the typedef to Matrixf.
> 
> Given these two factors I believe it would be appropriate to keep both
> the original operators, but fix their implementations so that rather
> than assume that they reading a Matrixf or Matrixd they actually check
> the type.
> 
> I will have a look at implementing this.  Could you suggest a simple
> example of how to recreate the problem you've seen so I can recreate
> it at my end and use this as a test?
> 
> Thanks,
> Robert.
> 
> On Mon, Sep 27, 2010 at 2:16 PM, Alexander Irion <> wrote:
> 
> > Hi,
> > 
> > when I try to to read a ".osgt" file, that contains a Matrixd I got the 
> > following warnings printed on the console:
> > 
> > AsciiInputIterator::readProperty(): Unmatched property Matrixd, expecting 
> > Matrixf
> > 
> > I had a look into the code and saw, that _useFloatMatrix in InputStream is 
> > always "TRUE", when reading a ".osgt" file. It can only be set to "FALSE", 
> > when a ".osgb" file is read.
> > 
> > In MatrixSerializer::readMatrixImplementation then, the double matrix from 
> > the file will be read as float matrix and then converted back to double, 
> > ofcourse with loosing the double precision.
> > 
> > Please find the attached modification, that first reads the property 
> > (either Matrixf or Matrixd) and then decides the matrix type for reading 
> > depending on the property.
> > 
> > Is this fix ok, or any other solution?
> > 
> > 
> > Thank you!
> > 
> > Cheers,
> > Alexander
> > 
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=32098#32098
> > 
> > 
> > 
> > 
> > Attachments:
> > http://forum.openscenegraph.org//files/asciistreamoperator_175.h
> > http://forum.openscenegraph.org//files/inputstream_184.cpp
> > http://forum.openscenegraph.org//files/1467_1285589407._194.
> > http://forum.openscenegraph.org//files/1467_1285589400._360.
> > 
> > 
> > _______________________________________________
> > osg-submissions mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
> > 
> > 
> _______________________________________________
> osg-submissions mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
> 
>  ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32259#32259




Attachments: 
http://forum.openscenegraph.org//files/simple_cube_632.zip


_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to