Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation3/src/orxonox/graphics/AnimatedModel.h @ 6957

Last change on this file since 6957 was 6937, checked in by decapitb, 14 years ago

Predefined Armature-Animated Models supported.

File size: 2.5 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _AnimatedModel_H__
30#define _AnimatedModel_H__
31#include "Model.h"
32#include "tools/interfaces/Tickable.h"
33#include "OrxonoxPrereqs.h"
34#include <deque>
35#include <string>
36#include "tools/Mesh.h"
37#include "worldentities/StaticEntity.h"
38
39namespace orxonox
40{
41    class _OrxonoxExport AnimatedModel : public Model, public Tickable
42    {
43        public:
44            AnimatedModel(BaseObject* creator);
45            virtual ~AnimatedModel();
46
47            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
48            void registerVariables();
49
50            virtual void changedAnimationState();
51            virtual void setAnimationState(bool loop, bool enabled, const std::string& state);
52            virtual void setAnimEnabled(bool enabled);
53            virtual void setAnimLoop(bool loop);
54            virtual void tick(float dt);
55            virtual void changedMesh();
56
57
58            inline void setAnims(const std::string& anims)
59                { this->anims_ = anims; this->changedAnimationState(); }
60            inline const std::string& getAnims() const
61                { return this->anims_; }
62
63            inline const std::string& getAnimationState() const
64                { return this->anims_; }
65            inline const bool&  getAnimLoop() const
66                { return this->bAnimLoop_; }
67            inline const bool&  getAnimEnabled() const
68                { return this->bAnimEnabled_; }
69
70        private:
71            std::string anims_;
72            bool bAnimEnabled_;
73            bool bAnimLoop_;
74    };
75}
76
77#endif /* _AnimatedModel_H__ */
Note: See TracBrowser for help on using the repository browser.