From Dietmar Funck, "I've noticed an issue when writing arrays of type Vec2D and Vec3D to a .osgb file. A number is written to the output stream to identify the array type. In case of Vec2D and Vec3D arrays Vec4D is written as array type - I guess this is a copy and paste mistake.

Writing the correct array types fixes the issue - in my case it fixes writing and afterwards reading geometry instances."
This commit is contained in:
Robert Osfield 2011-05-26 16:34:33 +00:00
parent b8b368dc7c
commit 3fa1f2ed5a

View File

@ -232,11 +232,11 @@ void OutputStream::writeArray( const osg::Array* a )
writeArrayImplementation( static_cast<const osg::Vec4Array*>(a), a->getNumElements() ); writeArrayImplementation( static_cast<const osg::Vec4Array*>(a), a->getNumElements() );
break; break;
case osg::Array::Vec2dArrayType: case osg::Array::Vec2dArrayType:
*this << MAPPEE(ArrayType, ID_VEC4D_ARRAY); *this << MAPPEE(ArrayType, ID_VEC2D_ARRAY);
writeArrayImplementation( static_cast<const osg::Vec2dArray*>(a), a->getNumElements() ); writeArrayImplementation( static_cast<const osg::Vec2dArray*>(a), a->getNumElements() );
break; break;
case osg::Array::Vec3dArrayType: case osg::Array::Vec3dArrayType:
*this << MAPPEE(ArrayType, ID_VEC4D_ARRAY); *this << MAPPEE(ArrayType, ID_VEC3D_ARRAY);
writeArrayImplementation( static_cast<const osg::Vec3dArray*>(a), a->getNumElements() ); writeArrayImplementation( static_cast<const osg::Vec3dArray*>(a), a->getNumElements() );
break; break;
case osg::Array::Vec4dArrayType: case osg::Array::Vec4dArrayType: