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 COLLISION_CONVERTER_H_ 00026 #define COLLISION_CONVERTER_H_ 00027 00028 namespace Lamp{ 00029 00030 class Scene; 00031 class SceneNode; 00032 class SceneLeaf; 00033 class Mesh; 00034 00035 class CollisionScene; 00036 class CollisionNode; 00037 class CollisionLeaf; 00038 00039 //------------------------------------------------------------------------------ 00040 /** 00041 * コリジョンコンバータ 00042 */ 00043 class CollisionConverter{ 00044 public: 00045 /** 00046 * コンストラクタ 00047 */ 00048 CollisionConverter(); 00049 00050 /** 00051 * デストラクタ 00052 */ 00053 virtual ~CollisionConverter(); 00054 00055 /** 00056 * コンバート 00057 * @param scene コンバート元シーン 00058 * @param collisionScene コンバート先シーン 00059 * @return 成功すればtrue 00060 */ 00061 virtual bool convert(Scene* scene, CollisionScene* collisionScene); 00062 00063 protected: 00064 /** 00065 * ノードのコンバート 00066 * @param parentCollisionNode 親コリジョンノード 00067 * @param sceneNode シーンノード 00068 * @return 成功すればtrue 00069 */ 00070 virtual bool convertNode( 00071 CollisionNode* parentCollisionNode, SceneNode* sceneNode); 00072 00073 /** 00074 * リーフのコンバート 00075 * @param parentCollisionNode 親コリジョンノード 00076 * @param sceneLeaf シーンリーフ 00077 * @return 成功すればtrue 00078 */ 00079 virtual bool convertLeaf( 00080 CollisionNode* parentCollisionNode, SceneLeaf* sceneLeaf); 00081 00082 /** 00083 * 静的変形メッシュのコンバート 00084 * @param parentCollisionNode 親コリジョンノード 00085 * @param mesh メッシュ 00086 * @return 成功すればtrue 00087 */ 00088 virtual bool convertStaticDeformedMesh( 00089 CollisionNode* parentCollisionNode, Mesh* mesh); 00090 00091 /** 00092 * コリジョンリーフデータ設定 00093 * @param parentCollisionNode 親コリジョンノード 00094 * @param mesh メッシュ 00095 * @param collisionLeaf コリジョンリーフ 00096 * @return 成功すればtrue 00097 */ 00098 virtual bool setCollisionLeafData(CollisionNode* parentCollisionNode, 00099 Mesh* mesh, CollisionLeaf* collisionLeaf); 00100 00101 private: 00102 //-------------------------------------------------------------------------- 00103 // コピーコンストラクタの隠蔽 00104 CollisionConverter(const CollisionConverter& copy); 00105 00106 // 代入コピーの隠蔽 00107 void operator =(const CollisionConverter& copy); 00108 00109 // コリジョンシーン 00110 CollisionScene* collisionScene_; 00111 00112 }; 00113 00114 //------------------------------------------------------------------------------ 00115 } // End of namespace Lamp 00116 #endif // End of COLLISION_CONVERTER_H_ 00117 //------------------------------------------------------------------------------