- Cal3D 0.11 API Reference -

coremorphtrack.h
1//****************************************************************************//
2// coreMorphTrack.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_COREMORPHTRACK_H
12#define CAL_COREMORPHTRACK_H
13
14//****************************************************************************//
15// Includes //
16//****************************************************************************//
17
18#include "cal3d/global.h"
19#include "cal3d/matrix.h"
20#include "cal3d/vector.h"
21#include "cal3d/quaternion.h"
22#include "cal3d/coremorphkeyframe.h"
23
24//****************************************************************************//
25// Forward declarations //
26//****************************************************************************//
27
29
30//****************************************************************************//
31// Class declaration //
32//****************************************************************************//
33
34//*****************************************************************************/
35//** The core track class.
36//*****************************************************************************/
37
38class CAL3D_API CalCoreMorphTrack
39{
40// member variables
41protected:
42
43 unsigned int m_morphID;
44 unsigned int m_targetMeshID;
45 std::vector<unsigned int> m_targetSubMeshIDs;
46
48 std::vector<CalCoreMorphKeyframe> m_keyframes;
49 std::vector<CalCoreMorphKeyframe*> m_keyframesToDelete;
50
51// constructors/destructor
52public:
54 virtual ~CalCoreMorphTrack();
55
56 bool create();
57 void destroy();
58
59 bool getState(float time, float & weightOut);
60
61 const unsigned int& getMorphID() const{return m_morphID;}
62 void setMorphID(const unsigned int &name){m_morphID=name;}
63
64 inline const unsigned int& getTargetMesh() const {return m_targetMeshID;}
65 inline void setTargetMesh(unsigned int name){m_targetMeshID=name;}
66
68 const unsigned int getNumTargetSubMeshes()const{return m_targetSubMeshIDs.size();}
69 inline void addTargetSubMesh(unsigned int i){m_targetSubMeshIDs.push_back(i);}
70 inline void removeTargetSubMesh(unsigned int name){
71 for(std::vector<unsigned int>::iterator i=m_targetSubMeshIDs.begin();i!=m_targetSubMeshIDs.begin();i++){
72 if(*i==name){
73 m_targetSubMeshIDs.erase(i);
74 return;
75 }
76 }
77 }
78
79 inline const unsigned int &getTargetSubMesh(const unsigned int &name)const{return m_targetSubMeshIDs[name];}
80
81 int getCoreMorphKeyframeCount() const;
82 void reserve(int);
83
84 CalCoreMorphKeyframe* getCoreMorphKeyframe(int idx);
85 const CalCoreMorphKeyframe* getCoreMorphKeyframe(int idx) const;
86
87 bool addCoreMorphKeyframe(CalCoreMorphKeyframe *pCoreKeyframe);
88
89 const std::vector<CalCoreMorphKeyframe> & getVectorCoreMorphKeyframes() const;
90 std::vector<CalCoreMorphKeyframe> & getVectorCoreMorphKeyframes();
91
92 void scale(float factor);
93
94private:
95 std::vector<CalCoreMorphKeyframe>::iterator getUpperBound(float time);
96};
97
98#endif
99
100//****************************************************************************//
The core keyframe class.
Definition coremorphkeyframe.h:32
Definition coremorphtrack.h:39
std::vector< CalCoreMorphKeyframe > m_keyframes
List of keyframes, always sorted by time.
Definition coremorphtrack.h:48
const unsigned int getNumTargetSubMeshes() const
TargetSubMeshes container if empty assume ALL submeshes have morphtarget.
Definition coremorphtrack.h:68

Generated by The Cal3D Team with Doxygen 1.10.0