aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2009-02-08 17:41:15 +0000
committerTeravus Ovares2009-02-08 17:41:15 +0000
commitc0c330988f1ee149740e60574c7c9289e113d371 (patch)
tree9dc40a4685f299ca27c9f619ff1ec54bd786a701 /OpenSim
parentReverts patch from tuco/mikkopa/sempuki mantis #3072 (diff)
downloadopensim-SC_OLD-c0c330988f1ee149740e60574c7c9289e113d371.zip
opensim-SC_OLD-c0c330988f1ee149740e60574c7c9289e113d371.tar.gz
opensim-SC_OLD-c0c330988f1ee149740e60574c7c9289e113d371.tar.bz2
opensim-SC_OLD-c0c330988f1ee149740e60574c7c9289e113d371.tar.xz
* Some minor cleanup
* sealed OdeScene
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs60
1 files changed, 30 insertions, 30 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 9a4b1b0..d7d471f 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -122,14 +122,14 @@ namespace OpenSim.Region.Physics.OdePlugin
122 Selected = 0x00000100 122 Selected = 0x00000100
123 } 123 }
124 124
125 public class OdeScene : PhysicsScene 125 public sealed class OdeScene : PhysicsScene
126 { 126 {
127 private ILog m_log; 127 private readonly ILog m_log;
128 // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>(); 128 // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>();
129 129
130 CollisionLocker ode; 130 CollisionLocker ode;
131 131
132 protected Random fluidRandomizer = new Random(Environment.TickCount); 132 private Random fluidRandomizer = new Random(Environment.TickCount);
133 133
134 private const uint m_regionWidth = Constants.RegionSize; 134 private const uint m_regionWidth = Constants.RegionSize;
135 private const uint m_regionHeight = Constants.RegionSize; 135 private const uint m_regionHeight = Constants.RegionSize;
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Physics.OdePlugin
153 private int framecount = 0; 153 private int framecount = 0;
154 //private int m_returncollisions = 10; 154 //private int m_returncollisions = 10;
155 155
156 private IntPtr contactgroup; 156 private readonly IntPtr contactgroup;
157 private IntPtr LandGeom; 157 private IntPtr LandGeom;
158 158
159 private IntPtr WaterGeom; 159 private IntPtr WaterGeom;
@@ -210,26 +210,26 @@ namespace OpenSim.Region.Physics.OdePlugin
210 private d.NearCallback nearCallback; 210 private d.NearCallback nearCallback;
211 public d.TriCallback triCallback; 211 public d.TriCallback triCallback;
212 public d.TriArrayCallback triArrayCallback; 212 public d.TriArrayCallback triArrayCallback;
213 private List<OdeCharacter> _characters = new List<OdeCharacter>(); 213 private readonly List<OdeCharacter> _characters = new List<OdeCharacter>();
214 private List<OdePrim> _prims = new List<OdePrim>(); 214 private readonly List<OdePrim> _prims = new List<OdePrim>();
215 private List<OdePrim> _activeprims = new List<OdePrim>(); 215 private readonly List<OdePrim> _activeprims = new List<OdePrim>();
216 private List<OdePrim> _taintedPrim = new List<OdePrim>(); 216 private readonly List<OdePrim> _taintedPrim = new List<OdePrim>();
217 private List<OdeCharacter> _taintedActors = new List<OdeCharacter>(); 217 private readonly List<OdeCharacter> _taintedActors = new List<OdeCharacter>();
218 private List<d.ContactGeom> _perloopContact = new List<d.ContactGeom>(); 218 private readonly List<d.ContactGeom> _perloopContact = new List<d.ContactGeom>();
219 private List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>(); 219 private readonly List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>();
220 public Dictionary<IntPtr, String> geom_name_map = new Dictionary<IntPtr, String>(); 220 public Dictionary<IntPtr, String> geom_name_map = new Dictionary<IntPtr, String>();
221 public Dictionary<IntPtr, PhysicsActor> actor_name_map = new Dictionary<IntPtr, PhysicsActor>(); 221 public Dictionary<IntPtr, PhysicsActor> actor_name_map = new Dictionary<IntPtr, PhysicsActor>();
222 private bool m_NINJA_physics_joints_enabled = false; 222 private bool m_NINJA_physics_joints_enabled = false;
223 //private Dictionary<String, IntPtr> jointpart_name_map = new Dictionary<String,IntPtr>(); 223 //private Dictionary<String, IntPtr> jointpart_name_map = new Dictionary<String,IntPtr>();
224 private Dictionary<String, List<PhysicsJoint>> joints_connecting_actor = new Dictionary<String, List<PhysicsJoint>>(); 224 private readonly Dictionary<String, List<PhysicsJoint>> joints_connecting_actor = new Dictionary<String, List<PhysicsJoint>>();
225 private d.ContactGeom[] contacts = new d.ContactGeom[80]; 225 private d.ContactGeom[] contacts = new d.ContactGeom[80];
226 private List<PhysicsJoint> requestedJointsToBeCreated = new List<PhysicsJoint>(); // lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active 226 private readonly List<PhysicsJoint> requestedJointsToBeCreated = new List<PhysicsJoint>(); // lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active
227 private List<PhysicsJoint> pendingJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene. 227 private readonly List<PhysicsJoint> pendingJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene.
228 private List<PhysicsJoint> activeJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene. 228 private readonly List<PhysicsJoint> activeJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene.
229 private List<string> requestedJointsToBeDeleted = new List<string>(); // lock only briefly. accessed by external code (to request deletion of joints) and by OdeScene.Simulate() to move those joints out of pending/active 229 private readonly List<string> requestedJointsToBeDeleted = new List<string>(); // lock only briefly. accessed by external code (to request deletion of joints) and by OdeScene.Simulate() to move those joints out of pending/active
230 private Object externalJointRequestsLock = new Object(); 230 private Object externalJointRequestsLock = new Object();
231 private Dictionary<String, PhysicsJoint> SOPName_to_activeJoint = new Dictionary<String, PhysicsJoint>(); 231 private readonly Dictionary<String, PhysicsJoint> SOPName_to_activeJoint = new Dictionary<String, PhysicsJoint>();
232 private Dictionary<String, PhysicsJoint> SOPName_to_pendingJoint = new Dictionary<String, PhysicsJoint>(); 232 private readonly Dictionary<String, PhysicsJoint> SOPName_to_pendingJoint = new Dictionary<String, PhysicsJoint>();
233 233
234 private d.Contact contact; 234 private d.Contact contact;
235 private d.Contact TerrainContact; 235 private d.Contact TerrainContact;
@@ -240,8 +240,8 @@ namespace OpenSim.Region.Physics.OdePlugin
240//Ckrinke: Comment out until used. We declare it, initialize it, but do not use it 240//Ckrinke: Comment out until used. We declare it, initialize it, but do not use it
241//Ckrinke private int m_randomizeWater = 200; 241//Ckrinke private int m_randomizeWater = 200;
242 private int m_physicsiterations = 10; 242 private int m_physicsiterations = 10;
243 private float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag 243 private const float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag
244 private PhysicsActor PANull = new NullPhysicsActor(); 244 private readonly PhysicsActor PANull = new NullPhysicsActor();
245 private float step_time = 0.0f; 245 private float step_time = 0.0f;
246//Ckrinke: Comment out until used. We declare it, initialize it, but do not use it 246//Ckrinke: Comment out until used. We declare it, initialize it, but do not use it
247//Ckrinke private int ms = 0; 247//Ckrinke private int ms = 0;
@@ -1874,14 +1874,14 @@ namespace OpenSim.Region.Physics.OdePlugin
1874 /// <summary> 1874 /// <summary>
1875 /// Takes a space pointer and zeros out the array we're using to hold the spaces 1875 /// Takes a space pointer and zeros out the array we're using to hold the spaces
1876 /// </summary> 1876 /// </summary>
1877 /// <param name="space"></param> 1877 /// <param name="pSpace"></param>
1878 public void resetSpaceArrayItemToZero(IntPtr space) 1878 public void resetSpaceArrayItemToZero(IntPtr pSpace)
1879 { 1879 {
1880 for (int x = 0; x < staticPrimspace.GetLength(0); x++) 1880 for (int x = 0; x < staticPrimspace.GetLength(0); x++)
1881 { 1881 {
1882 for (int y = 0; y < staticPrimspace.GetLength(1); y++) 1882 for (int y = 0; y < staticPrimspace.GetLength(1); y++)
1883 { 1883 {
1884 if (staticPrimspace[x, y] == space) 1884 if (staticPrimspace[x, y] == pSpace)
1885 staticPrimspace[x, y] = IntPtr.Zero; 1885 staticPrimspace[x, y] = IntPtr.Zero;
1886 } 1886 }
1887 } 1887 }
@@ -1926,8 +1926,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1926 } 1926 }
1927 else 1927 else
1928 { 1928 {
1929 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + 1929 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" + currentspace +
1930 " Geom:" + geom.ToString()); 1930 " Geom:" + geom);
1931 } 1931 }
1932 } 1932 }
1933 else 1933 else
@@ -1943,7 +1943,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1943 else 1943 else
1944 { 1944 {
1945 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" + 1945 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
1946 sGeomIsIn.ToString() + " Geom:" + geom.ToString()); 1946 sGeomIsIn + " Geom:" + geom);
1947 } 1947 }
1948 } 1948 }
1949 } 1949 }
@@ -1966,7 +1966,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1966 else 1966 else
1967 { 1967 {
1968 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" + 1968 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
1969 currentspace.ToString() + " Geom:" + geom.ToString()); 1969 currentspace + " Geom:" + geom);
1970 } 1970 }
1971 } 1971 }
1972 } 1972 }
@@ -1986,7 +1986,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1986 else 1986 else
1987 { 1987 {
1988 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" + 1988 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
1989 currentspace.ToString() + " Geom:" + geom.ToString()); 1989 currentspace + " Geom:" + geom);
1990 } 1990 }
1991 } 1991 }
1992 else 1992 else
@@ -2002,7 +2002,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2002 else 2002 else
2003 { 2003 {
2004 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" + 2004 m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
2005 sGeomIsIn.ToString() + " Geom:" + geom.ToString()); 2005 sGeomIsIn + " Geom:" + geom);
2006 } 2006 }
2007 } 2007 }
2008 } 2008 }
@@ -2127,7 +2127,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2127 if (pbs.ProfileHollow != 0) 2127 if (pbs.ProfileHollow != 0)
2128 iPropertiesNotSupportedDefault++; 2128 iPropertiesNotSupportedDefault++;
2129 2129
2130 if (((Int16)pbs.PathTwistBegin != 0) || ((Int16)pbs.PathTwist != 0)) 2130 if ((pbs.PathTwistBegin != 0) || (pbs.PathTwist != 0))
2131 iPropertiesNotSupportedDefault++; 2131 iPropertiesNotSupportedDefault++;
2132 2132
2133 if ((pbs.ProfileBegin != 0) || pbs.ProfileEnd != 0) 2133 if ((pbs.ProfileBegin != 0) || pbs.ProfileEnd != 0)