From f64d94f8caccd49523c54c48a1c6700b7fb0d212 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 28 Dec 2007 14:24:14 +0000 Subject: [PATCH] * Rezzing items from Inventory on top of other prim rezzes them 0.5 meters above the 'hit' prim instead of buried in the ground somewhere. * Various Refactorings --- OpenSim/Framework/IClientAPI.cs | 18 +++++++++++++++++- OpenSim/Region/ClientStack/ClientView.cs | 19 ++++++++++++------- .../Environment/Scenes/Scene.Inventory.cs | 17 ++++++++++++++++- OpenSim/Region/Environment/Scenes/Scene.cs | 7 +++++-- 4 files changed, 50 insertions(+), 11 deletions(-) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 9072035f91..1154fbabe7 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -226,7 +226,23 @@ namespace OpenSim.Framework public delegate void ImprovedInstantMessage( LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog); // Cut down from full list - public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos); + + //rezPacket.RezData.BypassRaycast; + //rezPacket.RezData.RayEnd; + //rezPacket.RezData.RayEndIsIntersection; + //rezPacket.RezData.RayStart; + //rezPacket.RezData.RayTargetID; + //rezPacket.RezData.RemoveItem; + //rezPacket.RezData.RezSelected; + //rezPacket.RezData.FromTaskID; + //rezPacket.RezData.FromTaskID; + //rezPacket.RezData.EveryoneMask; + //rezPacket.RezData.GroupMask; + //rezPacket.RezData.NextOwnerMask; + public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, + LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, + uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, + bool RezSelected, bool RemoveItem, LLUUID fromTaskID ); public delegate void ModifyTerrain( float height, float seconds, byte size, byte action, float north, float west, float south, float east, diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index aed2c29d22..0d3c07ea12 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -2560,8 +2560,19 @@ namespace OpenSim.Region.ClientStack //rezPacket.RezData.RemoveItem; //rezPacket.RezData.RezSelected; //rezPacket.RezData.FromTaskID; + //rezPacket.RezData.FromTaskID; + //rezPacket.RezData.EveryoneMask; + //rezPacket.RezData.GroupMask; + //rezPacket.RezData.NextOwnerMask; + //MainLog.Instance.Verbose("REZData", rezPacket.ToString()); - OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd); + OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, + rezPacket.RezData.RayStart,rezPacket.RezData.RayTargetID, + rezPacket.RezData.BypassRaycast,rezPacket.RezData.RayEndIsIntersection, + rezPacket.RezData.EveryoneMask,rezPacket.RezData.GroupMask, + rezPacket.RezData.NextOwnerMask,rezPacket.RezData.ItemFlags, + rezPacket.RezData.RezSelected,rezPacket.RezData.RemoveItem, + rezPacket.RezData.FromTaskID); } break; case PacketType.DeRezObject: @@ -2740,12 +2751,6 @@ namespace OpenSim.Region.ClientStack { ObjectAddPacket addPacket = (ObjectAddPacket) Pack; PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); - MainLog.Instance.Verbose("REZData", addPacket.ToString()); - //BypassRaycast: 1 - //RayStart: <69.79469, 158.2652, 98.40343> - //RayEnd: <61.97724, 141.995, 92.58341> - //RayTargetID: 00000000-0000-0000-0000-000000000000 - OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape,addPacket.ObjectData.BypassRaycast,addPacket.ObjectData.RayStart,addPacket.ObjectData.RayTargetID,addPacket.ObjectData.RayEndIsIntersection); } break; diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 4c6e1c85b7..35112e71ae 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -699,8 +699,23 @@ namespace OpenSim.Region.Environment.Scenes group.DeleteParts(); } - public virtual void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos) + public virtual void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, + LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, + uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, + bool RezSelected, bool RemoveItem, LLUUID fromTaskID) { + byte bRayEndIsIntersection = (byte)0; + + if (RayEndIsIntersection) + { + bRayEndIsIntersection = (byte)1; + } + else + { + bRayEndIsIntersection = (byte)0; + } + + LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), BypassRayCast, bRayEndIsIntersection); CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3919a4641a..89b68de6b0 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -931,6 +931,7 @@ namespace OpenSim.Region.Environment.Scenes if (RayEndIsIntersection == (byte)1) { pos = RayEnd; + pos.Z += 0.25F; return pos; } if (RayTargetID != LLUUID.Zero) @@ -986,13 +987,14 @@ namespace OpenSim.Region.Environment.Scenes - + pos.Z += 0.25F; return pos; } else { // fall back to our stupid functionality pos = RayEnd; + pos.Z += 0.25F; return pos; } } @@ -1000,6 +1002,7 @@ namespace OpenSim.Region.Environment.Scenes { // fall back to our stupid functionality pos = RayEnd; + pos.Z += 0.25F; return pos; } @@ -1018,7 +1021,7 @@ namespace OpenSim.Region.Environment.Scenes if (PermissionsMngr.CanRezObject(ownerID, pos)) { // rez ON the ground, not IN the ground - pos.Z += 0.25F; + AddNewPrim(ownerID, pos, rot, shape);