ScummVM API documentation
animhandler.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef STARK_MODEL_ANIM_HANDLER_H
23 #define STARK_MODEL_ANIM_HANDLER_H
24 
25 #include "common/scummsys.h"
26 
27 namespace Stark {
28 
29 class Model;
30 class BoneNode;
31 class SkeletonAnim;
32 
36 class AnimHandler {
37 public:
38  AnimHandler();
39  ~AnimHandler();
40 
44  void animate(uint32 time);
45 
47  void setModel(Model *model);
48 
50  void setAnim(SkeletonAnim *anim);
51 
53  void resetBlending();
54 
55 private:
56  void enactCandidate();
57  void startBlending();
58  void updateBlending(int32 deltaTime);
59  void stopBlending();
60 
61  void setNode(uint32 time, BoneNode *bone, const BoneNode *parent);
62 
63  static const uint32 _blendDuration = 300; // ms
64 
65  SkeletonAnim *_anim;
66  int32 _animTime;
67 
68  int32 _framesBeforeCandidateReady;
69  SkeletonAnim *_candidateAnim;
70  int32 _candidateAnimTime;
71 
72  SkeletonAnim *_blendAnim;
73  int32 _blendAnimTime;
74  int32 _blendTimeRemaining;
75 
76  Model *_model;
77 };
78 
79 } // End of namespace Stark
80 
81 #endif // STARK_MODEL_ANIM_HANDLER_H
Definition: model.h:91
void setAnim(SkeletonAnim *anim)
Definition: animhandler.h:36
Definition: model.h:64
Definition: console.h:27
void setModel(Model *model)
Definition: skeleton_anim.h:36
void animate(uint32 time)