Added support for float or double osg::Plane, and the default osg::Plane to double.
Performance tests on big models did not indicate any performance penalty in using doubles over floats, so the move to doubles should mainly impact precision improvements for whole earth databases. Also made improvements to osgUtil::PlaneIntersector and osgSim::ElevationSlice classes
This commit is contained in:
@@ -157,11 +157,6 @@ bool DataInputStream::readBool(){
|
||||
return c!=0;
|
||||
}
|
||||
|
||||
unsigned int DataInputStream::getVersion()
|
||||
{
|
||||
return( _version );
|
||||
}
|
||||
|
||||
char DataInputStream::readChar(){
|
||||
char c;
|
||||
_istream->read(&c, CHARSIZE);
|
||||
@@ -387,11 +382,24 @@ osg::Vec4d DataInputStream::readVec4d(){
|
||||
|
||||
osg::Plane DataInputStream::readPlane(){
|
||||
osg::Plane v;
|
||||
v[0]=readFloat();
|
||||
v[1]=readFloat();
|
||||
v[2]=readFloat();
|
||||
v[3]=readFloat();
|
||||
|
||||
if (getVersion() <= VERSION_0018)
|
||||
{
|
||||
v[0]=readFloat();
|
||||
v[1]=readFloat();
|
||||
v[2]=readFloat();
|
||||
v[3]=readFloat();
|
||||
}
|
||||
else
|
||||
{
|
||||
// assume double for planes even if Plane::value_type is float
|
||||
// to ensure that the .ive format does vary.
|
||||
v[0]=readDouble();
|
||||
v[1]=readDouble();
|
||||
v[2]=readDouble();
|
||||
v[3]=readDouble();
|
||||
}
|
||||
|
||||
if (_verboseOutput) std::cout<<"read/writePlane() ["<<v<<"]"<<std::endl;
|
||||
|
||||
return v;
|
||||
|
||||
Reference in New Issue
Block a user