/// <summary>
/// Initialise world with the specified SimulationParameters.
/// </summary>
/// <param name="simParams"></param>
protected void InitSimulationWorld(SimulationParameters simParams)
{
_simParams = simParams;
_world = CreateBox2DWorld();
// Allow physics calcs to use values from previous timestep.
_world.SetWarmStarting(_simParams._warmStarting);
// Enable additional collision detection for high speed objects (that might not ever contact each other at a given timestep due to speed).
_world.SetContinuousPhysics(_simParams._continuousPhysics);
// Put stuff in the world.
PopulateWorld();
// Create contact listener.
ContactListener contactListener = CreateContactListener();
if(null != contactListener) {
_world.SetContactListener(contactListener);
}
}