- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgAnimation/BasicAnimationManager.cpp
r12292 r13041 1 /* -*-c++-*- 1 /* -*-c++-*- 2 2 * Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net> 3 3 * 4 * This library is open source and may be redistributed and/or modified under 5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 4 * This library is open source and may be redistributed and/or modified under 5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 6 6 * (at your option) any later version. The full license is in LICENSE file 7 7 * included with this distribution, and on the openscenegraph.org website. 8 * 8 * 9 9 * This library is distributed in the hope that it will be useful, 10 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 12 * OpenSceneGraph Public License for more details. 13 13 */ … … 19 19 20 20 BasicAnimationManager::BasicAnimationManager() 21 : _lastUpdate(0.0) 21 : _lastUpdate(0.0) 22 22 { 23 23 } 24 24 25 BasicAnimationManager::BasicAnimationManager(const AnimationManagerBase& b, const osg::CopyOp& copyop) 25 BasicAnimationManager::BasicAnimationManager(const AnimationManagerBase& b, const osg::CopyOp& copyop) 26 26 : AnimationManagerBase(b,copyop) 27 , _lastUpdate(0.0) 27 , _lastUpdate(0.0) 28 28 { 29 29 } 30 30 31 BasicAnimationManager::~BasicAnimationManager() 31 BasicAnimationManager::~BasicAnimationManager() 32 32 { 33 33 } … … 36 36 { 37 37 // loop over all playing animation 38 for( AnimationLayers::iterator iterAnim = _animationsPlaying.begin(); iterAnim != _animationsPlaying.end(); ++iterAnim ) 38 for( AnimationLayers::iterator iterAnim = _animationsPlaying.begin(); iterAnim != _animationsPlaying.end(); ++iterAnim ) 39 39 { 40 40 AnimationList& list = iterAnim->second; … … 52 52 if ( isPlaying(pAnimation) ) 53 53 stopAnimation(pAnimation); 54 54 55 55 _animationsPlaying[priority].push_back(pAnimation); 56 56 // for debug … … 95 95 for (unsigned int i = 0; i < list.size(); i++) 96 96 { 97 if (! list[i]->update(time, priority)) 97 if (! list[i]->update(time, priority)) 98 98 { 99 99 // debug 100 100 // std::cout << list[i]->getName() << " finished at " << time << std::endl; 101 101 toremove.push_back(i); 102 } else 102 } else 103 103 { 104 104 // debug … … 119 119 bool BasicAnimationManager::findAnimation(Animation* pAnimation) 120 120 { 121 for( AnimationList::const_iterator iterAnim = _animations.begin(); iterAnim != _animations.end(); ++iterAnim ) 121 for( AnimationList::const_iterator iterAnim = _animations.begin(); iterAnim != _animations.end(); ++iterAnim ) 122 122 { 123 123 if ( (*iterAnim) == pAnimation )
