From 6f82b37dd0be9bd420b6185bcabaac1939ec39e2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 8 Jun 2004 14:30:48 +0000 Subject: [PATCH] Improved the precision of animation paths. --- src/osg/AnimationPath.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osg/AnimationPath.cpp b/src/osg/AnimationPath.cpp index ac3e00682..3e7cc735a 100644 --- a/src/osg/AnimationPath.cpp +++ b/src/osg/AnimationPath.cpp @@ -87,7 +87,7 @@ void AnimationPath::read(std::istream& in) while (!in.eof()) { double time; - osg::Vec3 position; + osg::Vec3d position; osg::Quat rotation; in >> time >> position.x() >> position.y() >> position.z() >> rotation.x() >> rotation.y() >> rotation.z() >> rotation.w(); if(!in.eof()) @@ -97,6 +97,9 @@ void AnimationPath::read(std::istream& in) void AnimationPath::write(std::ostream& fout) const { + int prec = fout.precision(); + fout.precision(15); + const TimeControlPointMap& tcpm = getTimeControlPointMap(); for(TimeControlPointMap::const_iterator tcpmitr=tcpm.begin(); tcpmitr!=tcpm.end(); @@ -105,6 +108,8 @@ void AnimationPath::write(std::ostream& fout) const const ControlPoint& cp = tcpmitr->second; fout<first<<" "<