I am testing my company's own OpenFlight implementation and came across some 
corrupt data reading in Dof nodes.  Google found that the OSG OpenFlight plugin 
is compensating for the same corrupt data so that was useful to me and 
validated what coworkers were telling me about the cause of the corruption.

But I had a further problem.  My test data from Creator 15.7 does not agree 
with the open flight spec or the code in Osg's readRange() line 431.  The OSG 
code simply reads in four Float64s.  When I try that I get NaN for the 
"current". 

I finally arrived at this code to read in a range.


Code:

struct Range
{
    double min;
    double max;
    double current;
    double inc;
};

Range readRange( unsigned char *&p )
{
    Range r;
    r.min = readDouble(p);
    r.max = readDouble(p);
    unsigned long long hi = readUInt32(p);
    r.inc = readDouble(p);
    unsigned long long lo = readUInt32(p);
    unsigned long long x = (hi << 32 ) | lo;
    r.current = *reinterpret_cast < double * >(&x);
    return r;
}




I have not included all the code but the point is to show the format of the 
data.  The "current" field is separated into two pieces that need to be 
recombined to form a double.

I hope this is helpful to your project.  I am neither a user nor a developer of 
OSG otherwise I'd fix it myself.

Scott Johnson

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





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

Reply via email to