From 3232faa703bfe5963895c35a69534def1c283e21 Mon Sep 17 00:00:00 2001 From: Nelsson Huotari Date: Fri, 20 Nov 2020 19:41:01 +0200 Subject: [PATCH] Use const ref instead of value --- components/sceneutil/osgacontroller.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/sceneutil/osgacontroller.cpp b/components/sceneutil/osgacontroller.cpp index e20ecb5b89..503d9cf022 100644 --- a/components/sceneutil/osgacontroller.cpp +++ b/components/sceneutil/osgacontroller.cpp @@ -115,7 +115,7 @@ namespace OsgaController float newTime = time; //Find the correct animation based on time - for (auto emulatedAnimation : mEmulatedAnimations) + for (const EmulatedAnimation& emulatedAnimation : mEmulatedAnimations) { if (time > emulatedAnimation.mStartTime && time < emulatedAnimation.mStopTime) { @@ -125,7 +125,7 @@ namespace OsgaController } //Find the root transform track in animation - for (auto mergedAnimationTrack : mMergedAnimationTracks) + for (const osg::ref_ptr mergedAnimationTrack : mMergedAnimationTracks) { if (mergedAnimationTrack->getName() != animationName) continue; @@ -150,7 +150,7 @@ namespace OsgaController void KeyframeController::update(float time, std::string animationName) { - for (auto mergedAnimationTrack : mMergedAnimationTracks) + for (const osg::ref_ptr mergedAnimationTrack : mMergedAnimationTracks) { if (mergedAnimationTrack->getName() == animationName) mergedAnimationTrack->update(time); } @@ -162,7 +162,7 @@ namespace OsgaController { if (mNeedToLink) { - for (auto mergedAnimationTrack : mMergedAnimationTracks) + for (const osg::ref_ptr mergedAnimationTrack : mMergedAnimationTracks) { if (!mLinker.valid()) mLinker = new LinkVisitor(); mLinker->setAnimation(mergedAnimationTrack); @@ -173,7 +173,7 @@ namespace OsgaController float time = getInputValue(nv); - for (auto emulatedAnimation : mEmulatedAnimations) + for (const EmulatedAnimation& emulatedAnimation : mEmulatedAnimations) { if (time > emulatedAnimation.mStartTime && time < emulatedAnimation.mStopTime) {