H3DPhysics (RigidBodyPhysics)

From H3D.org

Jump to: navigation, search

H3DPhysics is an H3DAPI wrapper implementation of current widely-used physics engines. It add simulations for rigid body and soft body dynamics.

Currently H3DPhysics supports Open Dynamic Engines (ODE), Bullet Physics and PhysX3. Notice however that the soft body implementations might not be completely finished for all physics engines (that has soft body physics support).

If you have any question/suggestion/discussion regarding this section, please post to the forum


Physics Engine



Installation on Windows

To install H3DPhysics on Windows simply download H3DViewer from H3DViewer downloads H3DPhysics is included in this installation as a plugin binary to H3DViewer. If x3d example files are desired then use the full H3D installation package instead H3D downloads

Building from source

To build H3DPhysics on Windows follow these steps.

  1. Obtain the source code by using the full H3D installation package as in instructions above.
  2. Start CMake GUI. Put the search path to CMakeLists.txt in the first text box in this GUI. On a standard installation the search path is C:\H3D\H3DPhysics\build. Put the search path to where the generate projects will be build in the second text box, for example C:\H3D\H3DPhysics\build\mybuild. Press the Configure button and choose the compiler for which CMake will generate build files. Then wait while CMake tries to detect what libraries are installed on your system. If everything went fine then the "OK" button should light up and when it is pressed the project files will be generated. If CMake could not find all libraries then these paths can be manually specified. All such paths are advanced variables so the "show advanced" checkbox must be active.

    All libraries needed for building H3DPhysics with support for ODE and bullet are included in the distribution, note that the libraries might only link against a specific version of Visual Studio.
  3. Open the projects and start building. When generating project files for Microsoft Visual Studio the project file to open is the solution file generated.
  4. When the H3DPhysics library finished building build the INSTALL project once. This will copy library files and binary files to a bin and lib folder in the location set by CMAKE_INSTALL_PREFIX. The value of this variable can be seen in the CMake GUI. On a default installation this will be C:\H3D\H3DPhysics\bin32. This default location is the location in which the provided examples and the CMakeLists.txt for other project depending on H3DPhysics will look for the binaries for H3DPhysics.

Installation on GNU/Linux

You might need to build H3DPhysics on Linux yourself. In order for H3DPhysics to work properly, you first need a physics engine to drive the physics. Both the ODE and Bullet engines are open-source engines supported by H3D.

ODE can be installed using:
sudo apt install libode-dev

Bullet can be installed using:
sudo apt install libbullet-dev

To build H3DPhysics on Linux follow these steps.

  1. Build and install H3DAPI.
  2. If you did not use the debian packages then download the source for H3DPhysics.
  3. To generate the make files use the terminal and change folder to the H3DPhysics/build folder and write:
    cmake .

    To build H3DPhysics write: (tip: write "make -j3" if you have a core duo, and "make -j5" for quads: faster)

    To install H3DPhysics write:
    sudo make install

    H3DPhysics header and libraries are now installed on your system. But there is no application installed that use H3DPhysics libraries. However, if you load any of the H3DPhysics x3d examples they should load the binary and work just fine.

Installation on Mac OS

Either download and build from source or consider using macports to just install the h3dphysics library (and its dependencies).

Personal tools
go to