- Cal3D 0.11 API Reference -

animation.h
1//****************************************************************************//
2// animation.h //
3// Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4//****************************************************************************//
5// This library is free software; you can redistribute it and/or modify it //
6// under the terms of the GNU Lesser General Public License as published by //
7// the Free Software Foundation; either version 2.1 of the License, or (at //
8// your option) any later version. //
9//****************************************************************************//
10
11#ifndef CAL_ANIMATION_H
12#define CAL_ANIMATION_H
13
14
15#include "cal3d/global.h"
16
17
19class CalModel;
20
21class CAL3D_API CalAnimation
22{
23public:
24 enum Type
25 {
26 TYPE_NONE = 0,
27 TYPE_CYCLE,
28 TYPE_POSE,
29 TYPE_ACTION
30 };
31
32 enum State
33 {
34 STATE_NONE = 0,
35 STATE_SYNC,
36 STATE_ASYNC,
37 STATE_IN,
38 STATE_STEADY,
39 STATE_OUT,
40 STATE_STOPPED
41 };
42 enum CompositionFunction {
43 CompositionFunctionNull = 0,
44 CompositionFunctionReplace,
45 CompositionFunctionAverage,
46 CompositionFunctionCrossFade
47 };
48
49protected:
50 CalAnimation(CalCoreAnimation *pCoreAnimation);
51public:
52 virtual ~CalAnimation() { }
53
54 CalCoreAnimation *getCoreAnimation();
55 const CalCoreAnimation *getCoreAnimation() const;
56 State getState() const;
57 float getTime() const;
58 Type getType() const;
59 float getWeight() const;
60 void setTime(float time);
61 void setTimeFactor(float timeFactor);
62 float getTimeFactor() const;
63
64 void checkCallbacks(float animationTime, CalModel *model);
65 void completeCallbacks(CalModel *model);
66
67protected:
68 void setType(Type type) {
69 m_type = type;
70 }
71
72 void setState(State state) {
73 m_state = state;
74 }
75
76 void setWeight(float weight) {
77 m_weight = weight;
78 }
79
80
81private:
82
83 CalCoreAnimation *m_pCoreAnimation;
84 std::vector<float> m_lastCallbackTimes;
85 Type m_type;
86 State m_state;
87 float m_time;
88 float m_timeFactor;
89 float m_weight;
90};
91
92#endif
93
94//****************************************************************************//
Definition animation.h:22
Definition coreanimation.h:24
Definition model.h:31

Generated by The Cal3D Team with Doxygen 1.10.0