// All default parameter values are set here. There should be no values set in the // variable definitions. private void GetInitialParameterValues(IConfigSource config) { ConfigurationParameters parms = new ConfigurationParameters(); UnmanagedParams[0] = parms; BSParam.SetParameterDefaultValues(this); if (config != null) { // If there are specifications in the ini file, use those values IConfig pConfig = config.Configs["BulletSim"]; if (pConfig != null) { BSParam.SetParameterConfigurationValues(this, pConfig); // There are two Bullet implementations to choose from BulletEngineName = pConfig.GetString("BulletEngine", "BulletUnmanaged"); // Very detailed logging for physics debugging // TODO: the boolean values can be moved to the normal parameter processing. m_physicsLoggingEnabled = pConfig.GetBoolean("PhysicsLoggingEnabled", false); m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); m_physicsPhysicalDumpEnabled = pConfig.GetBoolean("PhysicsPhysicalDumpEnabled", false); // Very detailed logging for vehicle debugging VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); // Do any replacements in the parameters m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName); } else { // Nothing in the configuration INI file so assume unmanaged and other defaults. BulletEngineName = "BulletUnmanaged"; m_physicsLoggingEnabled = false; VehicleLoggingEnabled = false; } // The material characteristics. BSMaterials.InitializeFromDefaults(Params); if (pConfig != null) { // Let the user add new and interesting material property values. BSMaterials.InitializefromParameters(pConfig); } } }
// All default parameter values are set here. There should be no values set in the // variable definitions. private void GetInitialParameterValues(IConfigSource config) { ConfigurationParameters parms = new ConfigurationParameters(); UnmanagedParams[0] = parms; BSParam.SetParameterDefaultValues(this); if (config != null) { // If there are specifications in the ini file, use those values IConfig pConfig = config.Configs["BulletSim"]; if (pConfig != null) { BSParam.SetParameterConfigurationValues(this, pConfig); // Very detailed logging for physics debugging m_physicsLoggingEnabled = pConfig.GetBoolean("PhysicsLoggingEnabled", false); m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); // Very detailed logging for vehicle debugging VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); // Do any replacements in the parameters m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName); } // The material characteristics. BSMaterials.InitializeFromDefaults(Params); if (pConfig != null) { // Let the user add new and interesting material property values. BSMaterials.InitializefromParameters(pConfig); } } }