diff options
author | Adam Frisby | 2008-04-21 07:09:17 +0000 |
---|---|---|
committer | Adam Frisby | 2008-04-21 07:09:17 +0000 |
commit | fef3b3689492dea63693c964bcdbec9f5137eb5e (patch) | |
tree | 7791eef001d85d3e1de863a68f26ff9434d062ca /OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |
parent | * Terrain Module code has been reformatted to comply with guidelines. (diff) | |
download | opensim-SC_OLD-fef3b3689492dea63693c964bcdbec9f5137eb5e.zip opensim-SC_OLD-fef3b3689492dea63693c964bcdbec9f5137eb5e.tar.gz opensim-SC_OLD-fef3b3689492dea63693c964bcdbec9f5137eb5e.tar.bz2 opensim-SC_OLD-fef3b3689492dea63693c964bcdbec9f5137eb5e.tar.xz |
* Optimised using statements and namespace references across entire project (this took a while to run).
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 21 |
1 files changed, 12 insertions, 9 deletions
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | ||
30 | using System.Runtime.InteropServices; | 31 | using System.Runtime.InteropServices; |
32 | using System.Threading; | ||
31 | using Axiom.Math; | 33 | using Axiom.Math; |
34 | using log4net; | ||
32 | using Ode.NET; | 35 | using Ode.NET; |
33 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
34 | using OpenSim.Region.Physics.Manager; | 37 | using 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) |