aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorAdam Frisby2008-04-21 07:09:17 +0000
committerAdam Frisby2008-04-21 07:09:17 +0000
commitfef3b3689492dea63693c964bcdbec9f5137eb5e (patch)
tree7791eef001d85d3e1de863a68f26ff9434d062ca /OpenSim/Region/Physics
parent* Terrain Module code has been reformatted to comply with guidelines. (diff)
downloadopensim-SC-fef3b3689492dea63693c964bcdbec9f5137eb5e.zip
opensim-SC-fef3b3689492dea63693c964bcdbec9f5137eb5e.tar.gz
opensim-SC-fef3b3689492dea63693c964bcdbec9f5137eb5e.tar.bz2
opensim-SC-fef3b3689492dea63693c964bcdbec9f5137eb5e.tar.xz
* Optimised using statements and namespace references across entire project (this took a while to run).
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs2
-rw-r--r--OpenSim/Region/Physics/Manager/CollisionLocker.cs1
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs4
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsScene.cs6
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsSensor.cs3
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs1
-rw-r--r--OpenSim/Region/Physics/Meshing/SimpleHull.cs1
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs6
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs21
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODETestClass.cs7
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs16
11 files changed, 30 insertions, 38 deletions
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index 6cc7ff4..1ad1201 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -31,12 +31,10 @@ using System;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using MonoXnaCompactMaths; 32using MonoXnaCompactMaths;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Console;
35using OpenSim.Region.Physics.Manager; 34using OpenSim.Region.Physics.Manager;
36using XnaDevRu.BulletX; 35using XnaDevRu.BulletX;
37using XnaDevRu.BulletX.Dynamics; 36using XnaDevRu.BulletX.Dynamics;
38using AxiomQuaternion = Axiom.Math.Quaternion; 37using AxiomQuaternion = Axiom.Math.Quaternion;
39using BoxShape=XnaDevRu.BulletX.BoxShape;
40 38
41#endregion 39#endregion
42 40
diff --git a/OpenSim/Region/Physics/Manager/CollisionLocker.cs b/OpenSim/Region/Physics/Manager/CollisionLocker.cs
index f88554b..29a6188 100644
--- a/OpenSim/Region/Physics/Manager/CollisionLocker.cs
+++ b/OpenSim/Region/Physics/Manager/CollisionLocker.cs
@@ -27,7 +27,6 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text;
31 30
32namespace OpenSim.Region.Physics.Manager 31namespace OpenSim.Region.Physics.Manager
33{ 32{
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index 73b2721..e4ff725 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -29,7 +29,7 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32using OpenSim.Framework.Console; 32using log4net;
33 33
34namespace OpenSim.Region.Physics.Manager 34namespace OpenSim.Region.Physics.Manager
35{ 35{
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Physics.Manager
38 /// </summary> 38 /// </summary>
39 public class PhysicsPluginManager 39 public class PhysicsPluginManager
40 { 40 {
41 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 private Dictionary<string, IPhysicsPlugin> _PhysPlugins = new Dictionary<string, IPhysicsPlugin>(); 43 private Dictionary<string, IPhysicsPlugin> _PhysPlugins = new Dictionary<string, IPhysicsPlugin>();
44 private Dictionary<string, IMeshingPlugin> _MeshPlugins = new Dictionary<string, IMeshingPlugin>(); 44 private Dictionary<string, IMeshingPlugin> _MeshPlugins = new Dictionary<string, IMeshingPlugin>();
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index d3699a3..4c509b7 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -25,10 +25,10 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System; 28using System.Reflection;
29using Axiom.Math; 29using Axiom.Math;
30using log4net;
30using OpenSim.Framework; 31using OpenSim.Framework;
31using OpenSim.Framework.Console;
32 32
33namespace OpenSim.Region.Physics.Manager 33namespace OpenSim.Region.Physics.Manager
34{ 34{
@@ -36,7 +36,7 @@ namespace OpenSim.Region.Physics.Manager
36 36
37 public abstract class PhysicsScene 37 public abstract class PhysicsScene
38 { 38 {
39 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 39 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
40 40
41 // The only thing that should register for this event is the InnerScene 41 // The only thing that should register for this event is the InnerScene
42 // Anything else could cause problems. 42 // Anything else could cause problems.
diff --git a/OpenSim/Region/Physics/Manager/PhysicsSensor.cs b/OpenSim/Region/Physics/Manager/PhysicsSensor.cs
index a86d283..ce53108 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsSensor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsSensor.cs
@@ -26,10 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
30using System.Timers; 29using System.Timers;
31using Axiom.Math;
32using OpenSim.Framework;
33 30
34namespace OpenSim.Region.Physics.Manager 31namespace OpenSim.Region.Physics.Manager
35{ 32{
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index d4b6a50..db91028 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -28,7 +28,6 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Framework.Console;
32using OpenSim.Region.Physics.Manager; 31using OpenSim.Region.Physics.Manager;
33 32
34namespace OpenSim.Region.Physics.Meshing 33namespace OpenSim.Region.Physics.Meshing
diff --git a/OpenSim/Region/Physics/Meshing/SimpleHull.cs b/OpenSim/Region/Physics/Meshing/SimpleHull.cs
index c518b78..2896d3b 100644
--- a/OpenSim/Region/Physics/Meshing/SimpleHull.cs
+++ b/OpenSim/Region/Physics/Meshing/SimpleHull.cs
@@ -27,7 +27,6 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using OpenSim.Framework.Console;
31using OpenSim.Region.Physics.Manager; 30using OpenSim.Region.Physics.Manager;
32 31
33namespace OpenSim.Region.Physics.Meshing 32namespace OpenSim.Region.Physics.Meshing
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 81126b6..042042c 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -121,7 +121,7 @@ namespace OpenSim.Region.Physics.OdePlugin
121 _acceleration = new PhysicsVector(); 121 _acceleration = new PhysicsVector();
122 _parent_scene = parent_scene; 122 _parent_scene = parent_scene;
123 123
124 if (System.Environment.OSVersion.Platform == PlatformID.Unix) 124 if (Environment.OSVersion.Platform == PlatformID.Unix)
125 { 125 {
126 m_tensor = 2000000f; 126 m_tensor = 2000000f;
127 } 127 }
@@ -413,7 +413,7 @@ namespace OpenSim.Region.Physics.OdePlugin
413 private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor) 413 private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor)
414 { 414 {
415 415
416 if (System.Environment.OSVersion.Platform == PlatformID.Unix) 416 if (Environment.OSVersion.Platform == PlatformID.Unix)
417 { 417 {
418 m_tensor = 2000000f; 418 m_tensor = 2000000f;
419 } 419 }
@@ -641,7 +641,7 @@ namespace OpenSim.Region.Physics.OdePlugin
641 641
642 // If the PID Controller isn't active then we set our force 642 // If the PID Controller isn't active then we set our force
643 // calculating base velocity to the current position 643 // calculating base velocity to the current position
644 if (System.Environment.OSVersion.Platform == PlatformID.Unix) 644 if (Environment.OSVersion.Platform == PlatformID.Unix)
645 { 645 {
646 PID_D = 3200.0f; 646 PID_D = 3200.0f;
647 PID_P = 1400.0f; 647 PID_P = 1400.0f;
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 4e39eb4..8e0640b 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -27,8 +27,11 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
30using System.Runtime.InteropServices; 31using System.Runtime.InteropServices;
32using System.Threading;
31using Axiom.Math; 33using Axiom.Math;
34using log4net;
32using Ode.NET; 35using Ode.NET;
33using OpenSim.Framework; 36using OpenSim.Framework;
34using OpenSim.Region.Physics.Manager; 37using OpenSim.Region.Physics.Manager;
@@ -37,7 +40,7 @@ namespace OpenSim.Region.Physics.OdePlugin
37{ 40{
38 public class OdePrim : PhysicsActor 41 public class OdePrim : PhysicsActor
39 { 42 {
40 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41 44
42 public PhysicsVector _position; 45 public PhysicsVector _position;
43 private PhysicsVector _velocity; 46 private PhysicsVector _velocity;
@@ -663,7 +666,7 @@ namespace OpenSim.Region.Physics.OdePlugin
663 // This sleeper is there to moderate how long it takes between 666 // This sleeper is there to moderate how long it takes between
664 // setting up the mesh and pre-processing it when we get rapid fire mesh requests on a single object 667 // setting up the mesh and pre-processing it when we get rapid fire mesh requests on a single object
665 668
666 System.Threading.Thread.Sleep(10); 669 Thread.Sleep(10);
667 670
668 //Kill Body so that mesh can re-make the geom 671 //Kill Body so that mesh can re-make the geom
669 if (IsPhysical && Body != (IntPtr) 0) 672 if (IsPhysical && Body != (IntPtr) 0)
@@ -692,7 +695,7 @@ namespace OpenSim.Region.Physics.OdePlugin
692 SetGeom(d.CreateTriMesh(m_targetSpace, _triMeshData, parent_scene.triCallback, null, null)); 695 SetGeom(d.CreateTriMesh(m_targetSpace, _triMeshData, parent_scene.triCallback, null, null));
693 } 696 }
694 } 697 }
695 catch (System.AccessViolationException) 698 catch (AccessViolationException)
696 { 699 {
697 700
698 m_log.Error("[PHYSICS]: MESH LOCKED"); 701 m_log.Error("[PHYSICS]: MESH LOCKED");
@@ -934,7 +937,7 @@ namespace OpenSim.Region.Physics.OdePlugin
934 { 937 {
935 SetGeom(d.CreateSphere(m_targetSpace, _size.X / 2)); 938 SetGeom(d.CreateSphere(m_targetSpace, _size.X / 2));
936 } 939 }
937 catch (System.AccessViolationException) 940 catch (AccessViolationException)
938 { 941 {
939 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); 942 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object");
940 ode.dunlock(_parent_scene.world); 943 ode.dunlock(_parent_scene.world);
@@ -948,7 +951,7 @@ namespace OpenSim.Region.Physics.OdePlugin
948 { 951 {
949 SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); 952 SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z));
950 } 953 }
951 catch (System.AccessViolationException) 954 catch (AccessViolationException)
952 { 955 {
953 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); 956 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object");
954 ode.dunlock(_parent_scene.world); 957 ode.dunlock(_parent_scene.world);
@@ -963,7 +966,7 @@ namespace OpenSim.Region.Physics.OdePlugin
963 { 966 {
964 SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); 967 SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z));
965 } 968 }
966 catch (System.AccessViolationException) 969 catch (AccessViolationException)
967 { 970 {
968 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); 971 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object");
969 ode.dunlock(_parent_scene.world); 972 ode.dunlock(_parent_scene.world);
@@ -990,7 +993,7 @@ namespace OpenSim.Region.Physics.OdePlugin
990 { 993 {
991 SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); 994 SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z));
992 } 995 }
993 catch (System.AccessViolationException) 996 catch (AccessViolationException)
994 { 997 {
995 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); 998 m_log.Warn("[PHYSICS]: Unable to create physics proxy for object");
996 ode.dunlock(_parent_scene.world); 999 ode.dunlock(_parent_scene.world);
@@ -1135,7 +1138,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1135 1138
1136 // If the PID Controller isn't active then we set our force 1139 // If the PID Controller isn't active then we set our force
1137 // calculating base velocity to the current position 1140 // calculating base velocity to the current position
1138 if (System.Environment.OSVersion.Platform == PlatformID.Unix) 1141 if (Environment.OSVersion.Platform == PlatformID.Unix)
1139 { 1142 {
1140 PID_D = 3200.0f; 1143 PID_D = 3200.0f;
1141 //PID_P = 1400.0f; 1144 //PID_P = 1400.0f;
@@ -1670,7 +1673,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1670 { 1673 {
1671 1674
1672 1675
1673 System.Threading.Thread.Sleep(20); 1676 Thread.Sleep(20);
1674 if (IsPhysical) 1677 if (IsPhysical)
1675 { 1678 {
1676 if (Body != (IntPtr)0) 1679 if (Body != (IntPtr)0)
diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs
index f56cf5c..94d98cb 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs
@@ -26,15 +26,10 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
30using System.Runtime.InteropServices;
31using Axiom.Math; 29using Axiom.Math;
32using Ode.NET; 30using NUnit.Framework;
33using OpenSim.Framework; 31using OpenSim.Framework;
34using OpenSim.Framework.Console;
35using OpenSim.Region.Physics.Manager; 32using OpenSim.Region.Physics.Manager;
36using NUnit.Framework;
37using NUnit.Framework.SyntaxHelpers;
38 33
39namespace OpenSim.Region.Physics.OdePlugin 34namespace OpenSim.Region.Physics.OdePlugin
40{ 35{
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index a2f440e..c346960 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -27,11 +27,13 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
30using System.Runtime.InteropServices; 31using System.Runtime.InteropServices;
32using System.Threading;
31using Axiom.Math; 33using Axiom.Math;
34using log4net;
32using Ode.NET; 35using Ode.NET;
33using OpenSim.Framework; 36using OpenSim.Framework;
34using OpenSim.Framework.Console;
35using OpenSim.Region.Physics.Manager; 37using OpenSim.Region.Physics.Manager;
36 38
37//using OpenSim.Region.Physics.OdePlugin.Meshing; 39//using OpenSim.Region.Physics.OdePlugin.Meshing;
@@ -114,12 +116,12 @@ namespace OpenSim.Region.Physics.OdePlugin
114 116
115 public class OdeScene : PhysicsScene 117 public class OdeScene : PhysicsScene
116 { 118 {
117 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 119 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
118 private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>(); 120 private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>();
119 121
120 CollisionLocker ode; 122 CollisionLocker ode;
121 123
122 protected Random fluidRandomizer = new Random(System.Environment.TickCount); 124 protected Random fluidRandomizer = new Random(Environment.TickCount);
123 125
124 private const uint m_regionWidth = Constants.RegionSize; 126 private const uint m_regionWidth = Constants.RegionSize;
125 private const uint m_regionHeight = Constants.RegionSize; 127 private const uint m_regionHeight = Constants.RegionSize;
@@ -331,7 +333,7 @@ namespace OpenSim.Region.Physics.OdePlugin
331 { 333 {
332 d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); 334 d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback);
333 } 335 }
334 catch (System.AccessViolationException) 336 catch (AccessViolationException)
335 { 337 {
336 m_log.Warn("[PHYSICS]: Unable to collide test a space"); 338 m_log.Warn("[PHYSICS]: Unable to collide test a space");
337 return; 339 return;
@@ -404,7 +406,7 @@ namespace OpenSim.Region.Physics.OdePlugin
404 ode.drelease(world); 406 ode.drelease(world);
405 base.TriggerPhysicsBasedRestart(); 407 base.TriggerPhysicsBasedRestart();
406 } 408 }
407 catch (System.AccessViolationException) 409 catch (AccessViolationException)
408 { 410 {
409 411
410 m_log.Warn("[PHYSICS]: Unable to collide test an object"); 412 m_log.Warn("[PHYSICS]: Unable to collide test an object");
@@ -1166,7 +1168,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1166 } 1168 }
1167 1169
1168 } 1170 }
1169 catch (System.AccessViolationException) 1171 catch (AccessViolationException)
1170 { 1172 {
1171 m_log.Info("[PHYSICS]: Couldn't remove prim from physics scene, it was already be removed."); 1173 m_log.Info("[PHYSICS]: Couldn't remove prim from physics scene, it was already be removed.");
1172 } 1174 }
@@ -1243,7 +1245,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1243 // never be called if the prim is physical(active) 1245 // never be called if the prim is physical(active)
1244 1246
1245 // All physical prim end up in the root space 1247 // All physical prim end up in the root space
1246 System.Threading.Thread.Sleep(20); 1248 Thread.Sleep(20);
1247 if (currentspace != space) 1249 if (currentspace != space)
1248 { 1250 {
1249 //m_log.Info("[SPACE]: C:" + currentspace.ToString() + " g:" + geom.ToString()); 1251 //m_log.Info("[SPACE]: C:" + currentspace.ToString() + " g:" + geom.ToString());