H3DPhysics (RigidBodyPhysics)

From H3D.org

Jump to: navigation, search

H3DPhysics is an H3DAPI 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, PhysX and in development is PhysX3 and SOFA. Notice however that the soft body implementations might not be completely finished for all physics engined. If you are interested in implementing support for any other physics engines, please contact us.

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


Physics Engine



Developers Notes

Installation on Windows

To install H3DPhysics on Windows simply download H3DViewer from http://www.h3dapi.org/modules/PDdownloads/viewcat.php?cid=28 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 http://www.h3dapi.org/modules/PDdownloads/viewcat.php?cid=14

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\vc10. 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. It might be so that the Configure button will have to be pressed again after the first configure run. 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 Visual Studio 2010.
  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. 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

    MedX3D 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

NOTE: I am not sure that this is true anymore. Please test H3DViewer bundle or build it yourself and test. Perhaps H3DPhysics is in the bundle

Personal tools
go to