From Wojciech Lewandowski, "Most recent changes to CameraPathEventHandler change path writing method. Now control points are written on the fly. But default stream precision is not adjusted as it used to and remains set to 6 digits (at least with VS 2008) so larger coordinates like positions on Earth Ellipsoid loose lots of fidelity. This patch fixes this issue.

"
This commit is contained in:
Robert Osfield 2008-09-01 10:06:19 +00:00
parent 8fec858b49
commit 2ce8fbdcf9
2 changed files with 10 additions and 1 deletions

View File

@ -52,12 +52,18 @@ class OSGSIM_EXPORT ShapeAttribute
ShapeAttribute& operator = (const ShapeAttribute& sa);
const std::string & getName() const { return _name; }
void setName(const std::string& name) { _name = name; }
const Type getType() const { return _type; }
int getInt() const { return _integer; }
double getDouble() const { return _double; }
const char * getString() const { return _string; }
void setValue(int value) {_type = INTEGER; _integer = value; }
void setValue(double value) {_type = DOUBLE; _double = value; }
void setValue(const char * value) {_type = STRING; _string = (value ? strdup(value) : 0); }
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
int compare(const osgSim::ShapeAttribute& sa) const;

View File

@ -463,6 +463,9 @@ bool RecordCameraPathHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GU
osg::notify(osg::NOTICE) << "Recording camera path to file " << ss.str() << std::endl;
_fout.open( ss.str().c_str() );
// make sure doubles are not trucated by default stream precision = 6
_fout.precision( 15 );
}
else
{