How to make a new physical engine をテンプレートにして作成
開始行:
[[How to make a new physical engine]]
All the descriptions of the class,
need parentheses for
namespace Spr{;
}
.(#include doesn't care)。」~
The macro to register the name is necessary in the place ...
the class.
SGOBJECTDEF(PHTestEngine);
This can specify like the above.
This is needed #include because this is declared by <File...
+Specification of macro that registers the derivation rel...
SGOBJECTIMP(PHTestEngine, SGBehaviorEngine);
+Creating of member function in PHTestEngine class
At least, necessary one is Step(SGScene *s).~
+Creating of loader and saver.
Those below minimum necessary declaration.(to write it in...
class PHTestEngineLoader:public FIObjectLoader<PHTestEng...
public:
PHTestEngineLoader(){}
virtual bool LoadData(FILoadScene* ctx, PHTestEngine* te...
};
class PHTestEngineSaver:public FIObjectSaver<PHTestEngin...
virtual UTString GetType() const{ return "PHTestEngine"; }
virtual void SaveData(FISaveScene* ctx, FIDocNodeBase* d...
};
+Macro which register the loader and saver specify after ...
DEF_REGISTER_BOTH(PHTestEngine);
In order to using the argument here, the name must adjust...
+The data read with .X file is defined.(The data such as ...
~The definition is different the method in the next two c...
-When the data of X file pairs with the member variable m...
-When the member variable maintained in the class and dat...
wayュ「~
In the case ュ。,define it before the variable of the mem...
DEF_RECORD(XTestEngine,{
//In the code area; specify codes generated by ~...
GUID Guid(){ return WBGuid("CODE"); }
Data declaration;
});
Because data declaration should be a data type matched to...
typedef Vec3f Vector;
it is necessary to match the type like that.
+The definition of data is registered by the loader.
The registers is performed the constructor of the loader.
UTRef<FITypeDescDb> db = new FITypeDescDb;
db->SetPrefix("X");
db->REG_FIELD(Vector); //Matched Declare type
db->REG_RECORD_PROTO(XTestEngine); //adjust it to the fi...
+Data is substituted for the member variable.The content ...
In the case ュ。,
XTestEngine tes;
the member variable is described like above.~
In the case ュ「,the member variable is described as I am...
It substitutes it by member function LoadData() of the lo...
In the case ュ。,
virtual bool LoadData(FILoadScene* ctx, PHMTestEngine* t...
ctx->docs.Top()->GetWholeData(test->tes);
return true;
}
When you substitute it for data inversely,
virtual void SaveData(FISaveScene* ctx, FIDocNodeBase* d...
doc->SetWholeData(test->tes);
}
In the case ュ「,
virtual bool LoadData(FILoadScene* ctx, PHMTestEngine* t...
XTestEngine tes;
ctx->docs.Top()->GetWholeData(test->tes);
substitute it for the member variable in your original t...
return true;
}
When you substitute it for data inversely,
virtual void SaveData(FISaveScene* ctx, FIDocNodeBase* d...
XTestEngine tes;
substitute it for the above structure in your original t...
doc->SetWholeData(test->tes);
}
+Data such as Solid is substituted for the member variabl...
Use AddChildObject(SGObject* o, SGScene* s).~
This is declared as a member function of the PHtestEngine...
if (DCAST([Class name of data], o)){
[Member Var. of this Class].push_back((PHSolid*)o);
return true;
}
return false;
+At the end, the class that added it to PHRegisterLoader....
終了行:
[[How to make a new physical engine]]
All the descriptions of the class,
need parentheses for
namespace Spr{;
}
.(#include doesn't care)。」~
The macro to register the name is necessary in the place ...
the class.
SGOBJECTDEF(PHTestEngine);
This can specify like the above.
This is needed #include because this is declared by <File...
+Specification of macro that registers the derivation rel...
SGOBJECTIMP(PHTestEngine, SGBehaviorEngine);
+Creating of member function in PHTestEngine class
At least, necessary one is Step(SGScene *s).~
+Creating of loader and saver.
Those below minimum necessary declaration.(to write it in...
class PHTestEngineLoader:public FIObjectLoader<PHTestEng...
public:
PHTestEngineLoader(){}
virtual bool LoadData(FILoadScene* ctx, PHTestEngine* te...
};
class PHTestEngineSaver:public FIObjectSaver<PHTestEngin...
virtual UTString GetType() const{ return "PHTestEngine"; }
virtual void SaveData(FISaveScene* ctx, FIDocNodeBase* d...
};
+Macro which register the loader and saver specify after ...
DEF_REGISTER_BOTH(PHTestEngine);
In order to using the argument here, the name must adjust...
+The data read with .X file is defined.(The data such as ...
~The definition is different the method in the next two c...
-When the data of X file pairs with the member variable m...
-When the member variable maintained in the class and dat...
wayュ「~
In the case ュ。,define it before the variable of the mem...
DEF_RECORD(XTestEngine,{
//In the code area; specify codes generated by ~...
GUID Guid(){ return WBGuid("CODE"); }
Data declaration;
});
Because data declaration should be a data type matched to...
typedef Vec3f Vector;
it is necessary to match the type like that.
+The definition of data is registered by the loader.
The registers is performed the constructor of the loader.
UTRef<FITypeDescDb> db = new FITypeDescDb;
db->SetPrefix("X");
db->REG_FIELD(Vector); //Matched Declare type
db->REG_RECORD_PROTO(XTestEngine); //adjust it to the fi...
+Data is substituted for the member variable.The content ...
In the case ュ。,
XTestEngine tes;
the member variable is described like above.~
In the case ュ「,the member variable is described as I am...
It substitutes it by member function LoadData() of the lo...
In the case ュ。,
virtual bool LoadData(FILoadScene* ctx, PHMTestEngine* t...
ctx->docs.Top()->GetWholeData(test->tes);
return true;
}
When you substitute it for data inversely,
virtual void SaveData(FISaveScene* ctx, FIDocNodeBase* d...
doc->SetWholeData(test->tes);
}
In the case ュ「,
virtual bool LoadData(FILoadScene* ctx, PHMTestEngine* t...
XTestEngine tes;
ctx->docs.Top()->GetWholeData(test->tes);
substitute it for the member variable in your original t...
return true;
}
When you substitute it for data inversely,
virtual void SaveData(FISaveScene* ctx, FIDocNodeBase* d...
XTestEngine tes;
substitute it for the above structure in your original t...
doc->SetWholeData(test->tes);
}
+Data such as Solid is substituted for the member variabl...
Use AddChildObject(SGObject* o, SGScene* s).~
This is declared as a member function of the PHtestEngine...
if (DCAST([Class name of data], o)){
[Member Var. of this Class].push_back((PHSolid*)o);
return true;
}
return false;
+At the end, the class that added it to PHRegisterLoader....
ページ名:
サイト内検索
and
or
メニュー
Springhead
トップページ
スクリーンショットと紹介
ダウンロード
ドキュメント
開発者向け情報
SprBlender
SprBlender
SprBlenderの特徴
SprBlender使用例
ダウンロード
ドキュメント
Choreonoid Springhead Plugin
CnoidSprPlugin
Counter: 0, today: 0, yesterday: 0