aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
authorRobert Adams2012-08-17 10:40:34 -0700
committerRobert Adams2012-08-17 13:34:18 -0700
commitccc69d66a135e149dbe9c6b70df0c8efe1265f65 (patch)
tree4e755d6cd2a1c57fde67fa8d116bdb3dfa303bb6 /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
parentBulletSim: comments and parameter changes in dynamics engine. (diff)
downloadopensim-SC_OLD-ccc69d66a135e149dbe9c6b70df0c8efe1265f65.zip
opensim-SC_OLD-ccc69d66a135e149dbe9c6b70df0c8efe1265f65.tar.gz
opensim-SC_OLD-ccc69d66a135e149dbe9c6b70df0c8efe1265f65.tar.bz2
opensim-SC_OLD-ccc69d66a135e149dbe9c6b70df0c8efe1265f65.tar.xz
BulletSim: add parameters and functionality to specify the mesh
level of detail for large meshes. Remove parameter and code for DetailLog (conditional logging into regular log file).
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs54
1 files changed, 26 insertions, 28 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 0a0e27e..d901ff0 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -73,8 +73,6 @@ public class BSScene : PhysicsScene, IPhysicsParameters
73 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 73 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
74 private static readonly string LogHeader = "[BULLETS SCENE]"; 74 private static readonly string LogHeader = "[BULLETS SCENE]";
75 75
76 public void DebugLog(string mm, params Object[] xx) { if (ShouldDebugLog) m_log.DebugFormat(mm, xx); }
77
78 public string BulletSimVersion = "?"; 76 public string BulletSimVersion = "?";
79 77
80 private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>(); 78 private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>();
@@ -101,16 +99,11 @@ public class BSScene : PhysicsScene, IPhysicsParameters
101 private int m_detailedStatsStep = 0; 99 private int m_detailedStatsStep = 0;
102 100
103 public IMesher mesher; 101 public IMesher mesher;
104 private float m_meshLOD; 102 // Level of Detail values kept as float because that's what the Meshmerizer wants
105 public float MeshLOD 103 public float MeshLOD { get; private set; }
106 { 104 public float MeshMegaPrimLOD { get; private set; }
107 get { return m_meshLOD; } 105 public float MeshMegaPrimThreshold { get; private set; }
108 } 106 public float SculptLOD { get; private set; }
109 private float m_sculptLOD;
110 public float SculptLOD
111 {
112 get { return m_sculptLOD; }
113 }
114 107
115 private BulletSim m_worldSim; 108 private BulletSim m_worldSim;
116 public BulletSim World 109 public BulletSim World
@@ -185,8 +178,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters
185 ConfigurationParameters[] m_params; 178 ConfigurationParameters[] m_params;
186 GCHandle m_paramsHandle; 179 GCHandle m_paramsHandle;
187 180
188 public bool ShouldDebugLog { get; private set; } 181 // Handle to the callback used by the unmanaged code to call into the managed code.
189 182 // Used for debug logging.
183 // Need to store the handle in a persistant variable so it won't be freed.
190 private BulletSimAPI.DebugLogCallback m_DebugLogCallbackHandle; 184 private BulletSimAPI.DebugLogCallback m_DebugLogCallbackHandle;
191 185
192 // Sometimes you just have to log everything. 186 // Sometimes you just have to log everything.
@@ -905,16 +899,26 @@ public class BSScene : PhysicsScene, IPhysicsParameters
905 (s) => { return s.NumericBool(s._forceSimplePrimMeshing); }, 899 (s) => { return s.NumericBool(s._forceSimplePrimMeshing); },
906 (s,p,l,v) => { s._forceSimplePrimMeshing = s.BoolNumeric(v); } ), 900 (s,p,l,v) => { s._forceSimplePrimMeshing = s.BoolNumeric(v); } ),
907 901
908 new ParameterDefn("MeshLOD", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", 902 new ParameterDefn("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)",
909 8f, 903 8f,
910 (s,cf,p,v) => { s.m_meshLOD = cf.GetInt(p, (int)v); }, 904 (s,cf,p,v) => { s.MeshLOD = (float)cf.GetInt(p, (int)v); },
911 (s) => { return (float)s.m_meshLOD; }, 905 (s) => { return s.MeshLOD; },
912 (s,p,l,v) => { s.m_meshLOD = (int)v; } ), 906 (s,p,l,v) => { s.MeshLOD = v; } ),
913 new ParameterDefn("SculptLOD", "Level of detail to render sculpties (32, 16, 8 or 4. 32=most detailed)", 907 new ParameterDefn("MeshLevelOfDetailMegaPrim", "Level of detail to render meshes larger than threshold meters",
908 16f,
909 (s,cf,p,v) => { s.MeshMegaPrimLOD = (float)cf.GetInt(p, (int)v); },
910 (s) => { return s.MeshMegaPrimLOD; },
911 (s,p,l,v) => { s.MeshMegaPrimLOD = v; } ),
912 new ParameterDefn("MeshLevelOfDetailMegaPrimThreshold", "Size (in meters) of a mesh before using MeshMegaPrimLOD",
913 10f,
914 (s,cf,p,v) => { s.MeshMegaPrimThreshold = (float)cf.GetInt(p, (int)v); },
915 (s) => { return s.MeshMegaPrimThreshold; },
916 (s,p,l,v) => { s.MeshMegaPrimThreshold = v; } ),
917 new ParameterDefn("SculptLevelOfDetail", "Level of detail to render sculpties (32, 16, 8 or 4. 32=most detailed)",
914 32f, 918 32f,
915 (s,cf,p,v) => { s.m_sculptLOD = cf.GetInt(p, (int)v); }, 919 (s,cf,p,v) => { s.SculptLOD = (float)cf.GetInt(p, (int)v); },
916 (s) => { return (float)s.m_sculptLOD; }, 920 (s) => { return s.SculptLOD; },
917 (s,p,l,v) => { s.m_sculptLOD = (int)v; } ), 921 (s,p,l,v) => { s.SculptLOD = v; } ),
918 922
919 new ParameterDefn("MaxSubStep", "In simulation step, maximum number of substeps", 923 new ParameterDefn("MaxSubStep", "In simulation step, maximum number of substeps",
920 10f, 924 10f,
@@ -1145,12 +1149,6 @@ public class BSScene : PhysicsScene, IPhysicsParameters
1145 (s,cf,p,v) => { s.m_detailedStatsStep = cf.GetInt(p, (int)v); }, 1149 (s,cf,p,v) => { s.m_detailedStatsStep = cf.GetInt(p, (int)v); },
1146 (s) => { return (float)s.m_detailedStatsStep; }, 1150 (s) => { return (float)s.m_detailedStatsStep; },
1147 (s,p,l,v) => { s.m_detailedStatsStep = (int)v; } ), 1151 (s,p,l,v) => { s.m_detailedStatsStep = (int)v; } ),
1148 new ParameterDefn("ShouldDebugLog", "Enables detailed DEBUG log statements",
1149 ConfigurationParameters.numericFalse,
1150 (s,cf,p,v) => { s.ShouldDebugLog = cf.GetBoolean(p, s.BoolNumeric(v)); },
1151 (s) => { return s.NumericBool(s.ShouldDebugLog); },
1152 (s,p,l,v) => { s.ShouldDebugLog = s.BoolNumeric(v); } ),
1153
1154 }; 1152 };
1155 1153
1156 // Convert a boolean to our numeric true and false values 1154 // Convert a boolean to our numeric true and false values