Clone osgAnimation tracks (collada etc.)

Splitting a wider collada-related work !510 (merged) into manageable pieces.

This MR fixes the animation tracks not being copied properly in osgAnimation formats, which caused a bug that only first instance of animated creature had animations. Getting this merged is a crucial part of basic collada support.

Each osgAnimation::Channel at Resource::Animation must be linked properly to correct nodes. When std::vector<osg::ref_ptr<Resource::Animation>> mMergedAnimationTracks wasn't copied, also channels weren't linking properly.

Not all animation data in channels needs a deep copy, that's why this relies on osg::CopyOp, but there may be possibilities for later optimizations (e.g. at Resource::Animation). In testing, it seems to work fine though, so if optimizations are needed, they can be done later.

Merge request reports

Loading