// $Id: animation_base.cpp 1681 2008-04-09 13:52:48Z hikerstk $ // // SuperTuxKart - a fun racing game with go-kart // Copyright (C) 2009 Joerg Henrichs // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 3 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "animations/animation_base.hpp" #include "animations/ipo.hpp" #include "graphics/irr_driver.hpp" #include "io/file_manager.hpp" #include "io/xml_node.hpp" AnimationBase::AnimationBase(const XMLNode &node) : TrackObject(node) { float fps=25; node.get("fps", &fps); for(unsigned int i=0; i::iterator i; for(i=m_all_ipos.begin(); i::iterator i; for(i=m_all_ipos.begin(); isetInitialTransform(xyz, hpr); } // for i in m_all_ipos } // setTransform // ---------------------------------------------------------------------------- /** Resets all IPOs for this animation. */ void AnimationBase::reset() { std::vector::iterator i; for(i=m_all_ipos.begin(); ireset(); } // for i in m_all_ipos } // reset // ---------------------------------------------------------------------------- /** Updates the time, position and rotation. Called once per framce. * \param dt Time since last call. * \param xyz Position to be updated. * \param hpr Rotation to be updated. */ void AnimationBase::update(float dt, core::vector3df *xyz, core::vector3df *hpr) { std::vector::iterator i; for(i=m_all_ipos.begin(); iupdate(dt, xyz, hpr); } // for i in m_all_ipos } // float dt