00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef ANIMATION_COMPRESSOR_H_
00026 #define ANIMATION_COMPRESSOR_H_
00027
00028 namespace Lamp{
00029
00030 class VectorInterpolationCompressor;
00031 class VectorInterpolator;
00032 class RotationInterpolationCompressor;
00033 class RotationInterpolator;
00034 class Animation;
00035 class AnimationSet;
00036 class CameraAnimation;
00037 class SceneNodeAnimation;
00038 class CharacterModelAnimation;
00039
00040
00041
00042
00043
00044 class AnimationCompressor{
00045 public:
00046
00047
00048
00049 AnimationCompressor();
00050
00051
00052
00053
00054 virtual ~AnimationCompressor();
00055
00056
00057
00058
00059
00060
00061
00062
00063 virtual void compress(Animation* animation);
00064
00065
00066
00067
00068
00069
00070
00071
00072 virtual void setScaleTolerance(float scaleTolerance){
00073 Assert(scaleTolerance >= 0.f)
00074 scaleTolerance_ = scaleTolerance;
00075 }
00076
00077
00078
00079
00080
00081 virtual float getScaleTolerance() const{ return scaleTolerance_; }
00082
00083
00084
00085
00086
00087
00088 virtual void setRotationTolerance(float rotationTolerance){
00089 Assert(rotationTolerance >= 0.f)
00090 rotationTolerance_ = rotationTolerance;
00091 }
00092
00093
00094
00095
00096
00097 virtual float getRotationTolerance() const{
00098 return rotationTolerance_;
00099 }
00100
00101
00102
00103
00104
00105
00106 virtual void setTranslationTolerance(float translationTolerance){
00107 Assert(translationTolerance >= 0.f)
00108 translationTolerance_ = translationTolerance;
00109 }
00110
00111
00112
00113
00114
00115 virtual float getTranslationTolerance() const{
00116 return translationTolerance_;
00117 }
00118
00119 protected:
00120
00121
00122
00123
00124
00125
00126
00127 virtual void compressAnimation(Animation* animation);
00128
00129
00130
00131
00132
00133 virtual void compressAnimationSet(AnimationSet* animation);
00134
00135
00136
00137
00138
00139 virtual void compressCameraAnimation(CameraAnimation* animation);
00140
00141
00142
00143
00144
00145 virtual void compressSceneNodeAnimation(SceneNodeAnimation* animation);
00146
00147
00148
00149
00150
00151 virtual void compressCharacterModelAnimation(
00152 CharacterModelAnimation* animation);
00153
00154
00155
00156
00157
00158
00159
00160
00161 virtual VectorInterpolator* compressScale(VectorInterpolator* interpolator);
00162
00163
00164
00165
00166
00167 virtual RotationInterpolator* compressRotation(
00168 RotationInterpolator* interpolator);
00169
00170
00171
00172
00173
00174 virtual VectorInterpolator* compressTranslation(
00175 VectorInterpolator* interpolator);
00176
00177 private:
00178
00179
00180 AnimationCompressor(const AnimationCompressor& copy);
00181
00182
00183 void operator =(const AnimationCompressor& copy);
00184
00185
00186 float scaleTolerance_;
00187
00188 float rotationTolerance_;
00189
00190 float translationTolerance_;
00191
00192 VectorInterpolationCompressor* scaleCompressor_;
00193
00194 RotationInterpolationCompressor* rotationCompressor_;
00195
00196 VectorInterpolationCompressor* translationCompressor_;
00197 };
00198
00199
00200 }
00201 #endif // End of ANIMATION_COMPRESSOR_H_
00202