PhysicsEngines

From OpenSimulator

Revision as of 17:40, 8 October 2007 by Danx0r (Talk | contribs)

Jump to: navigation, search

There are several physics engines available for use in OpenSim. Currently, they are "basicphysics", "OpenDynamicsEngine", "RealPhysX" & "BulletX" (modified version). The plugin "basicphysics" is the default and can be seen in the OpenSim.ini file.

  • When starting OpenSim in either Windows or Linux, one can add -physics=OpenDynamicsEngine to run the OpenDynamicsEngine (ODE) instead of basicphysics, or change the corresponding parameter in OpenSim.ini.
  • When starting OpenSim in Windows, one can add -physics=RealPhysX if one has the appropriate DLL's which are not shipped with OpenSim due to license constraints.
  • When starting OpenSim in either Windows or Linux, one can add -physics=modified_BulletX to run a modified version of the BulletX Physics Engine aka Modified BulletX. See the next information about details and progress.

To conclude, basicphysics & OpenDynamicsEngine both are appropriate for Linux and in addition, RealPhysX is appropriate as an option for Windows if the supporting DLL's are available. Modified BulletX should be fine for Windows and Linux (not the original BulletX).

Contents

Compiling ODE from source (Linux)

If you want to compile the OpenDynamicsEngine (ODE) by yourself, get the latest source code (Ver. 0.9 as of Oct '07) from http://www.ode.org/. Unpack it, switch to the ode directory and compile it as follows:

./configure --enable-shared
make -k

(I used to suggest --with-trimesh=gimpact, but no longer. As of ODE 0.9, Opcode is the preferred and best-supported collision library)

This should create a libode.a and lidode.so file in the src/ode subdirectory. Copy these two files to the opensim bin directory (after having backed up the original files there). [er, I don't think the .a file is necessary to put in bin!]

Compiling ODE from source (Windows)

the standard distribution from ode.org has a build directory, in which you will find subdirs for several Microsoft compilers.

The standard .sln files (at least for VS2005) compile ode.dll such that it depends on at least two Microsoft runtime dll's. This can cause failure and confusion, so do the following: Right-click on ode in Solution Explorer, and select properties. under Configuration Properties/General, change "Use of MFC" to read "Use MFC in a Static Library"

then compile as usual.

Modified BulletX

This is a modified version of BulletX. The original version of BulletX runs under and has code-dependencies with MS.XNA. The orginal BulletX can be found at XNADev.ru. The modified version removes all code dependencies with MS.XNA. On the other hand, it needs another library to work. This library is based on Mono.Xna and it's called MonoCompactMaths. The modified BulletX and the MonoXnaCompactMaths can be found on the svn of OpenSim. Because its code independency of MS.XNA, the modified BulletX should can be run under either MS.Net or Mono and, therefore, either Windows or Linux (obviously you can combine Windows + Mono)

BulletX Plugin in OpenSim

BulletX Plugin in OpenSim runs the modified version of BulletX. Currently, BulletX Plugin suports collisions Av2Av and Av2Prim. Prims won't move in an collision, but avies yes. By the way, collisions needs tunning. Prim2Prim collisions are currently not suported and prims are in a like non physical-state. The currently collision's behavoir are:

  • For avies, like and sphere of 1m of radious and 50Kg of mass
  • For prims, like a Box of the prim-size and a mass that it depends of its sizes. The mass it's the mass of Box of water with density = 1Kg/l = 1Kg/dm3 = 1000Kg/m3 (Be water my friend! :D).

To-do list (next changes)

Near future:

  • Add orientation management of prims (it needs an upgrade of MonoXnaCompactMaths) (sent to be added)
  • Fix re-sizing (sent to be added, It's fixed but it's not elegant :S)
  • Translate and implement the original HeightfieldTerrainShape Class of Bullet to BulletX (Modified) (sent to be added, btw it has some bugs)
  • Tune collisions

Midle future/Long Term:

  • Introduce physical check so prims could collide and roll down the hill.
  • Introduce Prim Shape Type to have more than the box shape.
Personal tools
General
About This Wiki