/* ------------------------ * メイン関数 ------------------------ */ int main(int argc, char *argv[]) { /* txtデータ読み込み */ LoadTxt("route.txt", routeX, routeY, routeZ, &lineRoute); LoadTxt("obstacle.txt", obstX, obstY, obstZ, &lineObst); /* ODEの初期化 */ dInitODE(); /* 描画関数の設定 */ setDrawStuff(); /* ワールド, スペース, 接触点グループの生成 */ world = dWorldCreate(); space = dHashSpaceCreate(0); contactgroup = dJointGroupCreate(0); /* 地面, 重力の生成 */ ground = dCreatePlane(space,0,0,1,0); dWorldSetGravity(world, 0.0, 0.0, -9.8); /* CFM, ERPの設定 */ dWorldSetCFM(world,1e-3); dWorldSetERP(world,0.8); /* 全方向移動ロボットの生成 */ t1 = clock(); MakeBox(); MakeOmni(); /* シミュレーションループ */ dsSimulationLoop(argc,argv,640,480,&fn); /* 接触点グループ, スペース, ワールドの破壊, ODEの終了 */ dJointGroupDestroy(contactgroup); dSpaceDestroy(space); dWorldDestroy(world); dCloseODE(); return 0; }
PSch TSch::LoadTxt(const TStr& FNm){ PSIn SIn=PSIn(new TFIn(FNm)); TILx Lx(SIn, TFSet()|iloRetEoln|iloSigNum|iloCsSens); return LoadTxt(Lx); }