diff --git a/OpenGridServices.sln b/OpenGridServices.sln index 5f47b6b81e..2343bc085d 100644 --- a/OpenGridServices.sln +++ b/OpenGridServices.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C# Express 2005 +# Visual Studio 2005 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data", "OpenSim\Framework\Data\OpenSim.Framework.Data.csproj", "{36B72A9B-0000-0000-0000-000000000000}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data.DB4o", "OpenSim\Framework\Data.DB4o\OpenSim.Framework.Data.DB4o.csproj", "{FD2D303D-0000-0000-0000-000000000000}" @@ -25,61 +25,72 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.UserServer.Config", "OpenSim\Grid\UserServer.Config\OpenSim.Grid.UserServer.Config.csproj", "{08F87229-0000-0000-0000-000000000000}" EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + ({FD2D303D-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000}) + ({17F7F694-0000-0000-0000-000000000000}).1 = ({36B72A9B-0000-0000-0000-000000000000}) + ({17F7F6BE-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000}) + ({6ECC56A9-0000-0000-0000-000000000000}).1 = ({36B72A9B-0000-0000-0000-000000000000}) + ({586E2916-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000}) + ({60FCC3A6-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000}) + ({60FCC3A6-0000-0000-0000-000000000000}).7 = ({4B7BFD1C-0000-0000-0000-000000000000}) + ({2FC96F92-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000}) + ({2FC96F92-0000-0000-0000-000000000000}).7 = ({586E2916-0000-0000-0000-000000000000}) + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection EndGlobal diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index b5a0a0bbdc..c3291c407f 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -56,6 +56,7 @@ namespace OpenSim.Framework.Interfaces public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); public delegate void UpdateVector(uint localID, LLVector3 pos, IClientAPI remoteClient); public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient); + public delegate void UpdatePrimGroupRotation(uint localID,LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient); public delegate void StatusChange(bool status); public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status); public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation); @@ -100,6 +101,7 @@ namespace OpenSim.Framework.Interfaces event UpdatePrimTexture OnUpdatePrimTexture; event UpdateVector OnUpdatePrimPosition; event UpdatePrimRotation OnUpdatePrimRotation; + event UpdatePrimGroupRotation OnUpdatePrimGroupRotation; event UpdateVector OnUpdatePrimScale; event StatusChange OnChildAgentStatus; event GenericCall2 OnStopMovement; diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index 1357e06fd9..a6671d10fc 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -12,6 +12,7 @@ namespace OpenSim.Framework.Types Prism, Scuplted, Cylinder, + Foliage, Unknown } diff --git a/OpenSim/Framework/Servers/CheckSumServer.cs b/OpenSim/Framework/Servers/CheckSumServer.cs index 104de94abb..89ec095239 100644 --- a/OpenSim/Framework/Servers/CheckSumServer.cs +++ b/OpenSim/Framework/Servers/CheckSumServer.cs @@ -26,8 +26,8 @@ * */ namespace OpenSim.Framework.Servers -{ -/* public class CheckSumServer : UDPServerBase +{/* + public class CheckSumServer : UDPServerBase { //protected ConsoleBase m_log; @@ -121,6 +121,7 @@ namespace OpenSim.Framework.Servers { this.Server.SendTo(buffer, size, flags, endp); } - * - }*/ + * } + */ + } \ No newline at end of file diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index e976fe3a1c..17a32cf215 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -51,7 +51,7 @@ namespace OpenSim public class OpenSimMain : RegionApplicationBase, conscmd_callback { protected CommunicationsManager commsManager; - // private CheckSumServer checkServer; + // private CheckSumServer checkServer; private bool m_silent; private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log"; @@ -96,7 +96,7 @@ namespace OpenSim { this.SetupLocalGridServers(); // this.checkServer = new CheckSumServer(12036); - // this.checkServer.ServerListener(); + // this.checkServer.ServerListener(); this.commsManager = new CommunicationsLocal(this.serversData); } else diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs index b38979d2f4..d9d6f51513 100644 --- a/OpenSim/Region/Capabilities/Caps.cs +++ b/OpenSim/Region/Capabilities/Caps.cs @@ -98,13 +98,6 @@ namespace OpenSim.Region.Capabilities /// protected LLSDCapsDetails GetCapabilities() { - /* string capURLS = ""; - capURLS += "MapLayerhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + ""; - capURLS += "NewFileAgentInventoryhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + ""; - //capURLS += "RequestTextureDownloadhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + ""; - //capURLS += "EventQueueGethttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + eventQueue + ""; - return capURLS;*/ - LLSDCapsDetails caps = new LLSDCapsDetails(); string capsBaseUrl = "http://" + httpListenerHostName + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath; @@ -131,8 +124,6 @@ namespace OpenSim.Region.Capabilities LLSDMapLayerResponse mapResponse= new LLSDMapLayerResponse(); mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse()); string res = LLSDHelpers.SerialiseLLSDReply(mapResponse); - - //Console.WriteLine(" Maplayer response is " + res); return res; } @@ -172,27 +163,23 @@ namespace OpenSim.Region.Capabilities public string CreateEstablishAgentComms(string caps, string ipAddressPort) { - string res = "id" + eventQueueCount + ""; - res += "events"; - res += "messageEstablishAgentCommunication"; - res += "body"; - res += "sim-ip-and-port" + ipAddressPort + ""; - res += "seed-capability" + caps + ""; - res += "agent-id" + this.agentID.ToStringHyphenated() + ""; - res += ""; - res += ""; - res += ""; + LLSDCapEvent eventItem = new LLSDCapEvent(); + eventItem.id = eventQueueCount; + //should be creating a EstablishAgentComms item, but there isn't a class for it yet + eventItem.events.Array.Add(new LLSDEmpty()); + string res = LLSDHelpers.SerialiseLLSDReply(eventItem); eventQueueCount++; + this.CapsEventQueue.Enqueue(res); return res; } public string CreateEmptyEventResponse() { - string res = "id" + eventQueueCount + ""; - res += "events"; - res += ""; - res += ""; + LLSDCapEvent eventItem = new LLSDCapEvent(); + eventItem.id = eventQueueCount; + eventItem.events.Array.Add(new LLSDEmpty()); + string res = LLSDHelpers.SerialiseLLSDReply(eventItem); eventQueueCount++; return res; } diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 40e0021b8b..6de6af6d76 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -64,6 +64,7 @@ namespace OpenSim.Region.ClientStack public event UpdatePrimTexture OnUpdatePrimTexture; public event UpdateVector OnUpdatePrimPosition; public event UpdatePrimRotation OnUpdatePrimRotation; + public event UpdatePrimGroupRotation OnUpdatePrimGroupRotation; public event UpdateVector OnUpdatePrimScale; public event StatusChange OnChildAgentStatus; public event GenericCall2 OnStopMovement; @@ -644,7 +645,7 @@ namespace OpenSim.Region.ClientStack byte[] pb = pos.GetBytes(); Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); byte[] rot = rotation.GetBytes(); - Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 48, rot.Length); + Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 36, rot.Length); OutPacket(outPacket); } diff --git a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs index e4512d1b20..0b6c4f6334 100644 --- a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs +++ b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs @@ -101,8 +101,10 @@ namespace OpenSim.Region.ClientStack protected bool MultipleObjUpdate(ClientView simClient, Packet packet) { MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; + // Console.WriteLine("new multi update packet " + multipleupdate.ToString()); for (int i = 0; i < multipleupdate.ObjectData.Length; i++) { + #region position if (multipleupdate.ObjectData[i].Type == 9) //change position { if (OnUpdatePrimPosition != null) @@ -110,24 +112,95 @@ namespace OpenSim.Region.ClientStack LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); } - //should update stored position of the prim + } - else if (multipleupdate.ObjectData[i].Type == 10)//rotation + else if (multipleupdate.ObjectData[i].Type == 1) //single item of group change position + { + if (OnUpdatePrimPosition != null) + { + // libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); + //OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); + } + } + #endregion position + #region rotation + else if (multipleupdate.ObjectData[i].Type == 2)// single item of group rotation from tab { if (OnUpdatePrimRotation != null) { LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); + // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); } } - else if (multipleupdate.ObjectData[i].Type == 13)//scale + else if (multipleupdate.ObjectData[i].Type == 3)// single item of group rotation from mouse + { + if (OnUpdatePrimRotation != null) + { + libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true); + // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); + } + } + else if (multipleupdate.ObjectData[i].Type == 10)//group rotation from object tab + { + if (OnUpdatePrimRotation != null) + { + libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); + // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); + } + } + else if (multipleupdate.ObjectData[i].Type == 11)//group rotation from mouse + { + if (OnUpdatePrimGroupRotation != null) + { + libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); + libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 12, true); + //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + OnUpdatePrimGroupRotation(multipleupdate.ObjectData[i].ObjectLocalID, pos, rot, this); + } + } + #endregion + #region scale + else if (multipleupdate.ObjectData[i].Type == 13)//group scale from object tab { if (OnUpdatePrimScale != null) { LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); + //Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); } } + else if (multipleupdate.ObjectData[i].Type == 29)//group scale from mouse + { + if (OnUpdatePrimScale != null) + { + libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 0); + // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z ); + // OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); + } + } + else if (multipleupdate.ObjectData[i].Type == 5)//single scale from object tab + { + if (OnUpdatePrimScale != null) + { + libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); + // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); + } + } + else if (multipleupdate.ObjectData[i].Type == 21)//single scale from mouse + { + if (OnUpdatePrimScale != null) + { + libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); + // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); + } + } + #endregion } return true; } diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index a8eb9ce7d3..2874ae2b21 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Scenes } } - public Quaternion _rotation; + public Quaternion _rotation = new Quaternion(0,0,1,0); public virtual Quaternion rotation { diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs index a767bd2ffe..803bd2870d 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive.cs +++ b/OpenSim/Region/Environment/Scenes/Primitive.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Scenes private PrimitiveBaseShape m_Shape; public SceneObject m_RootParent; - public bool isRootPrim; + public bool isRootPrim; public EntityBase m_Parent; public override LLVector3 Pos @@ -60,7 +60,11 @@ namespace OpenSim.Region.Environment.Scenes } set { - this.m_pos = m_Parent.Pos - value; //should we being subtracting the parent position + if (isRootPrim) + { + m_Parent.Pos = value; + } + this.m_pos = value - m_Parent.Pos; } } @@ -77,7 +81,19 @@ namespace OpenSim.Region.Environment.Scenes } } - public Primitive(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent , SceneObject rootObject) + public LLVector3 Scale + { + set + { + this.m_Shape.Scale = value; + } + get + { + return this.m_Shape.Scale; + } + } + + public Primitive(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent, SceneObject rootObject) { m_regionHandle = regionHandle; m_world = world; @@ -86,12 +102,13 @@ namespace OpenSim.Region.Environment.Scenes this.isRootPrim = isRoot; this.m_RootParent = rootObject; this.CreateFromPacket(addPacket, ownerID, localID); + this.rotation = Axiom.MathLib.Quaternion.Identity; } /// /// /// - public override void update() + public override void update() { if (this.updateFlag == 1) // is a new prim just been created/reloaded or has major changes { @@ -104,7 +121,10 @@ namespace OpenSim.Region.Environment.Scenes this.updateFlag = 0; } - base.update(); + foreach (EntityBase child in children) + { + child.update(); + } } /// @@ -150,9 +170,13 @@ namespace OpenSim.Region.Environment.Scenes this.updateFlag = 1; } + /// + /// + /// + /// public void AddNewChildren(SceneObject linkObject) { - // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")"); + // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")"); //TODO check permissions this.children.Add(linkObject.rootPrimitive); linkObject.rootPrimitive.SetNewParent(this, this.m_RootParent); @@ -161,30 +185,73 @@ namespace OpenSim.Region.Environment.Scenes linkObject.DeleteAllChildren(); } + /// + /// + /// + /// + /// public void SetNewParent(Primitive newParent, SceneObject rootParent) { LLVector3 oldPos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z); - //Console.WriteLine("have a new parent and my old position is " + this.Pos.X + " , " + this.Pos.Y + " , " + this.Pos.Z); this.isRootPrim = false; this.m_Parent = newParent; this.ParentID = newParent.LocalId; this.SetRootParent(rootParent); - // Console.WriteLine("have a new parent and its position is " + this.m_Parent.Pos.X + " , " + this.m_Parent.Pos.Y + " , " + this.m_Parent.Pos.Z); this.Pos = oldPos; - // Console.WriteLine("have a new parent so my new offset position is " + this.Pos.X + " , " + this.Pos.Y + " , " + this.Pos.Z); + Axiom.MathLib.Vector3 axPos = new Axiom.MathLib.Vector3(this.m_pos.X, m_pos.Y, m_pos.Z); + axPos = this.m_Parent.rotation.Inverse() * axPos; + this.m_pos = new LLVector3(axPos.x, axPos.y, axPos.z); + this.rotation = this.rotation * this.m_Parent.rotation.Inverse(); this.updateFlag = 1; } + /// + /// + /// + /// public void SetRootParent(SceneObject newRoot) { this.m_RootParent = newRoot; + this.m_RootParent.AddChildToList(this); foreach (Primitive child in children) { child.SetRootParent(newRoot); } } + public void AddOffsetToChildren(LLVector3 offset) + { + foreach (Primitive prim in this.children) + { + prim.m_pos += offset; + prim.updateFlag = 2; + } + } + + #region Resizing/Scale + public void ResizeGoup(LLVector3 scale) + { + LLVector3 offset = (scale - this.m_Shape.Scale); + offset.X /= 2; + offset.Y /= 2; + offset.Z /= 2; + if (this.isRootPrim) + { + this.m_Parent.Pos += offset; + } + else + { + this.m_pos += offset; + } + + this.AddOffsetToChildren(new LLVector3(-offset.X, -offset.Y, -offset.Z)); + this.m_Shape.Scale = scale; + + this.updateFlag = 1; + } + #endregion + /// /// /// @@ -192,14 +259,47 @@ namespace OpenSim.Region.Environment.Scenes public void UpdatePosition(LLVector3 pos) { LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); - if (this.isRootPrim) - { - this.m_Parent.Pos = newPos; - } + this.Pos = newPos; this.updateFlag = 2; } + public void UpdateRotation(LLQuaternion rot) + { + this.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z); + this.updateFlag = 2; + } + + public void UpdateGroupMouseRotation(LLVector3 pos, LLQuaternion rot) + { + this.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z); + this.Pos = pos; + this.updateFlag = 2; + } + + public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock) + { + this.m_Shape.PathBegin = shapeBlock.PathBegin; + this.m_Shape.PathEnd = shapeBlock.PathEnd; + this.m_Shape.PathScaleX = shapeBlock.PathScaleX; + this.m_Shape.PathScaleY = shapeBlock.PathScaleY; + this.m_Shape.PathShearX = shapeBlock.PathShearX; + this.m_Shape.PathShearY = shapeBlock.PathShearY; + this.m_Shape.PathSkew = shapeBlock.PathSkew; + this.m_Shape.ProfileBegin = shapeBlock.ProfileBegin; + this.m_Shape.ProfileEnd = shapeBlock.ProfileEnd; + this.m_Shape.PathCurve = shapeBlock.PathCurve; + this.m_Shape.ProfileCurve = shapeBlock.ProfileCurve; + this.m_Shape.ProfileHollow = shapeBlock.ProfileHollow; + this.m_Shape.PathRadiusOffset = shapeBlock.PathRadiusOffset; + this.m_Shape.PathRevolutions = shapeBlock.PathRevolutions; + this.m_Shape.PathTaperX = shapeBlock.PathTaperX; + this.m_Shape.PathTaperY = shapeBlock.PathTaperY; + this.m_Shape.PathTwist = shapeBlock.PathTwist; + this.m_Shape.PathTwistBegin = shapeBlock.PathTwistBegin; + this.updateFlag = 1; + } + #region Client Update Methods /// @@ -226,8 +326,10 @@ namespace OpenSim.Region.Environment.Scenes { LLVector3 lPos; lPos = this.Pos; + LLQuaternion lRot; + lRot = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w); - remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.m_Shape, lPos, new LLUUID("00000000-0000-0000-9999-000000000005"), this.flags, this.uuid, this.OwnerID, this.Text, this.ParentID); + remoteClient.SendPrimitiveToClient(this.m_regionHandle, 64096, this.LocalId, this.m_Shape, lPos, lRot, new LLUUID("00000000-0000-0000-9999-000000000005"), this.flags, this.uuid, this.OwnerID, this.Text, this.ParentID); } /// diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 669039fa5a..09279032bb 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -233,7 +233,19 @@ namespace OpenSim.Region.Environment.Scenes /// public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock) { - + Primitive prim = null; + foreach (EntityBase ent in Entities.Values) + { + if (ent is SceneObject) + { + prim = ((SceneObject)ent).HasChildPrim(primLocalID); + if (prim != null) + { + prim.UpdateShape(shapeBlock); + break; + } + } + } } /// @@ -263,7 +275,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void PrimDescription(uint primLocalID, string description) { - Primitive prim = null; + Primitive prim = null; foreach (EntityBase ent in Entities.Values) { if (ent is SceneObject) @@ -271,7 +283,7 @@ namespace OpenSim.Region.Environment.Scenes prim = ((SceneObject)ent).HasChildPrim(primLocalID); if (prim != null) { - prim.Description = description; + prim.Description = description; break; } } @@ -341,12 +353,41 @@ namespace OpenSim.Region.Environment.Scenes /// public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient) { - foreach (Entity ent in Entities.Values) + Primitive prim = null; + foreach (EntityBase ent in Entities.Values) { - if (ent.LocalId == localID) + if (ent is SceneObject) { - ((PrimitiveOld)ent).UpdatePosition(pos); - break; + prim = ((SceneObject)ent).HasChildPrim(localID); + if (prim != null) + { + prim.UpdatePosition(pos); + break; + } + } + } + } + + /// + /// + /// + /// + /// + /// + /// + public void UpdatePrimRotation(uint localID, LLVector3 pos, LLQuaternion rot, IClientAPI remoteClient) + { + Primitive prim = null; + foreach (EntityBase ent in Entities.Values) + { + if (ent is SceneObject) + { + prim = ((SceneObject)ent).HasChildPrim(localID); + if (prim != null) + { + prim.UpdateGroupMouseRotation( pos, rot); + break; + } } } } @@ -359,7 +400,19 @@ namespace OpenSim.Region.Environment.Scenes /// public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient) { - + Primitive prim = null; + foreach (EntityBase ent in Entities.Values) + { + if (ent is SceneObject) + { + prim = ((SceneObject)ent).HasChildPrim(localID); + if (prim != null) + { + prim.UpdateRotation(rot); + break; + } + } + } } /// @@ -370,6 +423,19 @@ namespace OpenSim.Region.Environment.Scenes /// public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient) { + Primitive prim = null; + foreach (EntityBase ent in Entities.Values) + { + if (ent is SceneObject) + { + prim = ((SceneObject)ent).HasChildPrim(localID); + if (prim != null) + { + prim.ResizeGoup(scale); + break; + } + } + } } /// diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d13b3abc9d..838d722cfa 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -452,7 +452,11 @@ namespace OpenSim.Region.Environment.Scenes client.OnChatFromViewer += this.SimChat; client.OnRequestWearables += this.InformClientOfNeighbours; client.OnAddPrim += this.AddNewPrim; - //client.OnUpdatePrimPosition += this.UpdatePrimPosition; + client.OnUpdatePrimPosition += this.UpdatePrimPosition; + client.OnUpdatePrimRotation += this.UpdatePrimRotation; + client.OnUpdatePrimGroupRotation += this.UpdatePrimRotation; + client.OnUpdatePrimScale += this.UpdatePrimScale; + client.OnUpdatePrimShape += this.UpdatePrimShape; client.OnRequestMapBlocks += this.RequestMapBlocks; client.OnTeleportLocationRequest += this.RequestTeleportLocation; client.OnObjectSelect += this.SelectPrim; @@ -596,6 +600,17 @@ namespace OpenSim.Region.Environment.Scenes return false; } + public void SendAllSceneObjectsToClient(IClientAPI client) + { + foreach (EntityBase ent in Entities.Values) + { + if (ent is SceneObject) + { + ((SceneObject)ent).SendAllChildPrimsToClient(client); + } + } + } + #region RegionCommsHost /// diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs index 04ed408fb8..3d97a06bf5 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObject.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs @@ -63,6 +63,7 @@ namespace OpenSim.Region.Environment.Scenes return this.LocalId; } } + /// /// /// @@ -72,8 +73,8 @@ namespace OpenSim.Region.Environment.Scenes m_world = world; this.Pos = addPacket.ObjectData.RayEnd; this.CreateRootFromPacket(addPacket, ownerID, localID); - } + /// /// /// @@ -115,6 +116,13 @@ namespace OpenSim.Region.Environment.Scenes this.rootPrimitive.AddNewChildren(primObject); } + public void AddChildToList(Primitive prim) + { + if (!this.ChildPrimitives.ContainsKey(prim.uuid)) + { + this.ChildPrimitives.Add(prim.uuid, prim); + } + } /// /// /// @@ -130,10 +138,15 @@ namespace OpenSim.Region.Environment.Scenes return null; } + /// + /// + /// + /// + /// public Primitive HasChildPrim(uint localID) { Primitive returnPrim = null; - foreach (Primitive prim in this.children) + foreach (Primitive prim in this.ChildPrimitives.Values) { if (prim.LocalId == localID) { @@ -144,6 +157,11 @@ namespace OpenSim.Region.Environment.Scenes return returnPrim; } + public void SendAllChildPrimsToClient(IClientAPI client) + { + this.rootPrimitive.SendFullUpdateForAllChildren(client); + } + /// /// /// @@ -160,7 +178,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) { - this.Pos = pos; + //this.Pos = pos; this.rootPrimitive.Pos = pos; this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient); } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index dcca84884a..98fa2edf1b 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -384,6 +384,7 @@ namespace OpenSim.Region.Environment.Scenes public void SendOurAppearance(IClientAPI OurClient) { this.ControllingClient.SendWearables(this.Wearables); + this.m_world.SendAllSceneObjectsToClient(this.ControllingClient); } ///