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_SCENE_NODE_H_ 00026 #define TRANSLATION_SCENE_NODE_H_ 00027 00028 namespace Lamp{ 00029 class Scene; 00030 class SceneNode; 00031 class AnimationManager; 00032 class AnimationSet; 00033 class VectorArrayInterpolator; 00034 class EulerArrayInterpolator; 00035 } 00036 00037 #include <Core/Container/ArrayList.h> 00038 #include "Translator/Animation/TranslationSequence.h" 00039 00040 namespace LampForMaya{ 00041 00042 class TranslationSceneNodeManager; 00043 class TranslationModelManager; 00044 00045 //------------------------------------------------------------------------------ 00046 /** 00047 * 変換シーンノード 00048 */ 00049 class TranslationSceneNode{ 00050 friend class TranslationSceneNodeManager; 00051 public: 00052 /** 00053 * デストラクタ 00054 */ 00055 virtual ~TranslationSceneNode(); 00056 00057 //-------------------------------------------------------------------------- 00058 /** 00059 * 分析 00060 * @return 成功すればtrue 00061 */ 00062 virtual bool analyze(); 00063 00064 /** 00065 * ピボットのコンパイル 00066 * @param sceneNodeManager シーンノードマネージャ 00067 * @param modelManager モデルマネージャ 00068 * @return 成功すればtrue 00069 */ 00070 virtual bool compilePivot(TranslationSceneNodeManager* sceneNodeManager, 00071 TranslationModelManager* modelManager); 00072 00073 /** 00074 * アニメーションの分析 00075 * @return 成功すればtrue 00076 */ 00077 virtual bool analyzeAnimation(); 00078 00079 //-------------------------------------------------------------------------- 00080 /** 00081 * Lampへの変換 00082 * @param scene シーン 00083 * @return 成功すればtrue 00084 */ 00085 virtual bool convertToLamp(Scene* scene); 00086 00087 /** 00088 * リンク接続 00089 * @param scene シーン 00090 * @return 成功すればtrue 00091 */ 00092 virtual bool linkConnect(Scene* scene); 00093 00094 /** 00095 * アニメーションの変換 00096 * @param animationManager アニメーションマネージャ 00097 * @param animationSet アニメーションセット 00098 * @return 成功すればtrue 00099 */ 00100 virtual bool convertAnimation( 00101 AnimationManager* animationManager, AnimationSet* animationSet); 00102 00103 //-------------------------------------------------------------------------- 00104 /** 00105 * オブジェクトの取得 00106 * @return オブジェクト 00107 */ 00108 virtual MObject getObject() const{ return object_; } 00109 00110 /** 00111 * 名前の取得 00112 * @return 名前 00113 */ 00114 virtual String getName() const{ return name_; } 00115 00116 protected: 00117 /** 00118 * コンストラクタ 00119 * @param initializePath 初期化するDagパス 00120 * @param initializeName 初期化する名前 00121 */ 00122 TranslationSceneNode( 00123 const MDagPath& initializePath,const String& initializeName); 00124 00125 /** 00126 * ゼロチェック 00127 * @param point チェックするポイント 00128 * @return ポイントが0ならtrueを返す 00129 */ 00130 virtual bool zeroCheck(const MPoint& point); 00131 00132 /// Dagパス 00133 MDagPath dagPath_; 00134 /// オブジェクト 00135 MObject object_; 00136 /// 名前 00137 String name_; 00138 /// シーンノード 00139 SceneNode* sceneNode_; 00140 00141 /// 子シーンノードリスト 00142 ArrayList<String> sceneNodes_; 00143 /// 子ライトリスト 00144 ArrayList<String> lights_; 00145 /// 子モデルリスト 00146 ArrayList<String> models_; 00147 00148 /// ピボット 00149 Vector3 pivot_; 00150 /// スケール 00151 Vector3 scale_; 00152 /// 回転 00153 Vector3 rotation_; 00154 /// 移動 00155 Vector3 translation_; 00156 /// 表示フラグ 00157 bool visibility_; 00158 00159 /// LOD分割数 00160 int lodThresholdCount_; 00161 /// LOD分割値 00162 float* lodThreshold_; 00163 00164 /// シーケンス 00165 TranslationSequence sequence_; 00166 /// スケールアニメーション 00167 VectorArrayInterpolator* scaleAnimation_; 00168 /// 回転アニメーション 00169 EulerArrayInterpolator* rotationAnimation_; 00170 /// 移動アニメーション 00171 VectorArrayInterpolator* translationAnimation_; 00172 /// アニメーションを持つか 00173 bool hasAnimation_; 00174 00175 00176 /// 最上位ノードかどうか 00177 bool isTopLevelNode_; 00178 00179 private: 00180 // コピーコンストラクタの隠蔽 00181 TranslationSceneNode(const TranslationSceneNode& copy); 00182 00183 // 代入コピーの隠蔽 00184 void operator =(const TranslationSceneNode& copy); 00185 00186 00187 }; 00188 00189 //------------------------------------------------------------------------------ 00190 } // End of namespace LampForMaya 00191 #endif // End of TRANSLATION_SCENE_NODE_H_ 00192 //------------------------------------------------------------------------------ 00193