Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

AnimationCompressor.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Lamp : Open source game middleware
00003 // Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //------------------------------------------------------------------------------
00019 
00020 /** @file
00021  * アニメーション圧縮ヘッダ
00022  * @author Junpee
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      * @param animation 圧縮するアニメーション
00062      */
00063     virtual void compress(Animation* animation);
00064 
00065     //--------------------------------------------------------------------------
00066     // パラメータ
00067     //--------------------------------------------------------------------------
00068     /**
00069      * スケール誤差の設定
00070      * @param scaleTolerance スケール誤差
00071      */
00072     virtual void setScaleTolerance(float scaleTolerance){
00073         Assert(scaleTolerance >= 0.f)
00074         scaleTolerance_ = scaleTolerance;
00075     }
00076 
00077     /**
00078      * スケール誤差の取得
00079      * @return スケール誤差
00080      */
00081     virtual float getScaleTolerance() const{ return scaleTolerance_; }
00082 
00083     //--------------------------------------------------------------------------
00084     /**
00085      * 回転誤差の設定
00086      * @param rotationTolerance 回転誤差
00087      */
00088     virtual void setRotationTolerance(float rotationTolerance){
00089         Assert(rotationTolerance >= 0.f)
00090         rotationTolerance_ = rotationTolerance;
00091     }
00092 
00093     /**
00094      * 回転誤差の取得
00095      * @return 回転誤差
00096      */
00097     virtual float getRotationTolerance() const{
00098         return rotationTolerance_;
00099     }
00100 
00101     //--------------------------------------------------------------------------
00102     /**
00103      * 移動誤差の設定
00104      * @param translationTolerance 移動誤差
00105      */
00106     virtual void setTranslationTolerance(float translationTolerance){
00107         Assert(translationTolerance >= 0.f)
00108         translationTolerance_ = translationTolerance;
00109     }
00110 
00111     /**
00112      * 移動誤差の取得
00113      * @return 移動誤差
00114      */
00115     virtual float getTranslationTolerance() const{
00116         return translationTolerance_;
00117     }
00118 
00119 protected:
00120     //--------------------------------------------------------------------------
00121     // 圧縮
00122     //--------------------------------------------------------------------------
00123     /**
00124      * アニメーションの圧縮
00125      * @param animation アニメーション
00126      */
00127     virtual void compressAnimation(Animation* animation);
00128 
00129     /**
00130      * アニメーションセットの圧縮
00131      * @param animation アニメーションセット
00132      */
00133     virtual void compressAnimationSet(AnimationSet* animation);
00134 
00135     /**
00136      * カメラアニメーションの圧縮
00137      * @param animation カメラアニメーション
00138      */
00139     virtual void compressCameraAnimation(CameraAnimation* animation);
00140 
00141     /**
00142      * シーンノードアニメーションの圧縮
00143      * @param animation シーンノードアニメーション
00144      */
00145     virtual void compressSceneNodeAnimation(SceneNodeAnimation* animation);
00146 
00147     /**
00148      * キャラクタモデルアニメーションの圧縮
00149      * @param animation キャラクタモデルアニメーション
00150      */
00151     virtual void compressCharacterModelAnimation(
00152         CharacterModelAnimation* animation);
00153 
00154     //--------------------------------------------------------------------------
00155     // ユーティリティ
00156     //--------------------------------------------------------------------------
00157     /**
00158      * スケールの圧縮
00159      * @param interpolator スケール補間
00160      */
00161     virtual VectorInterpolator* compressScale(VectorInterpolator* interpolator);
00162 
00163     /**
00164      * 回転の圧縮
00165      * @param interpolator 回転補間
00166      */
00167     virtual RotationInterpolator* compressRotation(
00168         RotationInterpolator* interpolator);
00169 
00170     /**
00171      * 移動の圧縮
00172      * @param interpolator 移動補間
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 } // End of namespace Lamp
00201 #endif // End of ANIMATION_COMPRESSOR_H_
00202 //------------------------------------------------------------------------------

Generated on Wed Mar 16 10:29:27 2005 for Lamp by doxygen 1.3.2