DerelictODE

DerelictODE is a D binding to the Open Dynamics Engine (ODE), a cross-platform, high performance library for simulating rigid body dynamics.

The current version of DerelictODE requires ODE 0.11 or later.

Building

To compile DerelictODE, add the DerelictODE make target to the command line when compiling Derelict. For example, to build DerelictODE on Windows with DMD, you would execute the following:

make -fwin32.mak DerelictODE DC=DMD
For more information on compiling Derelict libraries, see Building the Derelict Bindings.

Using

  1. Always make sure the DerelictODE source modules are available on your import path.
  2. In modules that make use of DerelictODE, you will need to import the derelict.ode.ode module.
  3. You must link your application with the DerelictODE and DerelictUtil libraries.
  4. Before calling any ODE functions, you need to make a call to DerelictODE.load. This will load the shared library.

The following is a complete program that loads DerelictODE:


import derelict.ode.ode;

void main()
{
	DerelictODE.load();
	
	// now you can call ODE functions
}

As with other Derelict bindings, DerelictODE will throw an exception if an error occurs while loading the shared library. For more information on Derelict exceptions, see the documentation for Using the Derelict Bindings.

Finally, the method DerelictODE.unload() is provided for convenience. In normal practice you do not need to call this function, as Derelict will unload the library automatically when the app exits. You generally should only use this function if you need to unload DerelictODE while the application is running or if you disable the automatic unloading of shared libraries (as per the documentation for the loader module).