#include <Springhead.h>
#include <Framework/SprFWApp.h>
using namespace Spr;
class MyApp : public FWApp{
public:
virtual void Init(int argc = 0, char* argv[] = 0){
FWApp::Init(argc, argv);
PHSdkIf* phSdk = GetSdk()->GetPHSdk();
PHSceneIf* phscene = GetSdk()->GetScene()->GetPHScene();
CDBoxDesc bd;
// 床を作成
PHSolidIf* floor = phscene->CreateSolid();
floor->SetDynamical(false);
bd.boxsize = Vec3f(5.0f, 1.0f, 5.0f);
floor->AddShape(phSdk->CreateShape(bd));
floor->SetFramePosition(Vec3d(0, -1.0, 0));
// 箱を作成
PHSolidIf* box = phscene->CreateSolid();
bd.boxsize = Vec3f(0.2f, 0.2f, 0.2f);
box->AddShape(phSdk->CreateShape(bd));
box->SetFramePosition(Vec3d(0.0, 1.0, 0.0));
GetSdk()->SetDebugMode(true);
}
} app;
int main(int argc, char* argv[]){
app.Init(argc, argv);
app.StartMainLoop();
return 0;
}
作成したmain.cppにTable #.#.#に示すコードを書き込んでください.これがSpringheadを使用した(ほぼ)最小のプログラムコードです.