diff options
author | Melanie | 2013-01-23 02:39:30 +0000 |
---|---|---|
committer | Melanie | 2013-01-23 02:39:30 +0000 |
commit | 74e04c0f03c4142fc92338fdaef07a176b1749e1 (patch) | |
tree | c525970b2266e7754b5604ef7bf80711e0340bbf /OpenSim/Region | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Merge branch 'avination' (diff) | |
download | opensim-SC-74e04c0f03c4142fc92338fdaef07a176b1749e1.zip opensim-SC-74e04c0f03c4142fc92338fdaef07a176b1749e1.tar.gz opensim-SC-74e04c0f03c4142fc92338fdaef07a176b1749e1.tar.bz2 opensim-SC-74e04c0f03c4142fc92338fdaef07a176b1749e1.tar.xz |
Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
Diffstat (limited to 'OpenSim/Region')
11 files changed, 201 insertions, 482 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 908f628..6ec1115 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs | |||
@@ -501,7 +501,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
501 | ScenePresence p; | 501 | ScenePresence p; |
502 | if (m_scene.TryGetScenePresence(User, out p)) // If we don't get a user they're not here anymore. | 502 | if (m_scene.TryGetScenePresence(User, out p)) // If we don't get a user they're not here anymore. |
503 | { | 503 | { |
504 | AlterThrottle(UserSetThrottle, p); | 504 | // AlterThrottle(UserSetThrottle, p); |
505 | UpdateThrottle(UserSetThrottle, p); | ||
505 | } | 506 | } |
506 | } | 507 | } |
507 | } | 508 | } |
@@ -546,7 +547,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
546 | // Client set throttle ! | 547 | // Client set throttle ! |
547 | UserSetThrottle = pimagethrottle; | 548 | UserSetThrottle = pimagethrottle; |
548 | CapSetThrottle = (int)(pimagethrottle*CapThrottleDistributon); | 549 | CapSetThrottle = (int)(pimagethrottle*CapThrottleDistributon); |
549 | UDPSetThrottle = (int) (pimagethrottle*(100 - CapThrottleDistributon)); | 550 | // UDPSetThrottle = (int) (pimagethrottle*(100 - CapThrottleDistributon)); |
551 | |||
552 | float udp = 1.0f - CapThrottleDistributon; | ||
553 | if(udp < 0.5f) | ||
554 | udp = 0.5f; | ||
555 | UDPSetThrottle = (int) ((float)pimagethrottle * udp); | ||
550 | if (CapSetThrottle < 4068) | 556 | if (CapSetThrottle < 4068) |
551 | CapSetThrottle = 4068; // at least two discovery mesh | 557 | CapSetThrottle = 4068; // at least two discovery mesh |
552 | p.ControllingClient.SetAgentThrottleSilent((int) Throttle, UDPSetThrottle); | 558 | p.ControllingClient.SetAgentThrottleSilent((int) Throttle, UDPSetThrottle); |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 12e9d4d..bae41fb 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -897,32 +897,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
897 | msg.MessageBlock.Message = Util.StringToBytes1024(im.message); | 897 | msg.MessageBlock.Message = Util.StringToBytes1024(im.message); |
898 | msg.MessageBlock.BinaryBucket = im.binaryBucket; | 898 | msg.MessageBlock.BinaryBucket = im.binaryBucket; |
899 | 899 | ||
900 | if (im.message.StartsWith("[grouptest]")) | 900 | OutPacket(msg, ThrottleOutPacketType.Task); |
901 | { // this block is test code for implementing group IM - delete when group IM is finished | ||
902 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); | ||
903 | if (eq != null) | ||
904 | { | ||
905 | im.dialog = 17; | ||
906 | |||
907 | //eq.ChatterboxInvitation( | ||
908 | // new UUID("00000000-68f9-1111-024e-222222111123"), | ||
909 | // "OpenSimulator Testing", im.fromAgentID, im.message, im.toAgentID, im.fromAgentName, im.dialog, 0, | ||
910 | // false, 0, new Vector3(), 1, im.imSessionID, im.fromGroup, im.binaryBucket); | ||
911 | |||
912 | eq.ChatterboxInvitation( | ||
913 | new UUID("00000000-68f9-1111-024e-222222111123"), | ||
914 | "OpenSimulator Testing", new UUID(im.fromAgentID), im.message, new UUID(im.toAgentID), im.fromAgentName, im.dialog, 0, | ||
915 | false, 0, new Vector3(), 1, new UUID(im.imSessionID), im.fromGroup, Util.StringToBytes256("OpenSimulator Testing")); | ||
916 | |||
917 | eq.ChatterBoxSessionAgentListUpdates( | ||
918 | new UUID("00000000-68f9-1111-024e-222222111123"), | ||
919 | new UUID(im.fromAgentID), new UUID(im.toAgentID), false, false, false); | ||
920 | } | ||
921 | |||
922 | Console.WriteLine("SendInstantMessage: " + msg); | ||
923 | } | ||
924 | else | ||
925 | OutPacket(msg, ThrottleOutPacketType.Task); | ||
926 | } | 901 | } |
927 | } | 902 | } |
928 | 903 | ||
@@ -2788,7 +2763,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2788 | Transfer.TransferInfo.Size = req.AssetInf.Data.Length; | 2763 | Transfer.TransferInfo.Size = req.AssetInf.Data.Length; |
2789 | Transfer.TransferInfo.TransferID = req.TransferRequestID; | 2764 | Transfer.TransferInfo.TransferID = req.TransferRequestID; |
2790 | Transfer.Header.Zerocoded = true; | 2765 | Transfer.Header.Zerocoded = true; |
2791 | OutPacket(Transfer, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); | 2766 | OutPacket(Transfer, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); |
2792 | 2767 | ||
2793 | if (req.NumPackets == 1) | 2768 | if (req.NumPackets == 1) |
2794 | { | 2769 | { |
@@ -2799,7 +2774,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2799 | TransferPacket.TransferData.Data = req.AssetInf.Data; | 2774 | TransferPacket.TransferData.Data = req.AssetInf.Data; |
2800 | TransferPacket.TransferData.Status = 1; | 2775 | TransferPacket.TransferData.Status = 1; |
2801 | TransferPacket.Header.Zerocoded = true; | 2776 | TransferPacket.Header.Zerocoded = true; |
2802 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); | 2777 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); |
2803 | } | 2778 | } |
2804 | else | 2779 | else |
2805 | { | 2780 | { |
@@ -2832,7 +2807,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2832 | TransferPacket.TransferData.Status = 1; | 2807 | TransferPacket.TransferData.Status = 1; |
2833 | } | 2808 | } |
2834 | TransferPacket.Header.Zerocoded = true; | 2809 | TransferPacket.Header.Zerocoded = true; |
2835 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task : ThrottleOutPacketType.Asset); | 2810 | OutPacket(TransferPacket, isWearable ? ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority : ThrottleOutPacketType.Asset); |
2836 | 2811 | ||
2837 | processedLength += chunkSize; | 2812 | processedLength += chunkSize; |
2838 | packetNumber++; | 2813 | packetNumber++; |
@@ -3605,7 +3580,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3605 | } | 3580 | } |
3606 | } | 3581 | } |
3607 | 3582 | ||
3608 | OutPacket(aw, ThrottleOutPacketType.Task); | 3583 | OutPacket(aw, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); |
3609 | } | 3584 | } |
3610 | 3585 | ||
3611 | public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) | 3586 | public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index f1a1812..e52ac37 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | |||
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
92 | /// <summary>Packets we have sent that need to be ACKed by the client</summary> | 92 | /// <summary>Packets we have sent that need to be ACKed by the client</summary> |
93 | public readonly UnackedPacketCollection NeedAcks = new UnackedPacketCollection(); | 93 | public readonly UnackedPacketCollection NeedAcks = new UnackedPacketCollection(); |
94 | /// <summary>ACKs that are queued up, waiting to be sent to the client</summary> | 94 | /// <summary>ACKs that are queued up, waiting to be sent to the client</summary> |
95 | public readonly OpenSim.Framework.LocklessQueue<uint> PendingAcks = new OpenSim.Framework.LocklessQueue<uint>(); | 95 | public readonly DoubleLocklessQueue<uint> PendingAcks = new DoubleLocklessQueue<uint>(); |
96 | 96 | ||
97 | /// <summary>Current packet sequence number</summary> | 97 | /// <summary>Current packet sequence number</summary> |
98 | public int CurrentSequence; | 98 | public int CurrentSequence; |
@@ -146,7 +146,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
146 | /// <summary>Throttle buckets for each packet category</summary> | 146 | /// <summary>Throttle buckets for each packet category</summary> |
147 | private readonly TokenBucket[] m_throttleCategories; | 147 | private readonly TokenBucket[] m_throttleCategories; |
148 | /// <summary>Outgoing queues for throttled packets</summary> | 148 | /// <summary>Outgoing queues for throttled packets</summary> |
149 | private readonly OpenSim.Framework.LocklessQueue<OutgoingPacket>[] m_packetOutboxes = new OpenSim.Framework.LocklessQueue<OutgoingPacket>[THROTTLE_CATEGORY_COUNT]; | 149 | private readonly DoubleLocklessQueue<OutgoingPacket>[] m_packetOutboxes = new DoubleLocklessQueue<OutgoingPacket>[THROTTLE_CATEGORY_COUNT]; |
150 | /// <summary>A container that can hold one packet for each outbox, used to store | 150 | /// <summary>A container that can hold one packet for each outbox, used to store |
151 | /// dequeued packets that are being held for throttling</summary> | 151 | /// dequeued packets that are being held for throttling</summary> |
152 | private readonly OutgoingPacket[] m_nextPackets = new OutgoingPacket[THROTTLE_CATEGORY_COUNT]; | 152 | private readonly OutgoingPacket[] m_nextPackets = new OutgoingPacket[THROTTLE_CATEGORY_COUNT]; |
@@ -202,7 +202,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
202 | ThrottleOutPacketType type = (ThrottleOutPacketType)i; | 202 | ThrottleOutPacketType type = (ThrottleOutPacketType)i; |
203 | 203 | ||
204 | // Initialize the packet outboxes, where packets sit while they are waiting for tokens | 204 | // Initialize the packet outboxes, where packets sit while they are waiting for tokens |
205 | m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>(); | 205 | m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); |
206 | // Initialize the token buckets that control the throttling for each category | 206 | // Initialize the token buckets that control the throttling for each category |
207 | m_throttleCategories[i] = new TokenBucket(m_throttleCategory, rates.GetRate(type)); | 207 | m_throttleCategories[i] = new TokenBucket(m_throttleCategory, rates.GetRate(type)); |
208 | } | 208 | } |
@@ -430,15 +430,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
430 | /// </returns> | 430 | /// </returns> |
431 | public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue) | 431 | public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue) |
432 | { | 432 | { |
433 | return EnqueueOutgoing(packet, forceQueue, false); | ||
434 | } | ||
435 | |||
436 | public bool EnqueueOutgoing(OutgoingPacket packet, bool forceQueue, bool highPriority) | ||
437 | { | ||
433 | int category = (int)packet.Category; | 438 | int category = (int)packet.Category; |
434 | 439 | ||
435 | if (category >= 0 && category < m_packetOutboxes.Length) | 440 | if (category >= 0 && category < m_packetOutboxes.Length) |
436 | { | 441 | { |
437 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; | 442 | DoubleLocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category]; |
438 | 443 | ||
439 | if (m_deliverPackets == false) | 444 | if (m_deliverPackets == false) |
440 | { | 445 | { |
441 | queue.Enqueue(packet); | 446 | queue.Enqueue(packet, highPriority); |
442 | return true; | 447 | return true; |
443 | } | 448 | } |
444 | 449 | ||
@@ -449,7 +454,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
449 | // queued packets | 454 | // queued packets |
450 | if (queue.Count > 0) | 455 | if (queue.Count > 0) |
451 | { | 456 | { |
452 | queue.Enqueue(packet); | 457 | queue.Enqueue(packet, highPriority); |
453 | return true; | 458 | return true; |
454 | } | 459 | } |
455 | 460 | ||
@@ -462,7 +467,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
462 | else | 467 | else |
463 | { | 468 | { |
464 | // Force queue specified or not enough tokens in the bucket, queue this packet | 469 | // Force queue specified or not enough tokens in the bucket, queue this packet |
465 | queue.Enqueue(packet); | 470 | queue.Enqueue(packet, highPriority); |
466 | return true; | 471 | return true; |
467 | } | 472 | } |
468 | } | 473 | } |
@@ -494,7 +499,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
494 | if (m_deliverPackets == false) return false; | 499 | if (m_deliverPackets == false) return false; |
495 | 500 | ||
496 | OutgoingPacket packet = null; | 501 | OutgoingPacket packet = null; |
497 | OpenSim.Framework.LocklessQueue<OutgoingPacket> queue; | 502 | DoubleLocklessQueue<OutgoingPacket> queue; |
498 | TokenBucket bucket; | 503 | TokenBucket bucket; |
499 | bool packetSent = false; | 504 | bool packetSent = false; |
500 | ThrottleOutPacketTypeFlags emptyCategories = 0; | 505 | ThrottleOutPacketTypeFlags emptyCategories = 0; |
@@ -534,7 +539,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
534 | } | 539 | } |
535 | catch | 540 | catch |
536 | { | 541 | { |
537 | m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>(); | 542 | m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); |
538 | } | 543 | } |
539 | if (success) | 544 | if (success) |
540 | { | 545 | { |
@@ -567,7 +572,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
567 | } | 572 | } |
568 | else | 573 | else |
569 | { | 574 | { |
570 | m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>(); | 575 | m_packetOutboxes[i] = new DoubleLocklessQueue<OutgoingPacket>(); |
571 | emptyCategories |= CategoryToFlag(i); | 576 | emptyCategories |= CategoryToFlag(i); |
572 | } | 577 | } |
573 | } | 578 | } |
@@ -724,4 +729,33 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
724 | } | 729 | } |
725 | } | 730 | } |
726 | } | 731 | } |
732 | |||
733 | public class DoubleLocklessQueue<T> : OpenSim.Framework.LocklessQueue<T> | ||
734 | { | ||
735 | OpenSim.Framework.LocklessQueue<T> highQueue = new OpenSim.Framework.LocklessQueue<T>(); | ||
736 | |||
737 | public override int Count | ||
738 | { | ||
739 | get | ||
740 | { | ||
741 | return base.Count + highQueue.Count; | ||
742 | } | ||
743 | } | ||
744 | |||
745 | public override bool Dequeue(out T item) | ||
746 | { | ||
747 | if (highQueue.Dequeue(out item)) | ||
748 | return true; | ||
749 | |||
750 | return base.Dequeue(out item); | ||
751 | } | ||
752 | |||
753 | public void Enqueue(T item, bool highPriority) | ||
754 | { | ||
755 | if (highPriority) | ||
756 | highQueue.Enqueue(item); | ||
757 | else | ||
758 | Enqueue(item); | ||
759 | } | ||
760 | } | ||
727 | } | 761 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 9a4abd4..6c72edc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -803,6 +803,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
803 | 803 | ||
804 | #region Queue or Send | 804 | #region Queue or Send |
805 | 805 | ||
806 | bool highPriority = false; | ||
807 | |||
808 | if (category != ThrottleOutPacketType.Unknown && (category & ThrottleOutPacketType.HighPriority) != 0) | ||
809 | { | ||
810 | category = (ThrottleOutPacketType)((int)category & 127); | ||
811 | highPriority = true; | ||
812 | } | ||
813 | |||
806 | OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category, null); | 814 | OutgoingPacket outgoingPacket = new OutgoingPacket(udpClient, buffer, category, null); |
807 | // If we were not provided a method for handling unacked, use the UDPServer default method | 815 | // If we were not provided a method for handling unacked, use the UDPServer default method |
808 | outgoingPacket.UnackedMethod = ((method == null) ? delegate(OutgoingPacket oPacket) { ResendUnacked(oPacket); } : method); | 816 | outgoingPacket.UnackedMethod = ((method == null) ? delegate(OutgoingPacket oPacket) { ResendUnacked(oPacket); } : method); |
@@ -811,7 +819,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
811 | // continue to display the deleted object until relog. Therefore, we need to always queue a kill object | 819 | // continue to display the deleted object until relog. Therefore, we need to always queue a kill object |
812 | // packet so that it isn't sent before a queued update packet. | 820 | // packet so that it isn't sent before a queued update packet. |
813 | bool requestQueue = type == PacketType.KillObject; | 821 | bool requestQueue = type == PacketType.KillObject; |
814 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue)) | 822 | if (!outgoingPacket.Client.EnqueueOutgoing(outgoingPacket, requestQueue, highPriority)) |
815 | SendPacketFinal(outgoingPacket); | 823 | SendPacketFinal(outgoingPacket); |
816 | 824 | ||
817 | #endregion Queue or Send | 825 | #endregion Queue or Send |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index cfc7e7e..a070ff8 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -376,6 +376,52 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
376 | { | 376 | { |
377 | bool defonly = true; // are we only using default textures | 377 | bool defonly = true; // are we only using default textures |
378 | IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); | 378 | IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); |
379 | IBakedTextureModule bakedModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); | ||
380 | WearableCacheItem[] wearableCache = null; | ||
381 | |||
382 | // Cache wearable data for teleport. | ||
383 | // Only makes sense if there's a bake module and a cache module | ||
384 | if (bakedModule != null && cache != null) | ||
385 | { | ||
386 | try | ||
387 | { | ||
388 | wearableCache = bakedModule.Get(sp.UUID); | ||
389 | } | ||
390 | catch (Exception) | ||
391 | { | ||
392 | |||
393 | } | ||
394 | if (wearableCache != null) | ||
395 | { | ||
396 | for (int i = 0; i < wearableCache.Length; i++) | ||
397 | { | ||
398 | cache.Cache(wearableCache[i].TextureAsset); | ||
399 | } | ||
400 | } | ||
401 | } | ||
402 | /* | ||
403 | IBakedTextureModule bakedModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); | ||
404 | if (invService.GetRootFolder(userID) != null) | ||
405 | { | ||
406 | WearableCacheItem[] wearableCache = null; | ||
407 | if (bakedModule != null) | ||
408 | { | ||
409 | try | ||
410 | { | ||
411 | wearableCache = bakedModule.Get(userID); | ||
412 | appearance.WearableCacheItems = wearableCache; | ||
413 | appearance.WearableCacheItemsDirty = false; | ||
414 | foreach (WearableCacheItem item in wearableCache) | ||
415 | { | ||
416 | appearance.Texture.FaceTextures[item.TextureIndex].TextureID = item.TextureID; | ||
417 | } | ||
418 | } | ||
419 | catch (Exception) | ||
420 | { | ||
421 | |||
422 | } | ||
423 | } | ||
424 | */ | ||
379 | 425 | ||
380 | // Process the texture entry | 426 | // Process the texture entry |
381 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) | 427 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) |
@@ -383,9 +429,32 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
383 | int idx = AvatarAppearance.BAKE_INDICES[i]; | 429 | int idx = AvatarAppearance.BAKE_INDICES[i]; |
384 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; | 430 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; |
385 | 431 | ||
386 | // if there is no texture entry, skip it | 432 | // No face, so lets check our baked service cache, teleport or login. |
387 | if (face == null) | 433 | if (face == null) |
388 | continue; | 434 | { |
435 | if (wearableCache != null) | ||
436 | { | ||
437 | // If we find the an appearance item, set it as the textureentry and the face | ||
438 | WearableCacheItem searchitem = WearableCacheItem.SearchTextureIndex((uint) idx, wearableCache); | ||
439 | if (searchitem != null) | ||
440 | { | ||
441 | sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint) idx); | ||
442 | sp.Appearance.Texture.FaceTextures[idx].TextureID = searchitem.TextureID; | ||
443 | face = sp.Appearance.Texture.FaceTextures[idx]; | ||
444 | } | ||
445 | else | ||
446 | { | ||
447 | // if there is no texture entry and no baked cache, skip it | ||
448 | continue; | ||
449 | } | ||
450 | } | ||
451 | else | ||
452 | { | ||
453 | //No texture entry face and no cache. Skip this face. | ||
454 | continue; | ||
455 | } | ||
456 | } | ||
457 | |||
389 | 458 | ||
390 | // m_log.DebugFormat( | 459 | // m_log.DebugFormat( |
391 | // "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}", | 460 | // "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}", |
diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs deleted file mode 100644 index b735c61..0000000 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ /dev/null | |||
@@ -1,260 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
32 | using Nini.Config; | ||
33 | using OpenMetaverse; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Region.Framework.Interfaces; | ||
36 | using OpenSim.Region.Framework.Scenes; | ||
37 | |||
38 | using Mono.Addins; | ||
39 | |||
40 | namespace OpenSim.Region.CoreModules.Avatar.Groups | ||
41 | { | ||
42 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GroupsModule")] | ||
43 | public class GroupsModule : ISharedRegionModule | ||
44 | { | ||
45 | private static readonly ILog m_log = | ||
46 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
48 | private Dictionary<UUID, GroupMembershipData> m_GroupMap = | ||
49 | new Dictionary<UUID, GroupMembershipData>(); | ||
50 | |||
51 | private Dictionary<UUID, IClientAPI> m_ClientMap = | ||
52 | new Dictionary<UUID, IClientAPI>(); | ||
53 | |||
54 | private UUID opensimulatorGroupID = | ||
55 | new UUID("00000000-68f9-1111-024e-222222111123"); | ||
56 | |||
57 | private List<Scene> m_SceneList = new List<Scene>(); | ||
58 | |||
59 | private static GroupMembershipData osGroup = | ||
60 | new GroupMembershipData(); | ||
61 | |||
62 | private bool m_Enabled = false; | ||
63 | |||
64 | #region ISharedRegionModule Members | ||
65 | |||
66 | public void Initialise(IConfigSource config) | ||
67 | { | ||
68 | IConfig groupsConfig = config.Configs["Groups"]; | ||
69 | |||
70 | if (groupsConfig == null) | ||
71 | { | ||
72 | m_log.Info("[GROUPS]: No configuration found. Using defaults"); | ||
73 | } | ||
74 | else | ||
75 | { | ||
76 | m_Enabled = groupsConfig.GetBoolean("Enabled", false); | ||
77 | if (!m_Enabled) | ||
78 | { | ||
79 | m_log.Info("[GROUPS]: Groups disabled in configuration"); | ||
80 | return; | ||
81 | } | ||
82 | |||
83 | if (groupsConfig.GetString("Module", "Default") != "Default") | ||
84 | { | ||
85 | m_Enabled = false; | ||
86 | return; | ||
87 | } | ||
88 | } | ||
89 | |||
90 | } | ||
91 | |||
92 | public void AddRegion(Scene scene) | ||
93 | { | ||
94 | if (!m_Enabled) | ||
95 | return; | ||
96 | |||
97 | lock (m_SceneList) | ||
98 | { | ||
99 | if (!m_SceneList.Contains(scene)) | ||
100 | { | ||
101 | if (m_SceneList.Count == 0) | ||
102 | { | ||
103 | osGroup.GroupID = opensimulatorGroupID; | ||
104 | osGroup.GroupName = "OpenSimulator Testing"; | ||
105 | osGroup.GroupPowers = | ||
106 | (uint)(GroupPowers.AllowLandmark | | ||
107 | GroupPowers.AllowSetHome); | ||
108 | m_GroupMap[opensimulatorGroupID] = osGroup; | ||
109 | } | ||
110 | m_SceneList.Add(scene); | ||
111 | } | ||
112 | } | ||
113 | |||
114 | scene.EventManager.OnNewClient += OnNewClient; | ||
115 | scene.EventManager.OnClientClosed += OnClientClosed; | ||
116 | // scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; | ||
117 | } | ||
118 | |||
119 | public void RemoveRegion(Scene scene) | ||
120 | { | ||
121 | if (!m_Enabled) | ||
122 | return; | ||
123 | |||
124 | lock (m_SceneList) | ||
125 | { | ||
126 | if (m_SceneList.Contains(scene)) | ||
127 | m_SceneList.Remove(scene); | ||
128 | } | ||
129 | |||
130 | scene.EventManager.OnNewClient -= OnNewClient; | ||
131 | scene.EventManager.OnClientClosed -= OnClientClosed; | ||
132 | } | ||
133 | |||
134 | public void RegionLoaded(Scene scene) | ||
135 | { | ||
136 | } | ||
137 | |||
138 | public void PostInitialise() | ||
139 | { | ||
140 | } | ||
141 | |||
142 | public void Close() | ||
143 | { | ||
144 | if (!m_Enabled) | ||
145 | return; | ||
146 | |||
147 | // m_log.Debug("[GROUPS]: Shutting down group module."); | ||
148 | |||
149 | lock (m_ClientMap) | ||
150 | { | ||
151 | m_ClientMap.Clear(); | ||
152 | } | ||
153 | |||
154 | lock (m_GroupMap) | ||
155 | { | ||
156 | m_GroupMap.Clear(); | ||
157 | } | ||
158 | } | ||
159 | |||
160 | public string Name | ||
161 | { | ||
162 | get { return "GroupsModule"; } | ||
163 | } | ||
164 | |||
165 | public Type ReplaceableInterface | ||
166 | { | ||
167 | get { return null; } | ||
168 | } | ||
169 | |||
170 | #endregion | ||
171 | |||
172 | private void OnNewClient(IClientAPI client) | ||
173 | { | ||
174 | // Subscribe to instant messages | ||
175 | // client.OnInstantMessage += OnInstantMessage; | ||
176 | client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; | ||
177 | client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest; | ||
178 | lock (m_ClientMap) | ||
179 | { | ||
180 | if (!m_ClientMap.ContainsKey(client.AgentId)) | ||
181 | { | ||
182 | m_ClientMap.Add(client.AgentId, client); | ||
183 | } | ||
184 | } | ||
185 | |||
186 | GroupMembershipData[] updateGroups = new GroupMembershipData[1]; | ||
187 | updateGroups[0] = osGroup; | ||
188 | |||
189 | client.SendGroupMembership(updateGroups); | ||
190 | } | ||
191 | |||
192 | private void OnAgentDataUpdateRequest(IClientAPI remoteClient, | ||
193 | UUID AgentID, UUID SessionID) | ||
194 | { | ||
195 | UUID ActiveGroupID; | ||
196 | string ActiveGroupName; | ||
197 | ulong ActiveGroupPowers; | ||
198 | |||
199 | string firstname = remoteClient.FirstName; | ||
200 | string lastname = remoteClient.LastName; | ||
201 | |||
202 | string ActiveGroupTitle = "I IZ N0T"; | ||
203 | |||
204 | ActiveGroupID = osGroup.GroupID; | ||
205 | ActiveGroupName = osGroup.GroupName; | ||
206 | ActiveGroupPowers = osGroup.GroupPowers; | ||
207 | |||
208 | remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname, | ||
209 | lastname, ActiveGroupPowers, ActiveGroupName, | ||
210 | ActiveGroupTitle); | ||
211 | } | ||
212 | |||
213 | // private void OnInstantMessage(IClientAPI client, GridInstantMessage im) | ||
214 | // { | ||
215 | // } | ||
216 | |||
217 | // private void OnGridInstantMessage(GridInstantMessage msg) | ||
218 | // { | ||
219 | // // Trigger the above event handler | ||
220 | // OnInstantMessage(null, msg); | ||
221 | // } | ||
222 | |||
223 | private void HandleUUIDGroupNameRequest(UUID id,IClientAPI remote_client) | ||
224 | { | ||
225 | string groupnamereply = "Unknown"; | ||
226 | UUID groupUUID = UUID.Zero; | ||
227 | |||
228 | lock (m_GroupMap) | ||
229 | { | ||
230 | if (m_GroupMap.ContainsKey(id)) | ||
231 | { | ||
232 | GroupMembershipData grp = m_GroupMap[id]; | ||
233 | groupnamereply = grp.GroupName; | ||
234 | groupUUID = grp.GroupID; | ||
235 | } | ||
236 | } | ||
237 | remote_client.SendGroupNameReply(groupUUID, groupnamereply); | ||
238 | } | ||
239 | |||
240 | private void OnClientClosed(UUID agentID, Scene scene) | ||
241 | { | ||
242 | lock (m_ClientMap) | ||
243 | { | ||
244 | if (m_ClientMap.ContainsKey(agentID)) | ||
245 | { | ||
246 | // IClientAPI cli = m_ClientMap[agentID]; | ||
247 | // if (cli != null) | ||
248 | // { | ||
249 | // //m_log.Info("[GROUPS]: Removing all reference to groups for " + cli.Name); | ||
250 | // } | ||
251 | // else | ||
252 | // { | ||
253 | // //m_log.Info("[GROUPS]: Removing all reference to groups for " + agentID.ToString()); | ||
254 | // } | ||
255 | m_ClientMap.Remove(agentID); | ||
256 | } | ||
257 | } | ||
258 | } | ||
259 | } | ||
260 | } | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index dd8541c..9c6a94b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2398,6 +2398,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2398 | 2398 | ||
2399 | if (pa != null) | 2399 | if (pa != null) |
2400 | pa.PIDActive = false; | 2400 | pa.PIDActive = false; |
2401 | |||
2402 | RootPart.ScheduleTerseUpdate(); // send a stop information | ||
2401 | } | 2403 | } |
2402 | 2404 | ||
2403 | public void rotLookAt(Quaternion target, float strength, float damping) | 2405 | public void rotLookAt(Quaternion target, float strength, float damping) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d5d3dc1..0fe9842 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3751,7 +3751,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3751 | { | 3751 | { |
3752 | ParentGroup.stopMoveToTarget(); | 3752 | ParentGroup.stopMoveToTarget(); |
3753 | 3753 | ||
3754 | ParentGroup.ScheduleGroupForTerseUpdate(); | 3754 | // ParentGroup.ScheduleGroupForTerseUpdate(); |
3755 | //ParentGroup.ScheduleGroupForFullUpdate(); | 3755 | //ParentGroup.ScheduleGroupForFullUpdate(); |
3756 | } | 3756 | } |
3757 | 3757 | ||
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs index 7fe3109..4f598ea 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs | |||
@@ -68,7 +68,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
68 | /// ODE near callback delegate | 68 | /// ODE near callback delegate |
69 | /// </summary> | 69 | /// </summary> |
70 | private d.NearCallback nearCallback; | 70 | private d.NearCallback nearCallback; |
71 | private d.NearCallback nearProbeCallback; | ||
72 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 71 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
73 | private List<ContactResult> m_contactResults = new List<ContactResult>(); | 72 | private List<ContactResult> m_contactResults = new List<ContactResult>(); |
74 | private RayFilterFlags CurrentRayFilter; | 73 | private RayFilterFlags CurrentRayFilter; |
@@ -78,7 +77,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
78 | { | 77 | { |
79 | m_scene = pScene; | 78 | m_scene = pScene; |
80 | nearCallback = near; | 79 | nearCallback = near; |
81 | nearProbeCallback = nearProbe; | ||
82 | ray = d.CreateRay(IntPtr.Zero, 1.0f); | 80 | ray = d.CreateRay(IntPtr.Zero, 1.0f); |
83 | d.GeomSetCategoryBits(ray, 0); | 81 | d.GeomSetCategoryBits(ray, 0); |
84 | Box = d.CreateBox(IntPtr.Zero, 1.0f, 1.0f, 1.0f); | 82 | Box = d.CreateBox(IntPtr.Zero, 1.0f, 1.0f, 1.0f); |
@@ -125,6 +123,24 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
125 | { | 123 | { |
126 | if (req.callbackMethod != null) | 124 | if (req.callbackMethod != null) |
127 | { | 125 | { |
126 | IntPtr geom = IntPtr.Zero; | ||
127 | if (req.actor != null) | ||
128 | { | ||
129 | if (m_scene.haveActor(req.actor)) | ||
130 | { | ||
131 | if (req.actor is OdePrim) | ||
132 | geom = ((OdePrim)req.actor).prim_geom; | ||
133 | else if (req.actor is OdeCharacter) | ||
134 | geom = ((OdePrim)req.actor).prim_geom; | ||
135 | } | ||
136 | if (geom == IntPtr.Zero) | ||
137 | { | ||
138 | NoContacts(req); | ||
139 | continue; | ||
140 | } | ||
141 | } | ||
142 | |||
143 | |||
128 | CurrentRayFilter = req.filter; | 144 | CurrentRayFilter = req.filter; |
129 | CurrentMaxCount = req.Count; | 145 | CurrentMaxCount = req.Count; |
130 | 146 | ||
@@ -188,7 +204,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
188 | CollisionContactGeomsPerTest |= (int)d.CONTACTS_UNIMPORTANT; | 204 | CollisionContactGeomsPerTest |= (int)d.CONTACTS_UNIMPORTANT; |
189 | } | 205 | } |
190 | 206 | ||
191 | if (req.geom == IntPtr.Zero) | 207 | if (geom == IntPtr.Zero) |
192 | { | 208 | { |
193 | // translate ray filter to Collision flags | 209 | // translate ray filter to Collision flags |
194 | catflags = 0; | 210 | catflags = 0; |
@@ -226,7 +242,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
226 | catflags |= CollisionCategories.Space; | 242 | catflags |= CollisionCategories.Space; |
227 | d.GeomSetCollideBits(Plane, (uint)catflags); | 243 | d.GeomSetCollideBits(Plane, (uint)catflags); |
228 | d.GeomSetCategoryBits(Plane, (uint)catflags); | 244 | d.GeomSetCategoryBits(Plane, (uint)catflags); |
229 | doPlane(req); | 245 | doPlane(req,IntPtr.Zero); |
230 | } | 246 | } |
231 | else | 247 | else |
232 | { | 248 | { |
@@ -242,12 +258,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
242 | if (req.callbackMethod is ProbePlaneCallback) | 258 | if (req.callbackMethod is ProbePlaneCallback) |
243 | { | 259 | { |
244 | d.GeomSetCollideBits(Plane, (uint)CollisionCategories.All); | 260 | d.GeomSetCollideBits(Plane, (uint)CollisionCategories.All); |
245 | doPlane(req); | 261 | doPlane(req,geom); |
246 | } | 262 | } |
247 | else | 263 | else |
248 | { | 264 | { |
249 | d.GeomSetCollideBits(ray, (uint)CollisionCategories.All); | 265 | d.GeomSetCollideBits(ray, (uint)CollisionCategories.All); |
250 | doGeomRay(req); | 266 | doGeomRay(req,geom); |
251 | } | 267 | } |
252 | } | 268 | } |
253 | } | 269 | } |
@@ -267,6 +283,23 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
267 | /// <param name="req"></param> | 283 | /// <param name="req"></param> |
268 | /// | 284 | /// |
269 | 285 | ||
286 | private void NoContacts(ODERayRequest req) | ||
287 | { | ||
288 | if (req.callbackMethod is RaycastCallback) | ||
289 | { | ||
290 | ((RaycastCallback)req.callbackMethod)(false, Vector3.Zero, 0, 0, Vector3.Zero); | ||
291 | return; | ||
292 | } | ||
293 | List<ContactResult> cresult = new List<ContactResult>(); | ||
294 | |||
295 | if (req.callbackMethod is RayCallback) | ||
296 | ((RayCallback)req.callbackMethod)(cresult); | ||
297 | else if (req.callbackMethod is ProbeBoxCallback) | ||
298 | ((ProbeBoxCallback)req.callbackMethod)(cresult); | ||
299 | else if (req.callbackMethod is ProbeSphereCallback) | ||
300 | ((ProbeSphereCallback)req.callbackMethod)(cresult); | ||
301 | } | ||
302 | |||
270 | private const RayFilterFlags FilterActiveSpace = RayFilterFlags.agent | RayFilterFlags.physical | RayFilterFlags.LSLPhanton; | 303 | private const RayFilterFlags FilterActiveSpace = RayFilterFlags.agent | RayFilterFlags.physical | RayFilterFlags.LSLPhanton; |
271 | // private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.land | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; | 304 | // private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.land | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; |
272 | private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; | 305 | private const RayFilterFlags FilterStaticSpace = RayFilterFlags.water | RayFilterFlags.nonphysical | RayFilterFlags.LSLPhanton; |
@@ -358,10 +391,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
358 | ((ProbeSphereCallback)req.callbackMethod)(cresult); | 391 | ((ProbeSphereCallback)req.callbackMethod)(cresult); |
359 | } | 392 | } |
360 | 393 | ||
361 | private void doPlane(ODERayRequest req) | 394 | private void doPlane(ODERayRequest req,IntPtr geom) |
362 | { | 395 | { |
363 | // Collide tests | 396 | // Collide tests |
364 | if (req.geom == IntPtr.Zero) | 397 | if (geom == IntPtr.Zero) |
365 | { | 398 | { |
366 | if ((CurrentRayFilter & FilterActiveSpace) != 0) | 399 | if ((CurrentRayFilter & FilterActiveSpace) != 0) |
367 | { | 400 | { |
@@ -375,7 +408,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
375 | } | 408 | } |
376 | else | 409 | else |
377 | { | 410 | { |
378 | d.SpaceCollide2(Plane, req.geom, IntPtr.Zero, nearCallback); | 411 | d.SpaceCollide2(Plane, geom, IntPtr.Zero, nearCallback); |
379 | } | 412 | } |
380 | 413 | ||
381 | List<ContactResult> cresult = new List<ContactResult>(m_contactResults.Count); | 414 | List<ContactResult> cresult = new List<ContactResult>(m_contactResults.Count); |
@@ -392,10 +425,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
392 | /// Method that actually initiates the raycast with a geom | 425 | /// Method that actually initiates the raycast with a geom |
393 | /// </summary> | 426 | /// </summary> |
394 | /// <param name="req"></param> | 427 | /// <param name="req"></param> |
395 | private void doGeomRay(ODERayRequest req) | 428 | private void doGeomRay(ODERayRequest req, IntPtr geom) |
396 | { | 429 | { |
397 | // Collide test | 430 | // Collide test |
398 | d.SpaceCollide2(ray, req.geom, IntPtr.Zero, nearCallback); // still do this to have full AABB pre test | 431 | d.SpaceCollide2(ray, geom, IntPtr.Zero, nearCallback); // still do this to have full AABB pre test |
399 | 432 | ||
400 | if (req.callbackMethod is RaycastCallback) | 433 | if (req.callbackMethod is RaycastCallback) |
401 | { | 434 | { |
@@ -607,156 +640,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
607 | } | 640 | } |
608 | } | 641 | } |
609 | 642 | ||
610 | private void nearProbe(IntPtr space, IntPtr g1, IntPtr g2) | ||
611 | { | ||
612 | if (g1 == IntPtr.Zero || g1 == g2) | ||
613 | return; | ||
614 | |||
615 | if (m_contactResults.Count >= CurrentMaxCount) | ||
616 | return; | ||
617 | |||
618 | if (d.GeomIsSpace(g1)) | ||
619 | { | ||
620 | try | ||
621 | { | ||
622 | d.SpaceCollide2(g1, g2, IntPtr.Zero, nearProbeCallback); | ||
623 | } | ||
624 | catch (Exception e) | ||
625 | { | ||
626 | m_log.WarnFormat("[PHYSICS Ray]: Unable to Space collide test an object: {0}", e.Message); | ||
627 | } | ||
628 | return; | ||
629 | } | ||
630 | |||
631 | int count = 0; | ||
632 | try | ||
633 | { | ||
634 | count = d.CollidePtr(g1, g2, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, d.ContactGeom.unmanagedSizeOf); | ||
635 | } | ||
636 | catch (Exception e) | ||
637 | { | ||
638 | m_log.WarnFormat("[PHYSICS Ray]: Unable to collide test an object: {0}", e.Message); | ||
639 | return; | ||
640 | } | ||
641 | |||
642 | if (count == 0) | ||
643 | return; | ||
644 | |||
645 | uint ID = 0; | ||
646 | PhysicsActor p1 = null; | ||
647 | |||
648 | m_scene.actor_name_map.TryGetValue(g1, out p1); | ||
649 | |||
650 | if (p1 == null) | ||
651 | return; | ||
652 | |||
653 | switch (p1.PhysicsActorType) | ||
654 | { | ||
655 | case (int)ActorTypes.Prim: | ||
656 | |||
657 | RayFilterFlags thisFlags; | ||
658 | |||
659 | if (p1.IsPhysical) | ||
660 | thisFlags = RayFilterFlags.physical; | ||
661 | else | ||
662 | thisFlags = RayFilterFlags.nonphysical; | ||
663 | |||
664 | if (p1.Phantom) | ||
665 | thisFlags |= RayFilterFlags.phantom; | ||
666 | |||
667 | if (p1.IsVolumeDtc) | ||
668 | thisFlags |= RayFilterFlags.volumedtc; | ||
669 | |||
670 | if ((thisFlags & CurrentRayFilter) == 0) | ||
671 | return; | ||
672 | |||
673 | ID = ((OdePrim)p1).LocalID; | ||
674 | break; | ||
675 | |||
676 | case (int)ActorTypes.Agent: | ||
677 | |||
678 | if ((CurrentRayFilter & RayFilterFlags.agent) == 0) | ||
679 | return; | ||
680 | else | ||
681 | ID = ((OdeCharacter)p1).LocalID; | ||
682 | break; | ||
683 | |||
684 | case (int)ActorTypes.Ground: | ||
685 | |||
686 | if ((CurrentRayFilter & RayFilterFlags.land) == 0) | ||
687 | return; | ||
688 | break; | ||
689 | |||
690 | case (int)ActorTypes.Water: | ||
691 | |||
692 | if ((CurrentRayFilter & RayFilterFlags.water) == 0) | ||
693 | return; | ||
694 | break; | ||
695 | |||
696 | default: | ||
697 | break; | ||
698 | } | ||
699 | |||
700 | d.ContactGeom curcontact = new d.ContactGeom(); | ||
701 | |||
702 | // closestHit for now only works for meshs, so must do it for others | ||
703 | if ((CurrentRayFilter & RayFilterFlags.ClosestHit) == 0) | ||
704 | { | ||
705 | // Loop all contacts, build results. | ||
706 | for (int i = 0; i < count; i++) | ||
707 | { | ||
708 | if (!GetCurContactGeom(i, ref curcontact)) | ||
709 | break; | ||
710 | |||
711 | ContactResult collisionresult = new ContactResult(); | ||
712 | collisionresult.ConsumerID = ID; | ||
713 | collisionresult.Pos.X = curcontact.pos.X; | ||
714 | collisionresult.Pos.Y = curcontact.pos.Y; | ||
715 | collisionresult.Pos.Z = curcontact.pos.Z; | ||
716 | collisionresult.Depth = curcontact.depth; | ||
717 | collisionresult.Normal.X = curcontact.normal.X; | ||
718 | collisionresult.Normal.Y = curcontact.normal.Y; | ||
719 | collisionresult.Normal.Z = curcontact.normal.Z; | ||
720 | lock (m_contactResults) | ||
721 | { | ||
722 | m_contactResults.Add(collisionresult); | ||
723 | if (m_contactResults.Count >= CurrentMaxCount) | ||
724 | return; | ||
725 | } | ||
726 | } | ||
727 | } | ||
728 | else | ||
729 | { | ||
730 | // keep only closest contact | ||
731 | ContactResult collisionresult = new ContactResult(); | ||
732 | collisionresult.ConsumerID = ID; | ||
733 | collisionresult.Depth = float.MaxValue; | ||
734 | |||
735 | for (int i = 0; i < count; i++) | ||
736 | { | ||
737 | if (!GetCurContactGeom(i, ref curcontact)) | ||
738 | break; | ||
739 | |||
740 | if (curcontact.depth < collisionresult.Depth) | ||
741 | { | ||
742 | collisionresult.Pos.X = curcontact.pos.X; | ||
743 | collisionresult.Pos.Y = curcontact.pos.Y; | ||
744 | collisionresult.Pos.Z = curcontact.pos.Z; | ||
745 | collisionresult.Depth = curcontact.depth; | ||
746 | collisionresult.Normal.X = curcontact.normal.X; | ||
747 | collisionresult.Normal.Y = curcontact.normal.Y; | ||
748 | collisionresult.Normal.Z = curcontact.normal.Z; | ||
749 | } | ||
750 | } | ||
751 | |||
752 | if (collisionresult.Depth != float.MaxValue) | ||
753 | { | ||
754 | lock (m_contactResults) | ||
755 | m_contactResults.Add(collisionresult); | ||
756 | } | ||
757 | } | ||
758 | } | ||
759 | |||
760 | /// <summary> | 643 | /// <summary> |
761 | /// Dereference the creator scene so that it can be garbage collected if needed. | 644 | /// Dereference the creator scene so that it can be garbage collected if needed. |
762 | /// </summary> | 645 | /// </summary> |
@@ -788,7 +671,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
788 | 671 | ||
789 | public struct ODERayRequest | 672 | public struct ODERayRequest |
790 | { | 673 | { |
791 | public IntPtr geom; | 674 | public PhysicsActor actor; |
792 | public Vector3 Origin; | 675 | public Vector3 Origin; |
793 | public Vector3 Normal; | 676 | public Vector3 Normal; |
794 | public int Count; | 677 | public int Count; |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index 0d18adb..5113210 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -2580,7 +2580,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2580 | if (retMethod != null) | 2580 | if (retMethod != null) |
2581 | { | 2581 | { |
2582 | ODERayRequest req = new ODERayRequest(); | 2582 | ODERayRequest req = new ODERayRequest(); |
2583 | req.geom = IntPtr.Zero; | 2583 | req.actor = null; |
2584 | req.callbackMethod = retMethod; | 2584 | req.callbackMethod = retMethod; |
2585 | req.length = length; | 2585 | req.length = length; |
2586 | req.Normal = direction; | 2586 | req.Normal = direction; |
@@ -2597,7 +2597,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2597 | if (retMethod != null) | 2597 | if (retMethod != null) |
2598 | { | 2598 | { |
2599 | ODERayRequest req = new ODERayRequest(); | 2599 | ODERayRequest req = new ODERayRequest(); |
2600 | req.geom = IntPtr.Zero; | 2600 | req.actor = null; |
2601 | req.callbackMethod = retMethod; | 2601 | req.callbackMethod = retMethod; |
2602 | req.length = length; | 2602 | req.length = length; |
2603 | req.Normal = direction; | 2603 | req.Normal = direction; |
@@ -2625,7 +2625,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2625 | }; | 2625 | }; |
2626 | 2626 | ||
2627 | ODERayRequest req = new ODERayRequest(); | 2627 | ODERayRequest req = new ODERayRequest(); |
2628 | req.geom = IntPtr.Zero; | 2628 | req.actor = null; |
2629 | req.callbackMethod = retMethod; | 2629 | req.callbackMethod = retMethod; |
2630 | req.length = length; | 2630 | req.length = length; |
2631 | req.Normal = direction; | 2631 | req.Normal = direction; |
@@ -2663,7 +2663,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2663 | }; | 2663 | }; |
2664 | 2664 | ||
2665 | ODERayRequest req = new ODERayRequest(); | 2665 | ODERayRequest req = new ODERayRequest(); |
2666 | req.geom = IntPtr.Zero; | 2666 | req.actor = null; |
2667 | req.callbackMethod = retMethod; | 2667 | req.callbackMethod = retMethod; |
2668 | req.length = length; | 2668 | req.length = length; |
2669 | req.Normal = direction; | 2669 | req.Normal = direction; |
@@ -2710,7 +2710,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2710 | }; | 2710 | }; |
2711 | 2711 | ||
2712 | ODERayRequest req = new ODERayRequest(); | 2712 | ODERayRequest req = new ODERayRequest(); |
2713 | req.geom = geom; | 2713 | req.actor = actor; |
2714 | req.callbackMethod = retMethod; | 2714 | req.callbackMethod = retMethod; |
2715 | req.length = length; | 2715 | req.length = length; |
2716 | req.Normal = direction; | 2716 | req.Normal = direction; |
@@ -2745,7 +2745,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2745 | }; | 2745 | }; |
2746 | 2746 | ||
2747 | ODERayRequest req = new ODERayRequest(); | 2747 | ODERayRequest req = new ODERayRequest(); |
2748 | req.geom = IntPtr.Zero; | 2748 | req.actor = null; |
2749 | req.callbackMethod = retMethod; | 2749 | req.callbackMethod = retMethod; |
2750 | req.Normal = size; | 2750 | req.Normal = size; |
2751 | req.Origin = position; | 2751 | req.Origin = position; |
@@ -2777,7 +2777,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2777 | }; | 2777 | }; |
2778 | 2778 | ||
2779 | ODERayRequest req = new ODERayRequest(); | 2779 | ODERayRequest req = new ODERayRequest(); |
2780 | req.geom = IntPtr.Zero; | 2780 | req.actor = null; |
2781 | req.callbackMethod = retMethod; | 2781 | req.callbackMethod = retMethod; |
2782 | req.length = radius; | 2782 | req.length = radius; |
2783 | req.Origin = position; | 2783 | req.Origin = position; |
@@ -2819,7 +2819,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2819 | }; | 2819 | }; |
2820 | 2820 | ||
2821 | ODERayRequest req = new ODERayRequest(); | 2821 | ODERayRequest req = new ODERayRequest(); |
2822 | req.geom = geom; | 2822 | req.actor = null; |
2823 | req.callbackMethod = retMethod; | 2823 | req.callbackMethod = retMethod; |
2824 | req.length = plane.W; | 2824 | req.length = plane.W; |
2825 | req.Normal.X = plane.X; | 2825 | req.Normal.X = plane.X; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5cbb9c7..4ed6d75 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2331,9 +2331,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2331 | else | 2331 | else |
2332 | { | 2332 | { |
2333 | part.OffsetPosition = (Vector3)toPos; | 2333 | part.OffsetPosition = (Vector3)toPos; |
2334 | SceneObjectGroup parent = part.ParentGroup; | 2334 | // SceneObjectGroup parent = part.ParentGroup; |
2335 | parent.HasGroupChanged = true; | 2335 | // parent.HasGroupChanged = true; |
2336 | parent.ScheduleGroupForTerseUpdate(); | 2336 | // parent.ScheduleGroupForTerseUpdate(); |
2337 | part.ScheduleTerseUpdate(); | ||
2337 | } | 2338 | } |
2338 | } | 2339 | } |
2339 | 2340 | ||
@@ -8356,9 +8357,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8356 | else | 8357 | else |
8357 | { | 8358 | { |
8358 | part.OffsetPosition = currentPosition; | 8359 | part.OffsetPosition = currentPosition; |
8359 | SceneObjectGroup parent = part.ParentGroup; | 8360 | // SceneObjectGroup parent = part.ParentGroup; |
8360 | parent.HasGroupChanged = true; | 8361 | // parent.HasGroupChanged = true; |
8361 | parent.ScheduleGroupForTerseUpdate(); | 8362 | // parent.ScheduleGroupForTerseUpdate(); |
8363 | part.ScheduleTerseUpdate(); | ||
8362 | } | 8364 | } |
8363 | } | 8365 | } |
8364 | } | 8366 | } |