diff options
author | UbitUmarov | 2015-11-21 02:53:35 +0000 |
---|---|---|
committer | UbitUmarov | 2015-11-21 02:53:35 +0000 |
commit | 11342314e14b5b6f866d07aaf73563b827ad8d28 (patch) | |
tree | 09ede7cf4680b47f4c34964d5591255e27ff080a /OpenSim/Region/PhysicsModules | |
parent | some cleanup, allow cast rays to collide with terrain within limited range (... (diff) | |
download | opensim-SC-11342314e14b5b6f866d07aaf73563b827ad8d28.zip opensim-SC-11342314e14b5b6f866d07aaf73563b827ad8d28.tar.gz opensim-SC-11342314e14b5b6f866d07aaf73563b827ad8d28.tar.bz2 opensim-SC-11342314e14b5b6f866d07aaf73563b827ad8d28.tar.xz |
add thread allocation calls for new ode.dll (old ode)
Diffstat (limited to 'OpenSim/Region/PhysicsModules')
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 38 |
2 files changed, 25 insertions, 16 deletions
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs index 7c4dc46..36546aa 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs | |||
@@ -2664,6 +2664,9 @@ Console.WriteLine(" JointCreateFixed"); | |||
2664 | m_log.Warn("[PHYSICS]: Too many crossing failures for: " + Name); | 2664 | m_log.Warn("[PHYSICS]: Too many crossing failures for: " + Name); |
2665 | } | 2665 | } |
2666 | */ | 2666 | */ |
2667 | |||
2668 | d.AllocateODEDataForThread(0U); | ||
2669 | |||
2667 | _position.X = Util.Clip(_position.X, 0.5f, _parent_scene.WorldExtents.X - 0.5f); | 2670 | _position.X = Util.Clip(_position.X, 0.5f, _parent_scene.WorldExtents.X - 0.5f); |
2668 | _position.Y = Util.Clip(_position.Y, 0.5f, _parent_scene.WorldExtents.Y - 0.5f); | 2671 | _position.Y = Util.Clip(_position.Y, 0.5f, _parent_scene.WorldExtents.Y - 0.5f); |
2669 | _position.Z = Util.Clip(_position.Z + 0.2f, -100f, 50000f); | 2672 | _position.Z = Util.Clip(_position.Z + 0.2f, -100f, 50000f); |
diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 8b369c8..040322a 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | |||
@@ -1408,22 +1408,10 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1408 | { | 1408 | { |
1409 | if (Math.Abs(contact.depth - contactGeom.depth) < 0.052f) | 1409 | if (Math.Abs(contact.depth - contactGeom.depth) < 0.052f) |
1410 | { | 1410 | { |
1411 | //contactGeom.depth *= .00005f; | 1411 | result = true; |
1412 | //m_log.DebugFormat("[Collsion]: Depth {0}", Math.Abs(contact.depth - contactGeom.depth)); | 1412 | break; |
1413 | // m_log.DebugFormat("[Collision]: <{0},{1},{2}>", Math.Abs(contactGeom.normal.X - contact.normal.X), Math.Abs(contactGeom.normal.Y - contact.normal.Y), Math.Abs(contactGeom.normal.Z - contact.normal.Z)); | ||
1414 | result = true; | ||
1415 | break; | ||
1416 | } | 1413 | } |
1417 | // else | ||
1418 | // { | ||
1419 | // //m_log.DebugFormat("[Collsion]: Depth {0}", Math.Abs(contact.depth - contactGeom.depth)); | ||
1420 | // } | ||
1421 | } | 1414 | } |
1422 | // else | ||
1423 | // { | ||
1424 | // //m_log.DebugFormat("[Collision]: <{0},{1},{2}>", Math.Abs(contactGeom.normal.X - contact.normal.X), Math.Abs(contactGeom.normal.Y - contact.normal.Y), Math.Abs(contactGeom.normal.Z - contact.normal.Z)); | ||
1425 | // //int i = 0; | ||
1426 | // } | ||
1427 | } | 1415 | } |
1428 | else if (at == ActorTypes.Prim) | 1416 | else if (at == ActorTypes.Prim) |
1429 | { | 1417 | { |
@@ -1715,7 +1703,9 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1715 | #region Add/Remove Entities | 1703 | #region Add/Remove Entities |
1716 | 1704 | ||
1717 | public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying) | 1705 | public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying) |
1718 | { | 1706 | { |
1707 | d.AllocateODEDataForThread(0); | ||
1708 | |||
1719 | OdeCharacter newAv | 1709 | OdeCharacter newAv |
1720 | = new OdeCharacter( | 1710 | = new OdeCharacter( |
1721 | avName, this, position, velocity, size, avPIDD, avPIDP, | 1711 | avName, this, position, velocity, size, avPIDD, avPIDP, |
@@ -1735,7 +1725,12 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1735 | // "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}", | 1725 | // "[ODE SCENE]: Removing physics character {0} {1} from physics scene {2}", |
1736 | // actor.Name, actor.LocalID, Name); | 1726 | // actor.Name, actor.LocalID, Name); |
1737 | 1727 | ||
1738 | ((OdeCharacter) actor).Destroy(); | 1728 | lock (OdeLock) |
1729 | { | ||
1730 | d.AllocateODEDataForThread(0); | ||
1731 | |||
1732 | ((OdeCharacter) actor).Destroy(); | ||
1733 | } | ||
1739 | } | 1734 | } |
1740 | 1735 | ||
1741 | internal void AddCharacter(OdeCharacter chr) | 1736 | internal void AddCharacter(OdeCharacter chr) |
@@ -1785,9 +1780,11 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1785 | Vector3 siz = size; | 1780 | Vector3 siz = size; |
1786 | Quaternion rot = rotation; | 1781 | Quaternion rot = rotation; |
1787 | 1782 | ||
1783 | |||
1788 | OdePrim newPrim; | 1784 | OdePrim newPrim; |
1789 | lock (OdeLock) | 1785 | lock (OdeLock) |
1790 | { | 1786 | { |
1787 | d.AllocateODEDataForThread(0); | ||
1791 | newPrim = new OdePrim(name, this, pos, siz, rot, pbs, isphysical); | 1788 | newPrim = new OdePrim(name, this, pos, siz, rot, pbs, isphysical); |
1792 | 1789 | ||
1793 | lock (_prims) | 1790 | lock (_prims) |
@@ -2633,9 +2630,12 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
2633 | int donechanges = 0; | 2630 | int donechanges = 0; |
2634 | if (_taintedPrims.Count > 0) | 2631 | if (_taintedPrims.Count > 0) |
2635 | { | 2632 | { |
2633 | |||
2636 | m_log.InfoFormat("[Ode] start processing pending actor operations"); | 2634 | m_log.InfoFormat("[Ode] start processing pending actor operations"); |
2637 | int tstart = Util.EnvironmentTickCount(); | 2635 | int tstart = Util.EnvironmentTickCount(); |
2638 | 2636 | ||
2637 | d.AllocateODEDataForThread(0); | ||
2638 | |||
2639 | lock (_taintedPrims) | 2639 | lock (_taintedPrims) |
2640 | { | 2640 | { |
2641 | foreach (OdePrim prim in _taintedPrims) | 2641 | foreach (OdePrim prim in _taintedPrims) |
@@ -2716,6 +2716,8 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
2716 | 2716 | ||
2717 | lock (OdeLock) | 2717 | lock (OdeLock) |
2718 | { | 2718 | { |
2719 | d.AllocateODEDataForThread(~0U); | ||
2720 | |||
2719 | while (step_time > HalfOdeStep) | 2721 | while (step_time > HalfOdeStep) |
2720 | { | 2722 | { |
2721 | try | 2723 | try |
@@ -3293,6 +3295,8 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
3293 | 3295 | ||
3294 | lock (OdeLock) | 3296 | lock (OdeLock) |
3295 | { | 3297 | { |
3298 | d.AllocateODEDataForThread(~0U); | ||
3299 | |||
3296 | IntPtr GroundGeom = IntPtr.Zero; | 3300 | IntPtr GroundGeom = IntPtr.Zero; |
3297 | if (RegionTerrain.TryGetValue(pOffset, out GroundGeom)) | 3301 | if (RegionTerrain.TryGetValue(pOffset, out GroundGeom)) |
3298 | { | 3302 | { |
@@ -3380,6 +3384,8 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
3380 | 3384 | ||
3381 | _worldInitialized = false; | 3385 | _worldInitialized = false; |
3382 | 3386 | ||
3387 | d.AllocateODEDataForThread(~0U); | ||
3388 | |||
3383 | if (m_rayCastManager != null) | 3389 | if (m_rayCastManager != null) |
3384 | { | 3390 | { |
3385 | m_rayCastManager.Dispose(); | 3391 | m_rayCastManager.Dispose(); |