This commit is contained in:
Robert Osfield 2018-12-13 14:08:20 +00:00
commit ab32dd859b

View File

@ -69,6 +69,18 @@ class ValueVisitor : public osg::ValueVisitor {
if (_applyMatrix) v = (_isNormal) ? (v * _m) - _origin : v * _m;
_fout << v[0] << ' ' << v[1] << ' ' << v[2];
}
//add Vec3dArray* vertex output to avoid inaccuracy
virtual void apply(osg::Vec3d & inv)
{
osg::Vec3d v(inv[0], inv[1], inv[2]);
osg::Vec3d orign_d((double)_origin.x(), (double)_origin.y(), (double)_origin.z());
if (_applyMatrix) v = (_isNormal) ? (v * _m) - orign_d : v * _m;
//Setting 10-digit Significant Number
_fout.precision(10);
_fout << v[0] << ' ' << v[1] << ' ' << v[2];
}
private:
ValueVisitor& operator = (const ValueVisitor&) { return *this; }