From ade10ccebc39cf8f8282dc621a6f404003dc1c11 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 14 Jun 2004 20:10:08 +0000 Subject: [PATCH] Improved precision of AnimationPath IO. --- src/osgPlugins/osg/AnimationPath.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/osg/AnimationPath.cpp b/src/osgPlugins/osg/AnimationPath.cpp index b4b727aa8..5fb60d6d6 100644 --- a/src/osgPlugins/osg/AnimationPath.cpp +++ b/src/osgPlugins/osg/AnimationPath.cpp @@ -66,8 +66,8 @@ bool AnimationPath_readLocalData(osg::Object &obj, osgDB::Input &fr) fr += 2; - float time; - Vec3 position,scale; + double time; + Vec3d position,scale; Quat rotation; while (!fr.eof() && fr[0].getNoNestedBrackets()>entry) @@ -131,6 +131,9 @@ bool AnimationPath_writeLocalData(const osg::Object &obj, osgDB::Output &fw) fw.indent() << "ControlPoints {"<< std::endl; fw.moveIn(); + int prec = fw.precision(); + fw.precision(15); + for (AnimationPath::TimeControlPointMap::const_iterator itr=tcpm.begin(); itr!=tcpm.end(); ++itr) @@ -139,6 +142,8 @@ bool AnimationPath_writeLocalData(const osg::Object &obj, osgDB::Output &fw) } + fw.precision(prec); + fw.moveOut(); fw.indent() << "}"<< std::endl;