diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index df1b4a3bc9..d8980c1c3c 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -624,6 +624,7 @@ namespace OpenSim.Client.MXP.ClientStack public event UpdateVector OnUpdatePrimGroupPosition; public event UpdateVector OnUpdatePrimSinglePosition; public event UpdatePrimRotation OnUpdatePrimGroupRotation; + public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; public event UpdateVector OnUpdatePrimScale; diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index c0c762540f..457039592b 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -272,6 +272,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack public event UpdateVector OnUpdatePrimSinglePosition = delegate { }; public event UpdatePrimRotation OnUpdatePrimGroupRotation = delegate { }; public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation = delegate { }; + public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition = delegate { }; public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation = delegate { }; public event UpdateVector OnUpdatePrimScale = delegate { }; public event UpdateVector OnUpdatePrimGroupScale = delegate { }; diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index efde5ce4cc..fea0cea0c9 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -129,6 +129,8 @@ namespace OpenSim.Framework public delegate void UpdatePrimSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient); + public delegate void UpdatePrimSingleRotationPosition( uint localID, Quaternion rot, Vector3 pos, IClientAPI remoteClient); + public delegate void UpdatePrimGroupRotation(uint localID, Vector3 pos, Quaternion rot, IClientAPI remoteClient); public delegate void ObjectDuplicate(uint localID, Vector3 offset, uint dupeFlags, UUID AgentID, UUID GroupID); @@ -633,6 +635,7 @@ namespace OpenSim.Framework event UpdateVector OnUpdatePrimSinglePosition; event UpdatePrimRotation OnUpdatePrimGroupRotation; event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; + event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; event UpdateVector OnUpdatePrimScale; event UpdateVector OnUpdatePrimGroupScale; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 3fdb386659..a13f6d4629 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -267,6 +267,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private UpdateVector handlerUpdatePrimSinglePosition; //OnUpdatePrimSinglePosition; private UpdatePrimSingleRotation handlerUpdatePrimSingleRotation; //OnUpdatePrimSingleRotation; + private UpdatePrimSingleRotationPosition handlerUpdatePrimSingleRotationPosition; //OnUpdatePrimSingleRotation; private UpdateVector handlerUpdatePrimScale; //OnUpdatePrimScale; private UpdateVector handlerUpdatePrimGroupScale; //OnUpdateGroupScale; private UpdateVector handlerUpdateVector; //OnUpdatePrimGroupPosition; @@ -1095,6 +1096,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event UpdateVector OnUpdatePrimSinglePosition; public event UpdatePrimRotation OnUpdatePrimGroupRotation; public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; + public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; public event UpdateVector OnUpdatePrimScale; public event UpdateVector OnUpdatePrimGroupScale; @@ -4481,18 +4483,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; if (handlerUpdatePrimSingleRotation != null) { - //m_log.Debug("new tab rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + // m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W); handlerUpdatePrimSingleRotation(localId, rot1, this); } break; case 3: - + Vector3 rotPos = new Vector3(block.Data, 0); Quaternion rot2 = new Quaternion(block.Data, 12, true); - handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; - if (handlerUpdatePrimSingleRotation != null) + + handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition; + if (handlerUpdatePrimSingleRotationPosition != null) { - //m_log.Debug("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); - handlerUpdatePrimSingleRotation(localId, rot2, this); + // m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z); + // m_log.Info("new mouse rotation is " + rot2.X + " , " + rot2.Y + " , " + rot2.Z + " , " + rot2.W); + handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this); } break; case 4: @@ -4541,7 +4545,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; if (handlerUpdatePrimRotation != null) { - // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + // Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W); handlerUpdatePrimRotation(localId, rot3, this); } break; @@ -4552,8 +4556,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation; if (handlerUpdatePrimGroupRotation != null) { - //m_log.Debug("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); - // m_log.Debug("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + // m_log.Debug("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + // m_log.Debug("new group mouse rotation is " + rot4.X + " , " + rot4.Y + " , " + rot4.Z + " , " + rot4.W); handlerUpdatePrimGroupRotation(localId, pos3, rot4, this); } break; diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 5e33729c68..ed38046bd8 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -117,6 +117,7 @@ namespace OpenSim.Region.Examples.SimpleModule public event UpdateVector OnUpdatePrimGroupPosition; public event UpdateVector OnUpdatePrimSinglePosition; public event UpdatePrimRotation OnUpdatePrimGroupRotation; + public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; public event UpdateVector OnUpdatePrimScale; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 81d54e7651..63cf9ce67f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1964,6 +1964,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation; client.OnUpdatePrimGroupMouseRotation += m_sceneGraph.UpdatePrimRotation; client.OnUpdatePrimSingleRotation += m_sceneGraph.UpdatePrimSingleRotation; + client.OnUpdatePrimSingleRotationPosition += m_sceneGraph.UpdatePrimSingleRotationPosition; client.OnUpdatePrimScale += m_sceneGraph.UpdatePrimScale; client.OnUpdatePrimGroupScale += m_sceneGraph.UpdatePrimGroupScale; client.OnUpdateExtraParams += m_sceneGraph.UpdateExtraParam; diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 62870d530f..3f634814fb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1201,6 +1201,25 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// + /// + /// + /// + /// + protected internal void UpdatePrimSingleRotationPosition(uint localID, Quaternion rot, Vector3 pos, IClientAPI remoteClient) + { + SceneObjectGroup group = GetGroupByPrim(localID); + if (group != null) + { + if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)) + { + group.UpdateSingleRotation(rot,pos, localID); + } + } + } + + /// /// /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e987445f50..00ae504571 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -625,6 +625,8 @@ namespace OpenSim.Region.Framework.Scenes Vector3 backBottomLeft; Vector3 backBottomRight; + // Vector3[] corners = new Vector3[8]; + Vector3 orig = Vector3.Zero; frontTopLeft.X = orig.X - (part.Scale.X / 2); @@ -660,6 +662,36 @@ namespace OpenSim.Region.Framework.Scenes backBottomRight.Y = orig.Y + (part.Scale.Y / 2); backBottomRight.Z = orig.Z - (part.Scale.Z / 2); + //m_log.InfoFormat("pre corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z); + //m_log.InfoFormat("pre corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z); + //m_log.InfoFormat("pre corner 3 is {0} {1} {2}", frontBottomRight.X, frontBottomRight.Y, frontBottomRight.Z); + //m_log.InfoFormat("pre corner 4 is {0} {1} {2}", frontBottomLeft.X, frontBottomLeft.Y, frontBottomLeft.Z); + //m_log.InfoFormat("pre corner 5 is {0} {1} {2}", backTopLeft.X, backTopLeft.Y, backTopLeft.Z); + //m_log.InfoFormat("pre corner 6 is {0} {1} {2}", backTopRight.X, backTopRight.Y, backTopRight.Z); + //m_log.InfoFormat("pre corner 7 is {0} {1} {2}", backBottomRight.X, backBottomRight.Y, backBottomRight.Z); + //m_log.InfoFormat("pre corner 8 is {0} {1} {2}", backBottomLeft.X, backBottomLeft.Y, backBottomLeft.Z); + + //for (int i = 0; i < 8; i++) + //{ + // corners[i] = corners[i] * worldRot; + // corners[i] += offset; + + // if (corners[i].X > maxX) + // maxX = corners[i].X; + // if (corners[i].X < minX) + // minX = corners[i].X; + + // if (corners[i].Y > maxY) + // maxY = corners[i].Y; + // if (corners[i].Y < minY) + // minY = corners[i].Y; + + // if (corners[i].Z > maxZ) + // maxZ = corners[i].Y; + // if (corners[i].Z < minZ) + // minZ = corners[i].Z; + //} + frontTopLeft = frontTopLeft * worldRot; frontTopRight = frontTopRight * worldRot; frontBottomLeft = frontBottomLeft * worldRot; @@ -681,6 +713,15 @@ namespace OpenSim.Region.Framework.Scenes backTopLeft += offset; backTopRight += offset; + //m_log.InfoFormat("corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z); + //m_log.InfoFormat("corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z); + //m_log.InfoFormat("corner 3 is {0} {1} {2}", frontBottomRight.X, frontBottomRight.Y, frontBottomRight.Z); + //m_log.InfoFormat("corner 4 is {0} {1} {2}", frontBottomLeft.X, frontBottomLeft.Y, frontBottomLeft.Z); + //m_log.InfoFormat("corner 5 is {0} {1} {2}", backTopLeft.X, backTopLeft.Y, backTopLeft.Z); + //m_log.InfoFormat("corner 6 is {0} {1} {2}", backTopRight.X, backTopRight.Y, backTopRight.Z); + //m_log.InfoFormat("corner 7 is {0} {1} {2}", backBottomRight.X, backBottomRight.Y, backBottomRight.Z); + //m_log.InfoFormat("corner 8 is {0} {1} {2}", backBottomLeft.X, backBottomLeft.Y, backBottomLeft.Z); + if (frontTopRight.X > maxX) maxX = frontTopRight.X; if (frontTopLeft.X > maxX) @@ -801,15 +842,15 @@ namespace OpenSim.Region.Framework.Scenes if (lower > maxZ) { offsetHeight = lower - (boundingBox.Z / 2); - + } else if (maxZ > lower) { offsetHeight = maxZ - (boundingBox.Z / 2); offsetHeight *= -1; } - - // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z); + + // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z); return boundingBox; } #endregion @@ -3013,6 +3054,29 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// + /// + /// + /// + public void UpdateSingleRotation(Quaternion rot, Vector3 pos, uint localID) + { + SceneObjectPart part = GetChildPart(localID); + if (part != null) + { + if (part.UUID == m_rootPart.UUID) + { + UpdateRootRotation(rot); + AbsolutePosition = pos; + } + else + { + part.UpdateRotation(rot); + part.OffsetPosition = pos; + } + } + } + /// /// /// diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 8ec1780dcd..776e97262a 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -699,6 +699,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public event UpdateVector OnUpdatePrimSinglePosition; public event UpdatePrimRotation OnUpdatePrimGroupRotation; public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; + public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; public event UpdateVector OnUpdatePrimScale; public event UpdateVector OnUpdatePrimGroupScale; diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 228683e9d9..a1ed6eefc1 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -223,6 +223,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC public event UpdateVector OnUpdatePrimGroupPosition; public event UpdateVector OnUpdatePrimSinglePosition; public event UpdatePrimRotation OnUpdatePrimGroupRotation; + public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; public event UpdateVector OnUpdatePrimScale; diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index c76d180076..21541e17f1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -130,6 +130,7 @@ namespace OpenSim.Tests.Common.Mock public event UpdateVector OnUpdatePrimSinglePosition; public event UpdatePrimRotation OnUpdatePrimGroupRotation; public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; + public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; public event UpdateVector OnUpdatePrimScale; public event UpdateVector OnUpdatePrimGroupScale;