ODEライブラリの作成

Visual Studio 2008を使用して、ODE 0.11.1のライブラリを作成する方法について解説します。

ダウンロード

次のページから「ode-0.11.1.zip」をダウンロードし、ODEのライブラリを作成します。
Get Open Dynamics Engine at SourceForge.net

ライブラリの作成

Visual Studio 2008のプロジェクト作成

ODE 0.11.1にはVisual Studio 2008用のプロジェクトが用意されていないので、Premakeを使用してこれを作成します。

パラメータにvs2008と指定することでVisual Studio 2008用のプロジェクトが作成され、「vs2005」や「vs2003」とすると、それぞれのバージョン向けに作成されます。

C:\ode-0.11.1\build>premake4 vs2008

ODE Premake
プロジェクト作成の実行画面

ビルドオプション

パラメータに「--with-demos」と付加することで、デモプログラムDrawstuffライブラリのプロジェクトも作成されます。

C:\ode-0.11.1\build>premake4 --with-demos vs2008
ビルドオプション一覧
オプション 説明
with-demos Builds the demo applications and DrawStuff library
with-tests Builds the unit test application
with-gimpact Use GIMPACT for trimesh collisions (experimental)
all-collis-libs Include sources of all collision libraries into the project
no-dif Exclude DIF (Dynamics Interchange Format) exports
no-trimesh Exclude trimesh collision geometry
no-alloca Use heap memory instead of the stack (experimental)
enable-ou Use TLS for global variables (experimental)
16bit-indices Use 16-bit indices for trimeshes (default is 32-bit)
old-trimesh Use old OPCODE trimesh-trimesh collider

プロジェクトのビルド

Visual Studioで、作成されたソリューションファイル「ode.sln」を開きます。

ODEのVisual Studioプロジェクト

ソリューション構成で「ReleaseDoubleDLL」を指定し、ソリューションをビルドします。ライブラリはC:\ode-0.11.1\lib\ReleaseDoubleDLLに作成されます。

バッチビルド

バッチビルドを使用すれば、任意のプロジェクトを選択してビルドできます。

バッチビルド
メニュー【ビルド → バッチビルド】

デモプログラムによる動作確認

ライブラリの作成後には、付属のデモプログラムで動作を確認できます。