- Cal3D 0.11 API Reference -

morphtargetmixer.h
1 //****************************************************************************//
2 // morphtargetmixer.h //
3 // Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4 // 2008 Erik Johnson
5 //****************************************************************************//
6 // This library is free software; you can redistribute it and/or modify it //
7 // under the terms of the GNU Lesser General Public License as published by //
8 // the Free Software Foundation; either version 2.1 of the License, or (at //
9 // your option) any later version. //
10 //****************************************************************************//
11 
12 #ifndef CAL_MORPHTARGETMIXER_H
13 #define CAL_MORPHTARGETMIXER_H
14 
15 
16 #include "cal3d/global.h"
17 #include <cal3d/coremorphkeyframe.h>
18 #include <cal3d/coreanimatedmorph.h>
19 
20 class CalModel;
21 
22 
23 class CAL3D_API CalMorphTargetMixer
24 {
25 public:
27  ~CalMorphTargetMixer() { }
28 
29  bool blend(int id, float weight, float delayIn, float delayOut, bool looping);
30  bool manualBlend(int id, float weight, float time);
31  bool clear(int id, float delay);
32  bool copy( const CalMorphTargetMixer& inOther );
33  float getCurrentWeight(int id) const;
34  //float getCurrentWeightBase() const;
35  const std::string& getMorphName(int id) const;
36  int getTrackCount(int id) const;
37  const std::list<CalCoreMorphTrack>& getMorphTracks(int id) const;
38  int getKeyframeCount(int id) const;
39  float getDuration(int id) const;
40  int getMorphTargetCount() const;
41  void update(float deltaTime);
42 
43  float CalcKeyframeWeight(const std::vector<CalCoreMorphKeyframe> &keyframes, float elapsedTime);
44 private:
45 
46  struct MorphAnimData
47  {
48  bool isManual;
49  int animatedMorphID;
50 
51  float weight;
52  bool looping;
53 
54  float playTime;
55  float currentWeight;
56  float fadeIn;
57  float fadeInTime;
58  float fadeOut;
59  float fadeOutTime;
60  };
61 
62  std::vector<MorphAnimData> mAnimList;
63 
64  CalModel *m_pModel;
65 
66  void SetTrackWeights(const CalCoreAnimatedMorph& morph, MorphAnimData& data);
67 
68 };
69 
70 #endif
71 
72 //****************************************************************************//
Definition: morphtargetmixer.h:23
The core animatedMorph class.
Definition: coreanimatedmorph.h:36
Definition: model.h:30

Generated by The Cal3D Team with Doxygen 1.8.14