aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.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/BSPrim.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/BSPrim.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index b918f84..48cd89b 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -42,8 +42,6 @@ public sealed class BSPrim : PhysicsActor
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43 private static readonly string LogHeader = "[BULLETS PRIM]"; 43 private static readonly string LogHeader = "[BULLETS PRIM]";
44 44
45 private void DebugLog(string mm, params Object[] xx) { if (_scene.ShouldDebugLog) m_log.DebugFormat(mm, xx); }
46
47 private IMesh _mesh; 45 private IMesh _mesh;
48 private PrimitiveBaseShape _pbs; 46 private PrimitiveBaseShape _pbs;
49 private ShapeData.PhysicsShapeType _shapeType; 47 private ShapeData.PhysicsShapeType _shapeType;
@@ -232,7 +230,6 @@ public sealed class BSPrim : PhysicsActor
232 BSPrim parent = obj as BSPrim; 230 BSPrim parent = obj as BSPrim;
233 if (parent != null) 231 if (parent != null)
234 { 232 {
235 DebugLog("{0}: link {1}/{2} to {3}", LogHeader, _avName, _localID, parent.LocalID);
236 BSPrim parentBefore = _linkset.LinksetRoot; 233 BSPrim parentBefore = _linkset.LinksetRoot;
237 int childrenBefore = _linkset.NumberOfChildren; 234 int childrenBefore = _linkset.NumberOfChildren;
238 235
@@ -248,8 +245,6 @@ public sealed class BSPrim : PhysicsActor
248 public override void delink() { 245 public override void delink() {
249 // TODO: decide if this parent checking needs to happen at taint time 246 // TODO: decide if this parent checking needs to happen at taint time
250 // Race condition here: if link() and delink() in same simulation tick, the delink will not happen 247 // Race condition here: if link() and delink() in same simulation tick, the delink will not happen
251 DebugLog("{0}: delink {1}/{2}. Parent={3}", LogHeader, _avName, _localID,
252 _linkset.LinksetRoot._avName+"/"+_linkset.LinksetRoot.LocalID.ToString());
253 248
254 BSPrim parentBefore = _linkset.LinksetRoot; 249 BSPrim parentBefore = _linkset.LinksetRoot;
255 int childrenBefore = _linkset.NumberOfChildren; 250 int childrenBefore = _linkset.NumberOfChildren;
@@ -1042,7 +1037,14 @@ public sealed class BSPrim : PhysicsActor
1042 // No locking here because this is done when we know physics is not simulating 1037 // No locking here because this is done when we know physics is not simulating
1043 private void CreateGeomMesh() 1038 private void CreateGeomMesh()
1044 { 1039 {
1045 float lod = _pbs.SculptEntry ? _scene.SculptLOD : _scene.MeshLOD; 1040 // level of detail based on size and type of the object
1041 float lod = _scene.MeshLOD;
1042 if (_pbs.SculptEntry)
1043 lod = _scene.SculptLOD;
1044 float maxAxis = Math.Max(_size.X, Math.Max(_size.Y, _size.Z));
1045 if (maxAxis > _scene.MeshMegaPrimThreshold)
1046 lod = _scene.MeshMegaPrimLOD;
1047
1046 ulong newMeshKey = (ulong)_pbs.GetMeshKey(_size, lod); 1048 ulong newMeshKey = (ulong)_pbs.GetMeshKey(_size, lod);
1047 // m_log.DebugFormat("{0}: CreateGeomMesh: lID={1}, oldKey={2}, newKey={3}", LogHeader, _localID, _meshKey, newMeshKey); 1049 // m_log.DebugFormat("{0}: CreateGeomMesh: lID={1}, oldKey={2}, newKey={3}", LogHeader, _localID, _meshKey, newMeshKey);
1048 1050