* Patch from nlin to enable DIF state file writing from the ODEPlugin

* Rebuilt libode.so, ode.dll
* If you roll your own ODE library, make sure to update your opensim-libs.
0.6.0-stable
Teravus Ovares 2008-06-20 04:57:32 +00:00
parent 20e4036853
commit e02a2e31e0
5 changed files with 38 additions and 1 deletions

View File

@ -30,6 +30,7 @@ using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.IO;
using Axiom.Math; using Axiom.Math;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
@ -247,6 +248,11 @@ namespace OpenSim.Region.Physics.OdePlugin
private IConfigSource m_config; private IConfigSource m_config;
public bool physics_logging = false;
public int physics_logging_interval = 0;
public bool physics_logging_append_existing_logfile = false;
/// <summary> /// <summary>
/// Initiailizes the scene /// Initiailizes the scene
/// Sets many properties that ODE requires to be stable /// Sets many properties that ODE requires to be stable
@ -370,6 +376,10 @@ namespace OpenSim.Region.Physics.OdePlugin
avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_win", 550000f); avStandupTensor = physicsconfig.GetFloat("av_capsule_standup_tensor_win", 550000f);
bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_win", 5f); bodyMotorJointMaxforceTensor = physicsconfig.GetFloat("body_motor_joint_maxforce_tensor_win", 5f);
} }
physics_logging = physicsconfig.GetBoolean("physics_logging", false);
physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0);
physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false);
} }
} }
@ -1759,7 +1769,25 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
} }
} }
// Finished with all sim stepping. If requested, dump world state to file for debugging.
// TODO: This call to the export function is already inside lock(OdeLock) - but is an extra lock needed?
// TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots?
if(physics_logging && (physics_logging_interval>0) && (framecount % physics_logging_interval == 0) ) {
string fname = "state-" + world.ToString() + ".DIF"; // give each physics world a separate filename
string prefix = "world" + world.ToString(); // prefix for variable names in exported .DIF file
if(physics_logging_append_existing_logfile) {
string header = "-------------- START OF PHYSICS FRAME " + framecount.ToString() + " --------------";
TextWriter fwriter = File.AppendText(fname);
fwriter.WriteLine(header);
fwriter.Close();
} }
d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix);
}
}
return fps; return fps;
} }

Binary file not shown.

View File

@ -309,6 +309,15 @@ mesh_lod = 32
; number^2 physical level of detail of the sculpt texture. 16x16 - 256 verticies ; number^2 physical level of detail of the sculpt texture. 16x16 - 256 verticies
mesh_physical_lod = 16 mesh_physical_lod = 16
; ##
; ## Physics logging settings - logfiles are saved to *.DIF files
; ##
;physics_logging = true
;; every n simulation iterations, the physics snapshot file is updated
;physics_logging_interval = 50
;; append to existing physics logfile, or overwrite existing logfiles?
;physics_logging_append_existing_logfile = true
[RemoteAdmin] [RemoteAdmin]
enabled = false enabled = false

Binary file not shown.

Binary file not shown.