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_CAMERA_H_ 00026 #define TRANSLATION_CAMERA_H_ 00027 00028 namespace Lamp{ 00029 class Scene; 00030 class Camera; 00031 class AnimationManager; 00032 class AnimationSet; 00033 class VectorArrayInterpolator; 00034 class EulerArrayInterpolator; 00035 } 00036 00037 #include "Translator/Animation/TranslationSequence.h" 00038 00039 namespace LampForMaya{ 00040 00041 //------------------------------------------------------------------------------ 00042 /** 00043 * 変換カメラ 00044 */ 00045 class TranslationCamera{ 00046 friend class TranslationCameraManager; 00047 public: 00048 /** 00049 * デストラクタ 00050 */ 00051 virtual ~TranslationCamera(); 00052 00053 //-------------------------------------------------------------------------- 00054 /** 00055 * 分析 00056 * @return 成功すればtrue 00057 */ 00058 virtual bool analyze(); 00059 00060 /** 00061 * アニメーションの分析 00062 * @return 成功すればtrue 00063 */ 00064 virtual bool analyzeAnimation(); 00065 00066 //-------------------------------------------------------------------------- 00067 /** 00068 * Lampへの変換 00069 * @param scene シーン 00070 * @return 成功すればtrue 00071 */ 00072 virtual bool convertToLamp(Scene* scene); 00073 00074 /** 00075 * アニメーションの変換 00076 * @param animationManager アニメーションマネージャ 00077 * @param animationSet アニメーションセット 00078 * @return 成功すればtrue 00079 */ 00080 virtual bool convertAnimation( 00081 AnimationManager* animationManager, AnimationSet* animationSet); 00082 00083 //-------------------------------------------------------------------------- 00084 /** 00085 * オブジェクトの取得 00086 * @return オブジェクト 00087 */ 00088 virtual MObject getObject() const{ return object_; } 00089 00090 /** 00091 * 名前の取得 00092 * @return 名前 00093 */ 00094 virtual String getName() const{ return name_; } 00095 00096 protected: 00097 /** 00098 * コンストラクタ 00099 * @param initializePath 初期化するDagパス 00100 * @param initializeName 初期化する名前 00101 */ 00102 TranslationCamera( 00103 const MDagPath& initializePath,const String& initializeName); 00104 00105 /** 00106 * ゼロチェック 00107 * @param point チェックするポイント 00108 * @return ポイントが0ならtrueを返す 00109 */ 00110 virtual bool zeroCheck(const MPoint& point); 00111 00112 /// Dagパス 00113 MDagPath dagPath_; 00114 /// オブジェクト 00115 MObject object_; 00116 /// 名前 00117 String name_; 00118 /// カメラ 00119 Camera* camera_; 00120 00121 /// 回転 00122 Vector3 rotation_; 00123 /// 移動 00124 Vector3 translation_; 00125 00126 /// シーケンス 00127 TranslationSequence sequence_; 00128 /// 回転アニメーション 00129 EulerArrayInterpolator* rotationAnimation_; 00130 /// 移動アニメーション 00131 VectorArrayInterpolator* translationAnimation_; 00132 /// アニメーションを持つか 00133 bool hasAnimation_; 00134 00135 private: 00136 // コピーコンストラクタの隠蔽 00137 TranslationCamera(const TranslationCamera& copy); 00138 00139 // 代入コピーの隠蔽 00140 void operator =(const TranslationCamera& copy); 00141 00142 00143 }; 00144 00145 //------------------------------------------------------------------------------ 00146 } // End of namespace LampForMaya 00147 #endif // End of TRANSLATION_CAMERA_H_ 00148 //------------------------------------------------------------------------------ 00149