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

TranslationBone.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 TRANSLATION_BONE_H_
00026 #define TRANSLATION_BONE_H_
00027 
00028 #include <Core/Container/ArrayList.h>
00029 
00030 namespace Lamp{
00031     class CharacterModel;
00032     class VectorArrayInterpolator;
00033     class EulerArrayInterpolator;
00034     class VectorInterpolator;
00035     class RotationInterpolator;
00036 }
00037 
00038 namespace LampForMaya{
00039 
00040 class TranslationCharacterModel;
00041 
00042 //------------------------------------------------------------------------------
00043 /**
00044  * 変換ボーン
00045  */
00046 class TranslationBone{
00047 friend class TranslationCharacterModel;
00048 protected:
00049 
00050     /**
00051      * コンストラクタ
00052      */
00053     TranslationBone();
00054 
00055     /**
00056      * デストラクタ
00057      */
00058     virtual ~TranslationBone();
00059 
00060     //--------------------------------------------------------------------------
00061     /**
00062      * 分析
00063      * @return 成功すればtrue
00064      */
00065     virtual bool analyze(const MDagPath& dagPath);
00066 
00067     /**
00068      * モデル行列の構築
00069      * @param characterModel 変換キャラクタモデル
00070      * @param parentMatrix 親行列
00071      */
00072     virtual void buildModelMatrix(
00073         TranslationCharacterModel* characterModel, const Matrix34& parentMatrix);
00074 
00075     /**
00076      * アニメーションの分析
00077      * @param startTime 開始時間
00078      * @param endTime 終了時間
00079      * @return 成功すればtrue
00080      */
00081     virtual bool analyzeAnimation(int startTime, int endTime);
00082 
00083     //--------------------------------------------------------------------------
00084     /**
00085      * 名前の取得
00086      * @return 名前
00087      */
00088     const String& getName() const{ return name_; }
00089 
00090     /**
00091      * ポーズ逆行列の取得
00092      * @return ポーズ逆行列
00093      */
00094     const Matrix34& getInversePoseMatrix() const{ return inversePoseMatrix_; }
00095 
00096     /**
00097      * Lampへの変換
00098      * @param model キャラクタモデル
00099      * @return 成功すればtrue
00100      */
00101     virtual bool convertToLamp(CharacterModel* model);
00102 
00103     /**
00104      * ボーンのリンク
00105      * @param model キャラクタモデル
00106      * @param index ボーンのインデックス
00107      * @return 成功すればtrue
00108      */
00109     virtual bool boneLink(CharacterModel* model, int index);
00110 
00111     /**
00112      * スケールアニメーションの取得
00113      * @param startTime 開始時間
00114      * @param endTime 終了時間
00115      * @return スケールアニメーション
00116      */
00117     virtual VectorInterpolator* getScaleAnimation(int startTime, int endTime);
00118 
00119     /**
00120      * 回転アニメーションの取得
00121      * @param startTime 開始時間
00122      * @param endTime 終了時間
00123      * @return 回転アニメーション
00124      */
00125     virtual RotationInterpolator* getRotationAnimation(
00126         int startTime, int endTime);
00127 
00128     /**
00129      * 移動アニメーションの取得
00130      * @param startTime 開始時間
00131      * @param endTime 終了時間
00132      * @return 移動アニメーション
00133      */
00134     virtual VectorInterpolator* getTranslationAnimation(
00135         int startTime, int endTime);
00136 
00137 private:
00138     // コピーコンストラクタの隠蔽
00139     TranslationBone(const TranslationBone& copy);
00140 
00141     // 代入コピーの隠蔽
00142     void operator =(const TranslationBone& copy);
00143 
00144     // ポーズ行列
00145     Matrix34 inversePoseMatrix_;
00146     /// ボーンリスト
00147     ArrayList<String> bones_;
00148     // Dagパス
00149     MDagPath dagPath_;
00150     // オブジェクト
00151     MObject object_;
00152     // 名前
00153     String name_;
00154     // ジョイント回転
00155     Vector3 jointRotation_;
00156     // オリジナル回転
00157     Vector3 originalRotation_;
00158     // スケール
00159     Vector3 scale_;
00160     // 回転
00161     Vector3 rotation_;
00162     // 移動
00163     Vector3 translation_;
00164 
00165     /// スケールアニメーション
00166     VectorArrayInterpolator* scaleAnimation_;
00167     /// 回転アニメーション
00168     EulerArrayInterpolator* rotationAnimation_;
00169     /// 移動アニメーション
00170     VectorArrayInterpolator* translationAnimation_;
00171 };
00172 
00173 //------------------------------------------------------------------------------
00174 } // End of namespace Lamp
00175 #endif // End of TRANSLATION_BONE_H_
00176 //------------------------------------------------------------------------------

Generated on Wed Mar 16 10:29:55 2005 for LampForMaya by doxygen 1.3.2