Bulletsim physics running on OS X again

Running bulletsim on OS X has been impossible because the libBulletSim.dylib library distributed with OpenSim had a pesky memory leak that could allocate as much as 5 MB/sec exhausting the address space of 32-bit mono in a matter of minutes for some configurations. 

The BulletSim developer, Robert Adams, also known as Misterblue finally managed to compile an updated version without the memory leak after xmir grid had provided for him a build environment for building 32-bit dylibs with the now deprecated GCC 4.2.1 compiler in Apple’s Xcode. 

The build environment is installed on a system running OS X 10.8 with Xcode 4.6.2 and some library patches from Xcode 4.3.3. This also happens to be the build environment Linden Lab use to build their current versions of the SecondLife viewer for Mac.

BulletSim

Bulletsim is the version of the Bullet physics engine optimized to work with OpenSim, and should over time provide much better physics for avatars, vehicles and other objects that behave like physical objects (being influenced by gravity) compared to the ODE physics engine that was previously the default up to OpenSim version 0.8.

The Bullet physics engine is also included in Apple’s SpriteKit and SceneKit providing physics capabilities for games on OS X and iOS built on those frameworks. A short demo of how physics is applied to particles and objects in an iPad game can be seen in this demo.

VAR regions now also possible on OS X

Having bulletsim working also for OS X based installations of opensim also makes it possible to use another feature of OpenSim 0.8; VAR regions. 

A VAR region is a region that extends over a number of the standard size 256x256 meter region. Currently the number of standard regions in a VAR region must be multiples of 256 for a maximum of 8192 and they must be square. This makes it possible to tile the standard regions in 2x2, 3x3, 4x4, 5x5 and so on up to a maximum of 32x32. Because of increased CPU and memory use for a VAR region, many find that a 4x4 tile is the maximum practical tile they want to use.

The big advantage of a VAR region is that you can navigate the entire region without the lag and effects of region crossings, making them ideal for driving, sailing and other activities requiring large areas without interruptions. 

Note that only a few viewers supports VAR regions. 

Where to get the updated dylib?

The updated libBulletSim.dylib has yet to make it into a release version of OpenSim, so you will have to pull it from the OpenSim Master branch which can be found at git in the OpenSim repository.

Use the "Download ZIP” button to download to your local machine and navigate to the “opensim/bin/lib32” folder to find the updated libBulletSim.dylib

To replace the old file with the new one, copy the updated libBulletSim.dylib into the bin/lib32 folder of your OpenSim installation. 

To enable bulletsim, make sure that the line that contains physics = bulletsim is uncommented in the [Startup] section of OpenSim.ini so it looks like this

;; Choose one of the physics engines below

 ;# {physics} {} {Select physics engine} {OpenDynamicsEngine BulletSim basicphysics POS} BulletSim

    ;; BulletSim is the default physics engine.  It provides the best performance and most functionality.

    ;; BulletSim supports varregions.

    ;; OpenDynamicsEngine was the previous default physics engine in OpenSimulator 0.7.6.1 and before.  

    ;; It continues to provide a workable physics implementation.  It does not currently support varregions.

    ;; basicphysics effectively does not model physics at all, making all objects phantom.   

    ;; Default is BulletSim

    ; physics = OpenDynamicsEngine

     physics = BulletSim

    ; physics = basicphysics

    ; physics = POS


Your [BulletSim] section of OpenSim.ini should look like this

[BulletSim]

    UseSeparatePhysicsThread = true

    TerrainImplementation=0


After making these changes you should be able to successfully start up opensim in the usual way with BulletSim enabled. 

Please contact me here or in-world at xmir if you have questions or need help to get this set up on your OS X system. 

hypergrid address: hop://grid.xmir.org:8002                                             xmir © 2014-2022