diff options
author | Justin Clark-Casey (justincc) | 2011-10-18 17:35:58 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-18 17:35:58 +0100 |
commit | 71d221cdc090cdedf371ead534421bb7074908cd (patch) | |
tree | 92a1d37b6b8764cfdfed05cdd7cd5fecaeeec53f /OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |
parent | Set enable_adaptive_throttles = true in OpenSimDefaults.ini (diff) | |
download | opensim-SC_OLD-71d221cdc090cdedf371ead534421bb7074908cd.zip opensim-SC_OLD-71d221cdc090cdedf371ead534421bb7074908cd.tar.gz opensim-SC_OLD-71d221cdc090cdedf371ead534421bb7074908cd.tar.bz2 opensim-SC_OLD-71d221cdc090cdedf371ead534421bb7074908cd.tar.xz |
Remove the unused CollisionLocker from ODE
Despite its name, this wasn't actually being used in any collision checking
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdeScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 152 |
1 files changed, 72 insertions, 80 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index ffcb004..03ff6d8 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -105,8 +105,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
105 | private readonly ILog m_log; | 105 | private readonly ILog m_log; |
106 | // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>(); | 106 | // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>(); |
107 | 107 | ||
108 | CollisionLocker ode; | ||
109 | |||
110 | private Random fluidRandomizer = new Random(Environment.TickCount); | 108 | private Random fluidRandomizer = new Random(Environment.TickCount); |
111 | 109 | ||
112 | private const uint m_regionWidth = Constants.RegionSize; | 110 | private const uint m_regionWidth = Constants.RegionSize; |
@@ -312,13 +310,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
312 | /// Sets many properties that ODE requires to be stable | 310 | /// Sets many properties that ODE requires to be stable |
313 | /// These settings need to be tweaked 'exactly' right or weird stuff happens. | 311 | /// These settings need to be tweaked 'exactly' right or weird stuff happens. |
314 | /// </summary> | 312 | /// </summary> |
315 | public OdeScene(CollisionLocker dode, string sceneIdentifier) | 313 | public OdeScene(string sceneIdentifier) |
316 | { | 314 | { |
317 | m_log | 315 | m_log |
318 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + sceneIdentifier); | 316 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + sceneIdentifier); |
319 | 317 | ||
320 | OdeLock = new Object(); | 318 | OdeLock = new Object(); |
321 | ode = dode; | ||
322 | nearCallback = near; | 319 | nearCallback = near; |
323 | triCallback = TriCallback; | 320 | triCallback = TriCallback; |
324 | triArrayCallback = TriArrayCallback; | 321 | triArrayCallback = TriArrayCallback; |
@@ -767,8 +764,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
767 | } | 764 | } |
768 | catch (SEHException) | 765 | catch (SEHException) |
769 | { | 766 | { |
770 | m_log.Error("[PHYSICS]: The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim."); | 767 | m_log.Error( |
771 | ode.drelease(world); | 768 | "[PHYSICS]: The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim."); |
772 | base.TriggerPhysicsBasedRestart(); | 769 | base.TriggerPhysicsBasedRestart(); |
773 | } | 770 | } |
774 | catch (Exception e) | 771 | catch (Exception e) |
@@ -1665,7 +1662,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1665 | pos.X = position.X; | 1662 | pos.X = position.X; |
1666 | pos.Y = position.Y; | 1663 | pos.Y = position.Y; |
1667 | pos.Z = position.Z; | 1664 | pos.Z = position.Z; |
1668 | OdeCharacter newAv = new OdeCharacter(avName, this, pos, ode, size, avPIDD, avPIDP, avCapRadius, avStandupTensor, avDensity, avHeightFudgeFactor, avMovementDivisorWalk, avMovementDivisorRun); | 1665 | |
1666 | OdeCharacter newAv | ||
1667 | = new OdeCharacter( | ||
1668 | avName, this, pos, size, avPIDD, avPIDP, | ||
1669 | avCapRadius, avStandupTensor, avDensity, avHeightFudgeFactor, | ||
1670 | avMovementDivisorWalk, avMovementDivisorRun); | ||
1671 | |||
1669 | newAv.Flying = isFlying; | 1672 | newAv.Flying = isFlying; |
1670 | newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; | 1673 | newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; |
1671 | 1674 | ||
@@ -1721,7 +1724,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1721 | OdePrim newPrim; | 1724 | OdePrim newPrim; |
1722 | lock (OdeLock) | 1725 | lock (OdeLock) |
1723 | { | 1726 | { |
1724 | newPrim = new OdePrim(name, this, pos, siz, rot, pbs, isphysical, ode); | 1727 | newPrim = new OdePrim(name, this, pos, siz, rot, pbs, isphysical); |
1725 | 1728 | ||
1726 | lock (_prims) | 1729 | lock (_prims) |
1727 | _prims.Add(newPrim); | 1730 | _prims.Add(newPrim); |
@@ -2158,84 +2161,80 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2158 | lock (prim) | 2161 | lock (prim) |
2159 | { | 2162 | { |
2160 | RemoveCollisionEventReporting(prim); | 2163 | RemoveCollisionEventReporting(prim); |
2161 | lock (ode) | 2164 | |
2165 | if (prim.prim_geom != IntPtr.Zero) | ||
2162 | { | 2166 | { |
2163 | if (prim.prim_geom != IntPtr.Zero) | 2167 | prim.ResetTaints(); |
2164 | { | ||
2165 | prim.ResetTaints(); | ||
2166 | 2168 | ||
2167 | if (prim.IsPhysical) | 2169 | if (prim.IsPhysical) |
2170 | { | ||
2171 | prim.disableBody(); | ||
2172 | if (prim.childPrim) | ||
2168 | { | 2173 | { |
2169 | prim.disableBody(); | 2174 | prim.childPrim = false; |
2170 | if (prim.childPrim) | 2175 | prim.Body = IntPtr.Zero; |
2171 | { | 2176 | prim.m_disabled = true; |
2172 | prim.childPrim = false; | 2177 | prim.IsPhysical = false; |
2173 | prim.Body = IntPtr.Zero; | 2178 | } |
2174 | prim.m_disabled = true; | ||
2175 | prim.IsPhysical = false; | ||
2176 | } | ||
2177 | 2179 | ||
2178 | 2180 | ||
2179 | } | 2181 | } |
2180 | // we don't want to remove the main space | 2182 | // we don't want to remove the main space |
2181 | 2183 | ||
2182 | // If the geometry is in the targetspace, remove it from the target space | 2184 | // If the geometry is in the targetspace, remove it from the target space |
2183 | //m_log.Warn(prim.m_targetSpace); | 2185 | //m_log.Warn(prim.m_targetSpace); |
2184 | 2186 | ||
2185 | //if (prim.m_targetSpace != IntPtr.Zero) | 2187 | //if (prim.m_targetSpace != IntPtr.Zero) |
2186 | //{ | 2188 | //{ |
2187 | //if (d.SpaceQuery(prim.m_targetSpace, prim.prim_geom)) | 2189 | //if (d.SpaceQuery(prim.m_targetSpace, prim.prim_geom)) |
2188 | //{ | 2190 | //{ |
2189 | 2191 | ||
2190 | //if (d.GeomIsSpace(prim.m_targetSpace)) | 2192 | //if (d.GeomIsSpace(prim.m_targetSpace)) |
2191 | //{ | 2193 | //{ |
2192 | //waitForSpaceUnlock(prim.m_targetSpace); | 2194 | //waitForSpaceUnlock(prim.m_targetSpace); |
2193 | //d.SpaceRemove(prim.m_targetSpace, prim.prim_geom); | 2195 | //d.SpaceRemove(prim.m_targetSpace, prim.prim_geom); |
2194 | prim.m_targetSpace = IntPtr.Zero; | 2196 | prim.m_targetSpace = IntPtr.Zero; |
2195 | //} | 2197 | //} |
2196 | //else | 2198 | //else |
2197 | //{ | 2199 | //{ |
2198 | // m_log.Info("[Physics]: Invalid Scene passed to 'removeprim from scene':" + | 2200 | // m_log.Info("[Physics]: Invalid Scene passed to 'removeprim from scene':" + |
2199 | //((OdePrim)prim).m_targetSpace.ToString()); | 2201 | //((OdePrim)prim).m_targetSpace.ToString()); |
2200 | //} | 2202 | //} |
2201 | 2203 | ||
2202 | //} | 2204 | //} |
2203 | //} | 2205 | //} |
2204 | //m_log.Warn(prim.prim_geom); | 2206 | //m_log.Warn(prim.prim_geom); |
2205 | 2207 | ||
2206 | if (!prim.RemoveGeom()) | 2208 | if (!prim.RemoveGeom()) |
2207 | m_log.Warn("[PHYSICS]: Unable to remove prim from physics scene"); | 2209 | m_log.Warn("[PHYSICS]: Unable to remove prim from physics scene"); |
2208 | 2210 | ||
2209 | lock (_prims) | 2211 | lock (_prims) |
2210 | _prims.Remove(prim); | 2212 | _prims.Remove(prim); |
2211 | 2213 | ||
2212 | //If there are no more geometries in the sub-space, we don't need it in the main space anymore | 2214 | //If there are no more geometries in the sub-space, we don't need it in the main space anymore |
2213 | //if (d.SpaceGetNumGeoms(prim.m_targetSpace) == 0) | 2215 | //if (d.SpaceGetNumGeoms(prim.m_targetSpace) == 0) |
2214 | //{ | 2216 | //{ |
2215 | //if (prim.m_targetSpace != null) | 2217 | //if (prim.m_targetSpace != null) |
2216 | //{ | 2218 | //{ |
2217 | //if (d.GeomIsSpace(prim.m_targetSpace)) | 2219 | //if (d.GeomIsSpace(prim.m_targetSpace)) |
2218 | //{ | 2220 | //{ |
2219 | //waitForSpaceUnlock(prim.m_targetSpace); | 2221 | //waitForSpaceUnlock(prim.m_targetSpace); |
2220 | //d.SpaceRemove(space, prim.m_targetSpace); | 2222 | //d.SpaceRemove(space, prim.m_targetSpace); |
2221 | // free up memory used by the space. | 2223 | // free up memory used by the space. |
2222 | //d.SpaceDestroy(prim.m_targetSpace); | 2224 | //d.SpaceDestroy(prim.m_targetSpace); |
2223 | //int[] xyspace = calculateSpaceArrayItemFromPos(prim.Position); | 2225 | //int[] xyspace = calculateSpaceArrayItemFromPos(prim.Position); |
2224 | //resetSpaceArrayItemToZero(xyspace[0], xyspace[1]); | 2226 | //resetSpaceArrayItemToZero(xyspace[0], xyspace[1]); |
2225 | //} | 2227 | //} |
2226 | //else | 2228 | //else |
2227 | //{ | 2229 | //{ |
2228 | //m_log.Info("[Physics]: Invalid Scene passed to 'removeprim from scene':" + | 2230 | //m_log.Info("[Physics]: Invalid Scene passed to 'removeprim from scene':" + |
2229 | //((OdePrim) prim).m_targetSpace.ToString()); | 2231 | //((OdePrim) prim).m_targetSpace.ToString()); |
2230 | //} | 2232 | //} |
2231 | //} | 2233 | //} |
2232 | //} | 2234 | //} |
2233 | 2235 | ||
2234 | if (SupportsNINJAJoints) | 2236 | if (SupportsNINJAJoints) |
2235 | { | 2237 | RemoveAllJointsConnectedToActorThreadLocked(prim); |
2236 | RemoveAllJointsConnectedToActorThreadLocked(prim); | ||
2237 | } | ||
2238 | } | ||
2239 | } | 2238 | } |
2240 | } | 2239 | } |
2241 | } | 2240 | } |
@@ -2835,16 +2834,9 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); | |||
2835 | catch (Exception e) | 2834 | catch (Exception e) |
2836 | { | 2835 | { |
2837 | m_log.ErrorFormat("[PHYSICS]: {0}, {1}, {2}", e.Message, e.TargetSite, e); | 2836 | m_log.ErrorFormat("[PHYSICS]: {0}, {1}, {2}", e.Message, e.TargetSite, e); |
2838 | ode.dunlock(world); | ||
2839 | } | 2837 | } |
2840 | 2838 | ||
2841 | step_time -= ODE_STEPSIZE; | 2839 | step_time -= ODE_STEPSIZE; |
2842 | //} | ||
2843 | //else | ||
2844 | //{ | ||
2845 | //fps = 0; | ||
2846 | //} | ||
2847 | //} | ||
2848 | } | 2840 | } |
2849 | 2841 | ||
2850 | lock (_characters) | 2842 | lock (_characters) |