diff options
author | Oren Hurvitz | 2013-09-25 10:56:05 +0300 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-10-15 23:59:16 +0100 |
commit | d0c17808391e93964dcaf0ffcf06899c5669f4ff (patch) | |
tree | aff765cc1e1359a89aef48ad266ae1ab95e04fd0 /OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |
parent | As discussed on many previous occasions, switch the default physics engine in... (diff) | |
download | opensim-SC_OLD-d0c17808391e93964dcaf0ffcf06899c5669f4ff.zip opensim-SC_OLD-d0c17808391e93964dcaf0ffcf06899c5669f4ff.tar.gz opensim-SC_OLD-d0c17808391e93964dcaf0ffcf06899c5669f4ff.tar.bz2 opensim-SC_OLD-d0c17808391e93964dcaf0ffcf06899c5669f4ff.tar.xz |
Fixed rezzing coalesced objects from a prim's inventory
Previously only the first object in the Coalesced Object was rezzed. Now all the objects are rezzed.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 51 |
1 files changed, 8 insertions, 43 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 0ec9575..831922e 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -757,64 +757,29 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
757 | 757 | ||
758 | SceneObjectGroup group = null; | 758 | SceneObjectGroup group = null; |
759 | 759 | ||
760 | string xmlData = Utils.BytesToString(rezAsset.Data); | 760 | List<SceneObjectGroup> objlist; |
761 | List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(); | 761 | List<Vector3> veclist; |
762 | List<Vector3> veclist = new List<Vector3>(); | 762 | Vector3 bbox; |
763 | float offsetHeight; | ||
763 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); | 764 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); |
764 | Vector3 pos; | 765 | Vector3 pos; |
765 | 766 | ||
766 | XmlDocument doc = new XmlDocument(); | 767 | bool single = m_Scene.GetObjectsToRez(rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight); |
767 | doc.LoadXml(xmlData); | ||
768 | XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); | ||
769 | if (e == null || attachment) // Single | ||
770 | { | ||
771 | SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | ||
772 | |||
773 | objlist.Add(g); | ||
774 | veclist.Add(Vector3.Zero); | ||
775 | 768 | ||
776 | float offsetHeight = 0; | 769 | if (single) |
770 | { | ||
777 | pos = m_Scene.GetNewRezLocation( | 771 | pos = m_Scene.GetNewRezLocation( |
778 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, | 772 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, |
779 | BypassRayCast, bRayEndIsIntersection, true, g.GetAxisAlignedBoundingBox(out offsetHeight), false); | 773 | BypassRayCast, bRayEndIsIntersection, true, bbox, false); |
780 | pos.Z += offsetHeight; | 774 | pos.Z += offsetHeight; |
781 | } | 775 | } |
782 | else | 776 | else |
783 | { | 777 | { |
784 | XmlElement coll = (XmlElement)e; | ||
785 | float bx = Convert.ToSingle(coll.GetAttribute("x")); | ||
786 | float by = Convert.ToSingle(coll.GetAttribute("y")); | ||
787 | float bz = Convert.ToSingle(coll.GetAttribute("z")); | ||
788 | Vector3 bbox = new Vector3(bx, by, bz); | ||
789 | |||
790 | pos = m_Scene.GetNewRezLocation(RayStart, RayEnd, | 778 | pos = m_Scene.GetNewRezLocation(RayStart, RayEnd, |
791 | RayTargetID, Quaternion.Identity, | 779 | RayTargetID, Quaternion.Identity, |
792 | BypassRayCast, bRayEndIsIntersection, true, | 780 | BypassRayCast, bRayEndIsIntersection, true, |
793 | bbox, false); | 781 | bbox, false); |
794 | |||
795 | pos -= bbox / 2; | 782 | pos -= bbox / 2; |
796 | |||
797 | XmlNodeList groups = e.SelectNodes("SceneObjectGroup"); | ||
798 | foreach (XmlNode n in groups) | ||
799 | { | ||
800 | SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml); | ||
801 | |||
802 | objlist.Add(g); | ||
803 | XmlElement el = (XmlElement)n; | ||
804 | |||
805 | string rawX = el.GetAttribute("offsetx"); | ||
806 | string rawY = el.GetAttribute("offsety"); | ||
807 | string rawZ = el.GetAttribute("offsetz"); | ||
808 | // | ||
809 | // m_log.DebugFormat( | ||
810 | // "[INVENTORY ACCESS MODULE]: Converting coalesced object {0} offset <{1}, {2}, {3}>", | ||
811 | // g.Name, rawX, rawY, rawZ); | ||
812 | |||
813 | float x = Convert.ToSingle(rawX); | ||
814 | float y = Convert.ToSingle(rawY); | ||
815 | float z = Convert.ToSingle(rawZ); | ||
816 | veclist.Add(new Vector3(x, y, z)); | ||
817 | } | ||
818 | } | 783 | } |
819 | 784 | ||
820 | if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, veclist, attachment)) | 785 | if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, veclist, attachment)) |