diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/CollisionSounds.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneManager.cs | 266 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsActor.cs | 29 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | 137 |
7 files changed, 245 insertions, 252 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 49a8e64..9e72a98 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -1673,16 +1673,25 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1673 | Hashtable responseData = (Hashtable)response.Value; | 1673 | Hashtable responseData = (Hashtable)response.Value; |
1674 | Hashtable requestData = (Hashtable)request.Params[0]; | 1674 | Hashtable requestData = (Hashtable)request.Params[0]; |
1675 | 1675 | ||
1676 | int flags = 0; | ||
1677 | string text = String.Empty; | ||
1678 | int health = 0; | ||
1676 | responseData["success"] = true; | 1679 | responseData["success"] = true; |
1677 | 1680 | ||
1678 | CheckRegionParams(requestData, responseData); | 1681 | CheckRegionParams(requestData, responseData); |
1679 | 1682 | ||
1680 | Scene scene = null; | 1683 | Scene scene = null; |
1681 | GetSceneFromRegionParams(requestData, responseData, out scene); | 1684 | try |
1685 | { | ||
1686 | GetSceneFromRegionParams(requestData, responseData, out scene); | ||
1687 | health = scene.GetHealth(out flags, out text); | ||
1688 | } | ||
1689 | catch (Exception e) | ||
1690 | { | ||
1691 | responseData["error"] = null; | ||
1692 | } | ||
1682 | 1693 | ||
1683 | int flags; | 1694 | responseData["success"] = true; |
1684 | string text; | ||
1685 | int health = scene.GetHealth(out flags, out text); | ||
1686 | responseData["health"] = health; | 1695 | responseData["health"] = health; |
1687 | responseData["flags"] = flags; | 1696 | responseData["flags"] = flags; |
1688 | responseData["message"] = text; | 1697 | responseData["message"] = text; |
diff --git a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs index 81ca9f1..de82ddc 100644 --- a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs +++ b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs | |||
@@ -188,6 +188,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
188 | 188 | ||
189 | public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist) | 189 | public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist) |
190 | { | 190 | { |
191 | // disable for now | ||
192 | return; | ||
193 | |||
191 | if (collidersinfolist.Count == 0 || part == null) | 194 | if (collidersinfolist.Count == 0 || part == null) |
192 | return; | 195 | return; |
193 | 196 | ||
@@ -296,7 +299,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
296 | } | 299 | } |
297 | 300 | ||
298 | public static void AvatarCollisionSound(ScenePresence av, List<CollisionForSoundInfo> collidersinfolist) | 301 | public static void AvatarCollisionSound(ScenePresence av, List<CollisionForSoundInfo> collidersinfolist) |
299 | { | 302 | { |
303 | // disable for now | ||
304 | return; | ||
305 | |||
300 | if (collidersinfolist.Count == 0 || av == null) | 306 | if (collidersinfolist.Count == 0 || av == null) |
301 | return; | 307 | return; |
302 | 308 | ||
@@ -368,4 +374,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
368 | } | 374 | } |
369 | } | 375 | } |
370 | } | 376 | } |
371 | } | 377 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index e4eaf3a..e3fed49 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs | |||
@@ -53,12 +53,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
53 | get { return m_instance; } | 53 | get { return m_instance; } |
54 | } | 54 | } |
55 | 55 | ||
56 | private readonly List<Scene> m_localScenes = new List<Scene>(); | 56 | private readonly DoubleDictionary<UUID, string, Scene> m_localScenes = new DoubleDictionary<UUID, string, Scene>(); |
57 | private Scene m_currentScene = null; | 57 | private Scene m_currentScene = null; |
58 | 58 | ||
59 | public List<Scene> Scenes | 59 | public List<Scene> Scenes |
60 | { | 60 | { |
61 | get { return new List<Scene>(m_localScenes); } | 61 | get { return new List<Scene>(m_localScenes.FindAll(delegate(Scene s) { return true; })); } |
62 | } | 62 | } |
63 | 63 | ||
64 | public Scene CurrentScene | 64 | public Scene CurrentScene |
@@ -72,13 +72,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
72 | { | 72 | { |
73 | if (m_currentScene == null) | 73 | if (m_currentScene == null) |
74 | { | 74 | { |
75 | lock (m_localScenes) | 75 | List<Scene> sceneList = Scenes; |
76 | { | 76 | if (sceneList.Count == 0) |
77 | if (m_localScenes.Count > 0) | 77 | return null; |
78 | return m_localScenes[0]; | 78 | return sceneList[0]; |
79 | else | ||
80 | return null; | ||
81 | } | ||
82 | } | 79 | } |
83 | else | 80 | else |
84 | { | 81 | { |
@@ -90,7 +87,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
90 | public SceneManager() | 87 | public SceneManager() |
91 | { | 88 | { |
92 | m_instance = this; | 89 | m_instance = this; |
93 | m_localScenes = new List<Scene>(); | 90 | m_localScenes = new DoubleDictionary<UUID, string, Scene>(); |
94 | } | 91 | } |
95 | 92 | ||
96 | public void Close() | 93 | public void Close() |
@@ -98,20 +95,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
98 | // collect known shared modules in sharedModules | 95 | // collect known shared modules in sharedModules |
99 | Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>(); | 96 | Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>(); |
100 | 97 | ||
101 | lock (m_localScenes) | 98 | List<Scene> sceneList = Scenes; |
99 | for (int i = 0; i < sceneList.Count; i++) | ||
102 | { | 100 | { |
103 | for (int i = 0; i < m_localScenes.Count; i++) | 101 | // extract known shared modules from scene |
102 | foreach (string k in sceneList[i].Modules.Keys) | ||
104 | { | 103 | { |
105 | // extract known shared modules from scene | 104 | if (sceneList[i].Modules[k].IsSharedModule && |
106 | foreach (string k in m_localScenes[i].Modules.Keys) | 105 | !sharedModules.ContainsKey(k)) |
107 | { | 106 | sharedModules[k] = sceneList[i].Modules[k]; |
108 | if (m_localScenes[i].Modules[k].IsSharedModule && | ||
109 | !sharedModules.ContainsKey(k)) | ||
110 | sharedModules[k] = m_localScenes[i].Modules[k]; | ||
111 | } | ||
112 | // close scene/region | ||
113 | m_localScenes[i].Close(); | ||
114 | } | 107 | } |
108 | // close scene/region | ||
109 | sceneList[i].Close(); | ||
115 | } | 110 | } |
116 | 111 | ||
117 | // all regions/scenes are now closed, we can now safely | 112 | // all regions/scenes are now closed, we can now safely |
@@ -120,31 +115,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
120 | { | 115 | { |
121 | mod.Close(); | 116 | mod.Close(); |
122 | } | 117 | } |
118 | |||
119 | m_localScenes.Clear(); | ||
123 | } | 120 | } |
124 | 121 | ||
125 | public void Close(Scene cscene) | 122 | public void Close(Scene cscene) |
126 | { | 123 | { |
127 | lock (m_localScenes) | 124 | if (!m_localScenes.ContainsKey(cscene.RegionInfo.RegionID)) |
128 | { | 125 | return; |
129 | if (m_localScenes.Contains(cscene)) | 126 | cscene.Close(); |
130 | { | ||
131 | for (int i = 0; i < m_localScenes.Count; i++) | ||
132 | { | ||
133 | if (m_localScenes[i].Equals(cscene)) | ||
134 | { | ||
135 | m_localScenes[i].Close(); | ||
136 | } | ||
137 | } | ||
138 | } | ||
139 | } | ||
140 | } | 127 | } |
141 | 128 | ||
142 | public void Add(Scene scene) | 129 | public void Add(Scene scene) |
143 | { | 130 | { |
144 | scene.OnRestart += HandleRestart; | 131 | scene.OnRestart += HandleRestart; |
145 | 132 | ||
146 | lock (m_localScenes) | 133 | m_localScenes.Add(scene.RegionInfo.RegionID, scene.RegionInfo.RegionName, scene); |
147 | m_localScenes.Add(scene); | ||
148 | } | 134 | } |
149 | 135 | ||
150 | public void HandleRestart(RegionInfo rdata) | 136 | public void HandleRestart(RegionInfo rdata) |
@@ -152,24 +138,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
152 | m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main"); | 138 | m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main"); |
153 | int RegionSceneElement = -1; | 139 | int RegionSceneElement = -1; |
154 | 140 | ||
155 | lock (m_localScenes) | 141 | m_localScenes.Remove(rdata.RegionID); |
156 | { | ||
157 | for (int i = 0; i < m_localScenes.Count; i++) | ||
158 | { | ||
159 | if (rdata.RegionName == m_localScenes[i].RegionInfo.RegionName) | ||
160 | { | ||
161 | RegionSceneElement = i; | ||
162 | } | ||
163 | } | ||
164 | |||
165 | // Now we make sure the region is no longer known about by the SceneManager | ||
166 | // Prevents duplicates. | ||
167 | |||
168 | if (RegionSceneElement >= 0) | ||
169 | { | ||
170 | m_localScenes.RemoveAt(RegionSceneElement); | ||
171 | } | ||
172 | } | ||
173 | 142 | ||
174 | // Send signal to main that we're restarting this sim. | 143 | // Send signal to main that we're restarting this sim. |
175 | OnRestartSim(rdata); | 144 | OnRestartSim(rdata); |
@@ -179,32 +148,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
179 | { | 148 | { |
180 | RegionInfo Result = null; | 149 | RegionInfo Result = null; |
181 | 150 | ||
182 | lock (m_localScenes) | 151 | Scene s = m_localScenes.FindValue(delegate(Scene x) |
183 | { | ||
184 | for (int i = 0; i < m_localScenes.Count; i++) | ||
185 | { | ||
186 | if (m_localScenes[i].RegionInfo.RegionHandle == regionHandle) | ||
187 | { | 152 | { |
188 | // Inform other regions to tell their avatar about me | 153 | if (x.RegionInfo.RegionHandle == regionHandle) |
189 | Result = m_localScenes[i].RegionInfo; | 154 | return true; |
190 | } | 155 | return false; |
191 | } | 156 | }); |
192 | 157 | ||
193 | if (Result != null) | 158 | if (s != null) |
159 | { | ||
160 | List<Scene> sceneList = Scenes; | ||
161 | |||
162 | for (int i = 0; i < sceneList.Count; i++) | ||
194 | { | 163 | { |
195 | for (int i = 0; i < m_localScenes.Count; i++) | 164 | if (sceneList[i]!= s) |
196 | { | 165 | { |
197 | if (m_localScenes[i].RegionInfo.RegionHandle != regionHandle) | 166 | // Inform other regions to tell their avatar about me |
198 | { | 167 | //sceneList[i].OtherRegionUp(Result); |
199 | // Inform other regions to tell their avatar about me | ||
200 | //m_localScenes[i].OtherRegionUp(Result); | ||
201 | } | ||
202 | } | 168 | } |
203 | } | 169 | } |
204 | else | 170 | } |
205 | { | 171 | else |
206 | m_log.Error("[REGION]: Unable to notify Other regions of this Region coming up"); | 172 | { |
207 | } | 173 | m_log.Error("[REGION]: Unable to notify Other regions of this Region coming up"); |
208 | } | 174 | } |
209 | } | 175 | } |
210 | 176 | ||
@@ -308,8 +274,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
308 | { | 274 | { |
309 | if (m_currentScene == null) | 275 | if (m_currentScene == null) |
310 | { | 276 | { |
311 | lock (m_localScenes) | 277 | List<Scene> sceneList = Scenes; |
312 | m_localScenes.ForEach(func); | 278 | sceneList.ForEach(func); |
313 | } | 279 | } |
314 | else | 280 | else |
315 | { | 281 | { |
@@ -338,16 +304,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
338 | } | 304 | } |
339 | else | 305 | else |
340 | { | 306 | { |
341 | lock (m_localScenes) | 307 | Scene s; |
308 | |||
309 | if (m_localScenes.TryGetValue(regionName, out s)) | ||
342 | { | 310 | { |
343 | foreach (Scene scene in m_localScenes) | 311 | m_currentScene = s; |
344 | { | 312 | return true; |
345 | if (String.Compare(scene.RegionInfo.RegionName, regionName, true) == 0) | ||
346 | { | ||
347 | m_currentScene = scene; | ||
348 | return true; | ||
349 | } | ||
350 | } | ||
351 | } | 313 | } |
352 | 314 | ||
353 | return false; | 315 | return false; |
@@ -358,16 +320,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
358 | { | 320 | { |
359 | // m_log.Debug("Searching for Region: '" + regionID + "'"); | 321 | // m_log.Debug("Searching for Region: '" + regionID + "'"); |
360 | 322 | ||
361 | lock (m_localScenes) | 323 | Scene s; |
324 | |||
325 | if (m_localScenes.TryGetValue(regionID, out s)) | ||
362 | { | 326 | { |
363 | foreach (Scene scene in m_localScenes) | 327 | m_currentScene = s; |
364 | { | 328 | return true; |
365 | if (scene.RegionInfo.RegionID == regionID) | ||
366 | { | ||
367 | m_currentScene = scene; | ||
368 | return true; | ||
369 | } | ||
370 | } | ||
371 | } | 329 | } |
372 | 330 | ||
373 | return false; | 331 | return false; |
@@ -375,52 +333,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
375 | 333 | ||
376 | public bool TryGetScene(string regionName, out Scene scene) | 334 | public bool TryGetScene(string regionName, out Scene scene) |
377 | { | 335 | { |
378 | lock (m_localScenes) | 336 | return m_localScenes.TryGetValue(regionName, out scene); |
379 | { | ||
380 | foreach (Scene mscene in m_localScenes) | ||
381 | { | ||
382 | if (String.Compare(mscene.RegionInfo.RegionName, regionName, true) == 0) | ||
383 | { | ||
384 | scene = mscene; | ||
385 | return true; | ||
386 | } | ||
387 | } | ||
388 | } | ||
389 | |||
390 | scene = null; | ||
391 | return false; | ||
392 | } | 337 | } |
393 | 338 | ||
394 | public bool TryGetScene(UUID regionID, out Scene scene) | 339 | public bool TryGetScene(UUID regionID, out Scene scene) |
395 | { | 340 | { |
396 | lock (m_localScenes) | 341 | return m_localScenes.TryGetValue(regionID, out scene); |
397 | { | ||
398 | foreach (Scene mscene in m_localScenes) | ||
399 | { | ||
400 | if (mscene.RegionInfo.RegionID == regionID) | ||
401 | { | ||
402 | scene = mscene; | ||
403 | return true; | ||
404 | } | ||
405 | } | ||
406 | } | ||
407 | |||
408 | scene = null; | ||
409 | return false; | ||
410 | } | 342 | } |
411 | 343 | ||
412 | public bool TryGetScene(uint locX, uint locY, out Scene scene) | 344 | public bool TryGetScene(uint locX, uint locY, out Scene scene) |
413 | { | 345 | { |
414 | lock (m_localScenes) | 346 | List<Scene> sceneList = Scenes; |
347 | foreach (Scene mscene in sceneList) | ||
415 | { | 348 | { |
416 | foreach (Scene mscene in m_localScenes) | 349 | if (mscene.RegionInfo.RegionLocX == locX && |
350 | mscene.RegionInfo.RegionLocY == locY) | ||
417 | { | 351 | { |
418 | if (mscene.RegionInfo.RegionLocX == locX && | 352 | scene = mscene; |
419 | mscene.RegionInfo.RegionLocY == locY) | 353 | return true; |
420 | { | ||
421 | scene = mscene; | ||
422 | return true; | ||
423 | } | ||
424 | } | 354 | } |
425 | } | 355 | } |
426 | 356 | ||
@@ -430,16 +360,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
430 | 360 | ||
431 | public bool TryGetScene(IPEndPoint ipEndPoint, out Scene scene) | 361 | public bool TryGetScene(IPEndPoint ipEndPoint, out Scene scene) |
432 | { | 362 | { |
433 | lock (m_localScenes) | 363 | List<Scene> sceneList = Scenes; |
364 | foreach (Scene mscene in sceneList) | ||
434 | { | 365 | { |
435 | foreach (Scene mscene in m_localScenes) | 366 | if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) && |
367 | (mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port)) | ||
436 | { | 368 | { |
437 | if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) && | 369 | scene = mscene; |
438 | (mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port)) | 370 | return true; |
439 | { | ||
440 | scene = mscene; | ||
441 | return true; | ||
442 | } | ||
443 | } | 371 | } |
444 | } | 372 | } |
445 | 373 | ||
@@ -504,15 +432,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
504 | 432 | ||
505 | public RegionInfo GetRegionInfo(UUID regionID) | 433 | public RegionInfo GetRegionInfo(UUID regionID) |
506 | { | 434 | { |
507 | lock (m_localScenes) | 435 | Scene s; |
436 | if (m_localScenes.TryGetValue(regionID, out s)) | ||
508 | { | 437 | { |
509 | foreach (Scene scene in m_localScenes) | 438 | return s.RegionInfo; |
510 | { | ||
511 | if (scene.RegionInfo.RegionID == regionID) | ||
512 | { | ||
513 | return scene.RegionInfo; | ||
514 | } | ||
515 | } | ||
516 | } | 439 | } |
517 | 440 | ||
518 | return null; | 441 | return null; |
@@ -530,14 +453,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
530 | 453 | ||
531 | public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) | 454 | public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) |
532 | { | 455 | { |
533 | lock (m_localScenes) | 456 | List<Scene> sceneList = Scenes; |
457 | foreach (Scene scene in sceneList) | ||
534 | { | 458 | { |
535 | foreach (Scene scene in m_localScenes) | 459 | if (scene.TryGetScenePresence(avatarId, out avatar)) |
536 | { | 460 | { |
537 | if (scene.TryGetScenePresence(avatarId, out avatar)) | 461 | return true; |
538 | { | ||
539 | return true; | ||
540 | } | ||
541 | } | 462 | } |
542 | } | 463 | } |
543 | 464 | ||
@@ -547,15 +468,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
547 | 468 | ||
548 | public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar) | 469 | public bool TryGetRootScenePresence(UUID avatarId, out ScenePresence avatar) |
549 | { | 470 | { |
550 | lock (m_localScenes) | 471 | List<Scene> sceneList = Scenes; |
472 | foreach (Scene scene in sceneList) | ||
551 | { | 473 | { |
552 | foreach (Scene scene in m_localScenes) | 474 | avatar = scene.GetScenePresence(avatarId); |
553 | { | ||
554 | avatar = scene.GetScenePresence(avatarId); | ||
555 | 475 | ||
556 | if (avatar != null && !avatar.IsChildAgent) | 476 | if (avatar != null && !avatar.IsChildAgent) |
557 | return true; | 477 | return true; |
558 | } | ||
559 | } | 478 | } |
560 | 479 | ||
561 | avatar = null; | 480 | avatar = null; |
@@ -564,22 +483,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
564 | 483 | ||
565 | public void CloseScene(Scene scene) | 484 | public void CloseScene(Scene scene) |
566 | { | 485 | { |
567 | lock (m_localScenes) | 486 | m_localScenes.Remove(scene.RegionInfo.RegionID); |
568 | m_localScenes.Remove(scene); | ||
569 | 487 | ||
570 | scene.Close(); | 488 | scene.Close(); |
571 | } | 489 | } |
572 | 490 | ||
573 | public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar) | 491 | public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar) |
574 | { | 492 | { |
575 | lock (m_localScenes) | 493 | List<Scene> sceneList = Scenes; |
494 | foreach (Scene scene in sceneList) | ||
576 | { | 495 | { |
577 | foreach (Scene scene in m_localScenes) | 496 | if (scene.TryGetAvatarByName(avatarName, out avatar)) |
578 | { | 497 | { |
579 | if (scene.TryGetAvatarByName(avatarName, out avatar)) | 498 | return true; |
580 | { | ||
581 | return true; | ||
582 | } | ||
583 | } | 499 | } |
584 | } | 500 | } |
585 | 501 | ||
@@ -589,14 +505,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
589 | 505 | ||
590 | public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp) | 506 | public bool TryGetRootScenePresenceByName(string firstName, string lastName, out ScenePresence sp) |
591 | { | 507 | { |
592 | lock (m_localScenes) | 508 | List<Scene> sceneList = Scenes; |
509 | foreach (Scene scene in sceneList) | ||
593 | { | 510 | { |
594 | foreach (Scene scene in m_localScenes) | 511 | sp = scene.GetScenePresence(firstName, lastName); |
595 | { | 512 | if (sp != null && !sp.IsChildAgent) |
596 | sp = scene.GetScenePresence(firstName, lastName); | 513 | return true; |
597 | if (sp != null && !sp.IsChildAgent) | ||
598 | return true; | ||
599 | } | ||
600 | } | 514 | } |
601 | 515 | ||
602 | sp = null; | 516 | sp = null; |
@@ -605,8 +519,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
605 | 519 | ||
606 | public void ForEachScene(Action<Scene> action) | 520 | public void ForEachScene(Action<Scene> action) |
607 | { | 521 | { |
608 | lock (m_localScenes) | 522 | List<Scene> sceneList = Scenes; |
609 | m_localScenes.ForEach(action); | 523 | sceneList.ForEach(action); |
610 | } | 524 | } |
611 | } | 525 | } |
612 | } | 526 | } |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index fb90887..aaeae86 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -294,6 +294,34 @@ namespace OpenSim.Region.Physics.Manager | |||
294 | public abstract Vector3 GeometricCenter { get; } | 294 | public abstract Vector3 GeometricCenter { get; } |
295 | public abstract Vector3 CenterOfMass { get; } | 295 | public abstract Vector3 CenterOfMass { get; } |
296 | 296 | ||
297 | public virtual Vector3 OOBsize | ||
298 | { | ||
299 | get | ||
300 | { | ||
301 | Vector3 s=Size; | ||
302 | s.X *=0.5f; | ||
303 | s.Y *=0.5f; | ||
304 | s.Z *=0.5f; | ||
305 | return s; | ||
306 | } | ||
307 | } | ||
308 | |||
309 | public virtual Vector3 OOBoffset | ||
310 | { | ||
311 | get | ||
312 | { | ||
313 | return Vector3.Zero; | ||
314 | } | ||
315 | } | ||
316 | |||
317 | public virtual float OOBRadiusSQ | ||
318 | { | ||
319 | get | ||
320 | { | ||
321 | return Size.LengthSquared() * 0.25f; // ((0.5^2) | ||
322 | } | ||
323 | } | ||
324 | |||
297 | /// <summary> | 325 | /// <summary> |
298 | /// Velocity of this actor. | 326 | /// Velocity of this actor. |
299 | /// </summary> | 327 | /// </summary> |
@@ -429,7 +457,6 @@ namespace OpenSim.Region.Physics.Manager | |||
429 | 457 | ||
430 | public override void VehicleFloatParam(int param, float value) | 458 | public override void VehicleFloatParam(int param, float value) |
431 | { | 459 | { |
432 | |||
433 | } | 460 | } |
434 | 461 | ||
435 | public override void VehicleVectorParam(int param, Vector3 value) | 462 | public override void VehicleVectorParam(int param, Vector3 value) |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index 1084b0e..093bc3c 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | |||
@@ -522,29 +522,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
522 | } | 522 | } |
523 | } | 523 | } |
524 | 524 | ||
525 | //UBit mess | ||
526 | /* for later use | ||
527 | public override Vector3 PrimOOBsize | ||
528 | { | ||
529 | get | ||
530 | { | ||
531 | Vector3 s=Size; | ||
532 | s.X *=0.5f; | ||
533 | s.Y *=0.5f; | ||
534 | s.Z *=0.5f; | ||
535 | return s; | ||
536 | } | ||
537 | } | ||
538 | |||
539 | public override Vector3 PrimOOBoffset | ||
540 | { | ||
541 | get | ||
542 | { | ||
543 | return Vector3.Zero; | ||
544 | } | ||
545 | } | ||
546 | */ | ||
547 | |||
548 | public override PrimitiveBaseShape Shape | 525 | public override PrimitiveBaseShape Shape |
549 | { | 526 | { |
550 | set { return; } | 527 | set { return; } |
@@ -1345,8 +1322,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1345 | m_iscollidingGround = false; | 1322 | m_iscollidingGround = false; |
1346 | m_iscollidingObj = false; | 1323 | m_iscollidingObj = false; |
1347 | 1324 | ||
1348 | CollisionEventsThisFrame = new CollisionEventUpdate(); | 1325 | CollisionEventsThisFrame.Clear(); |
1349 | m_eventsubscription = 0; | ||
1350 | } | 1326 | } |
1351 | 1327 | ||
1352 | private void changeForce(Vector3 newForce) | 1328 | private void changeForce(Vector3 newForce) |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 62fd279..5109a6a 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -504,8 +504,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
504 | } | 504 | } |
505 | } | 505 | } |
506 | } | 506 | } |
507 | /* | 507 | |
508 | public override Vector3 PrimOOBsize | 508 | public override Vector3 OOBsize |
509 | { | 509 | { |
510 | get | 510 | get |
511 | { | 511 | { |
@@ -513,7 +513,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
513 | } | 513 | } |
514 | } | 514 | } |
515 | 515 | ||
516 | public override Vector3 PrimOOBoffset | 516 | public override Vector3 OOBoffset |
517 | { | 517 | { |
518 | get | 518 | get |
519 | { | 519 | { |
@@ -521,14 +521,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
521 | } | 521 | } |
522 | } | 522 | } |
523 | 523 | ||
524 | public override float PrimOOBRadiusSQ | 524 | public override float OOBRadiusSQ |
525 | { | 525 | { |
526 | get | 526 | get |
527 | { | 527 | { |
528 | return primOOBradiusSQ; | 528 | return primOOBradiusSQ; |
529 | } | 529 | } |
530 | } | 530 | } |
531 | */ | 531 | |
532 | public override PrimitiveBaseShape Shape | 532 | public override PrimitiveBaseShape Shape |
533 | { | 533 | { |
534 | set | 534 | set |
@@ -2562,10 +2562,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2562 | { | 2562 | { |
2563 | d.Quaternion qtmp; | 2563 | d.Quaternion qtmp; |
2564 | d.GeomCopyQuaternion(prim_geom, out qtmp); | 2564 | d.GeomCopyQuaternion(prim_geom, out qtmp); |
2565 | _orientation.W = qtmp.W; | ||
2566 | _orientation.X = qtmp.X; | 2565 | _orientation.X = qtmp.X; |
2567 | _orientation.Y = qtmp.Y; | 2566 | _orientation.Y = qtmp.Y; |
2568 | _orientation.Z = qtmp.Z; | 2567 | _orientation.Z = qtmp.Z; |
2568 | _orientation.W = qtmp.W; | ||
2569 | 2569 | ||
2570 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); | 2570 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); |
2571 | _position.X = lpos.X; | 2571 | _position.X = lpos.X; |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index bfcfd21..286c7f0 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -1006,16 +1006,82 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1006 | else | 1006 | else |
1007 | 1007 | ||
1008 | { | 1008 | { |
1009 | if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f) | ||
1010 | p1.IsColliding = true; | ||
1011 | if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f) | ||
1012 | p2.IsColliding = true; | ||
1013 | 1009 | ||
1014 | if (AvanormOverride && curContact.depth > 0.3f) | 1010 | if (AvanormOverride) |
1015 | { | 1011 | { |
1016 | curContact.normal.X = normoverride.X; | 1012 | if (curContact.depth > 0.3f) |
1017 | curContact.normal.Y = normoverride.Y; | 1013 | { |
1018 | curContact.normal.Z = normoverride.Z; | 1014 | if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f) |
1015 | p1.IsColliding = true; | ||
1016 | if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f) | ||
1017 | p2.IsColliding = true; | ||
1018 | curContact.normal.X = normoverride.X; | ||
1019 | curContact.normal.Y = normoverride.Y; | ||
1020 | curContact.normal.Z = normoverride.Z; | ||
1021 | } | ||
1022 | |||
1023 | else | ||
1024 | { | ||
1025 | if (dop1foot) | ||
1026 | { | ||
1027 | float sz = p1.Size.Z; | ||
1028 | Vector3 vtmp = p1.Position; | ||
1029 | float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f; | ||
1030 | if (ppos > 0f) | ||
1031 | { | ||
1032 | if (!p1.Flying) | ||
1033 | { | ||
1034 | d.AABB aabb; | ||
1035 | d.GeomGetAABB(g2, out aabb); | ||
1036 | float tmp = vtmp.Z - sz * .25f; | ||
1037 | |||
1038 | if (aabb.MaxZ < tmp) | ||
1039 | { | ||
1040 | vtmp.X = curContact.pos.X - vtmp.X; | ||
1041 | vtmp.Y = curContact.pos.Y - vtmp.Y; | ||
1042 | vtmp.Z = -0.2f; | ||
1043 | vtmp.Normalize(); | ||
1044 | curContact.normal.X = vtmp.X; | ||
1045 | curContact.normal.Y = vtmp.Y; | ||
1046 | curContact.normal.Z = vtmp.Z; | ||
1047 | } | ||
1048 | } | ||
1049 | } | ||
1050 | else | ||
1051 | p1.IsColliding = true; | ||
1052 | |||
1053 | } | ||
1054 | |||
1055 | if (dop2foot) | ||
1056 | { | ||
1057 | float sz = p2.Size.Z; | ||
1058 | Vector3 vtmp = p2.Position; | ||
1059 | float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f; | ||
1060 | if (ppos > 0f) | ||
1061 | { | ||
1062 | if (!p2.Flying) | ||
1063 | { | ||
1064 | d.AABB aabb; | ||
1065 | d.GeomGetAABB(g1, out aabb); | ||
1066 | float tmp = vtmp.Z - sz * .25f; | ||
1067 | |||
1068 | if (aabb.MaxZ < tmp) | ||
1069 | { | ||
1070 | vtmp.X = curContact.pos.X - vtmp.X; | ||
1071 | vtmp.Y = curContact.pos.Y - vtmp.Y; | ||
1072 | vtmp.Z = -0.2f; | ||
1073 | vtmp.Normalize(); | ||
1074 | curContact.normal.X = vtmp.X; | ||
1075 | curContact.normal.Y = vtmp.Y; | ||
1076 | curContact.normal.Z = vtmp.Z; | ||
1077 | } | ||
1078 | } | ||
1079 | } | ||
1080 | else | ||
1081 | p2.IsColliding = true; | ||
1082 | |||
1083 | } | ||
1084 | } | ||
1019 | } | 1085 | } |
1020 | 1086 | ||
1021 | Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale); | 1087 | Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale); |
@@ -1609,41 +1675,40 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1609 | /// <returns></returns> | 1675 | /// <returns></returns> |
1610 | public bool needsMeshing(PrimitiveBaseShape pbs) | 1676 | public bool needsMeshing(PrimitiveBaseShape pbs) |
1611 | { | 1677 | { |
1612 | // most of this is redundant now as the mesher will return null if it cant mesh a prim | 1678 | // check sculpts or meshs |
1613 | // but we still need to check for sculptie meshing being enabled so this is the most | ||
1614 | // convenient place to do it for now... | ||
1615 | |||
1616 | // //if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle && pbs.ProfileCurve == (byte)Primitive.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f) | ||
1617 | // //m_log.Debug("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + Primitive.UnpackPathScale(pbs.PathScaleY).ToString()); | ||
1618 | int iPropertiesNotSupportedDefault = 0; | ||
1619 | |||
1620 | if (pbs.SculptEntry) | 1679 | if (pbs.SculptEntry) |
1621 | { | 1680 | { |
1622 | if(!meshSculptedPrim) | 1681 | if (meshSculptedPrim) |
1623 | return false; | 1682 | return true; |
1683 | |||
1684 | if (pbs.SculptType == (byte)SculptType.Mesh) // always do meshs | ||
1685 | return true; | ||
1686 | |||
1687 | return false; | ||
1624 | } | 1688 | } |
1625 | 1689 | ||
1690 | if (forceSimplePrimMeshing) | ||
1691 | return true; | ||
1692 | |||
1626 | // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim | 1693 | // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim |
1627 | if (!forceSimplePrimMeshing && !pbs.SculptEntry) | 1694 | |
1628 | { | 1695 | if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight) |
1629 | if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight) | ||
1630 | || (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1 | 1696 | || (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1 |
1631 | && pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z)) | 1697 | && pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z)) |
1632 | { | 1698 | { |
1633 | 1699 | ||
1634 | if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0 | 1700 | if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0 |
1635 | && pbs.ProfileHollow == 0 | 1701 | && pbs.ProfileHollow == 0 |
1636 | && pbs.PathTwist == 0 && pbs.PathTwistBegin == 0 | 1702 | && pbs.PathTwist == 0 && pbs.PathTwistBegin == 0 |
1637 | && pbs.PathBegin == 0 && pbs.PathEnd == 0 | 1703 | && pbs.PathBegin == 0 && pbs.PathEnd == 0 |
1638 | && pbs.PathTaperX == 0 && pbs.PathTaperY == 0 | 1704 | && pbs.PathTaperX == 0 && pbs.PathTaperY == 0 |
1639 | && pbs.PathScaleX == 100 && pbs.PathScaleY == 100 | 1705 | && pbs.PathScaleX == 100 && pbs.PathScaleY == 100 |
1640 | && pbs.PathShearX == 0 && pbs.PathShearY == 0) | 1706 | && pbs.PathShearX == 0 && pbs.PathShearY == 0) |
1641 | { | 1707 | { |
1642 | #if SPAM | 1708 | #if SPAM |
1643 | m_log.Warn("NonMesh"); | 1709 | m_log.Warn("NonMesh"); |
1644 | #endif | 1710 | #endif |
1645 | return false; | 1711 | return false; |
1646 | } | ||
1647 | } | 1712 | } |
1648 | } | 1713 | } |
1649 | 1714 | ||
@@ -1651,8 +1716,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1651 | // and it's odd.. so for now just return true if asked to force meshs | 1716 | // and it's odd.. so for now just return true if asked to force meshs |
1652 | // hopefully mesher will fail if doesn't suport so things still get basic boxes | 1717 | // hopefully mesher will fail if doesn't suport so things still get basic boxes |
1653 | 1718 | ||
1654 | if (forceSimplePrimMeshing) | 1719 | int iPropertiesNotSupportedDefault = 0; |
1655 | return true; | ||
1656 | 1720 | ||
1657 | if (pbs.ProfileHollow != 0) | 1721 | if (pbs.ProfileHollow != 0) |
1658 | iPropertiesNotSupportedDefault++; | 1722 | iPropertiesNotSupportedDefault++; |
@@ -1721,9 +1785,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1721 | } | 1785 | } |
1722 | } | 1786 | } |
1723 | 1787 | ||
1724 | if (pbs.SculptEntry && meshSculptedPrim) | ||
1725 | iPropertiesNotSupportedDefault++; | ||
1726 | |||
1727 | if (iPropertiesNotSupportedDefault == 0) | 1788 | if (iPropertiesNotSupportedDefault == 0) |
1728 | { | 1789 | { |
1729 | #if SPAM | 1790 | #if SPAM |