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_CHARACTER_MESH_H_ 00026 #define TRANSLATION_CHARACTER_MESH_H_ 00027 00028 #include <Translator/Mesh/TranslationMesh.h> 00029 #include <Core/Container/ArrayList.h> 00030 00031 namespace Lamp{ 00032 class Mesh; 00033 } 00034 00035 namespace LampForMaya{ 00036 00037 //------------------------------------------------------------------------------ 00038 /** 00039 * 変換キャラクタメッシュ 00040 */ 00041 class TranslationCharacterMesh : public TranslationMesh{ 00042 friend class TranslationMeshManager; 00043 public: 00044 /** 00045 * デストラクタ 00046 */ 00047 virtual ~TranslationCharacterMesh(); 00048 00049 /** 00050 * キャラクタメッシュかどうか 00051 * @return キャラクタメッシュならtrue 00052 */ 00053 virtual bool isCharacterMesh() const{ return true; } 00054 00055 //-------------------------------------------------------------------------- 00056 /** 00057 * 論理チェック 00058 * @return 成功すればtrue 00059 */ 00060 virtual bool logicalCheck(); 00061 00062 //-------------------------------------------------------------------------- 00063 /** 00064 * Lampへの変換 00065 * @param scene シーン 00066 * @return 成功すればtrue 00067 */ 00068 virtual bool convertToLamp(Scene* scene); 00069 00070 //-------------------------------------------------------------------------- 00071 /** 00072 * インデックスの追加 00073 * @param index 追加するインデックス 00074 */ 00075 virtual void addIndex(int index){ indices_.add(index); } 00076 00077 /** 00078 * ウェイトの設定 00079 * @param boneCount ボーン数 00080 * @param weights ウェイト 00081 * @param weightCounts 各頂点のウェイト数 00082 */ 00083 virtual bool setWeights( 00084 int boneCount, float* weights, int* weightCounts); 00085 00086 protected: 00087 /** 00088 * コンストラクタ 00089 * @param initializeName 初期化する名前 00090 */ 00091 TranslationCharacterMesh(const String& initializeName); 00092 00093 /** 00094 * キャラクタメッシュへの変換 00095 * @param scene シーン 00096 * @return メッシュ 00097 */ 00098 virtual Mesh* convertCharacterMesh(Scene* scene); 00099 00100 private: 00101 // コピーコンストラクタの隠蔽 00102 TranslationCharacterMesh(const TranslationCharacterMesh& copy); 00103 00104 // 代入コピーの隠蔽 00105 void operator =(const TranslationCharacterMesh& copy); 00106 00107 // インデックス配列 00108 ArrayList<int> indices_; 00109 // 最大ウェイト数 00110 int maxWeightCount_; 00111 // ウェイト 00112 float* weights_; 00113 // ボーンインデックス 00114 int* boneIndices_; 00115 }; 00116 00117 //------------------------------------------------------------------------------ 00118 } // End of namespace LampForMaya 00119 #endif // End of TRANSLATION_CHARACTER_MESH_H_ 00120 //------------------------------------------------------------------------------