diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index de53614539..887be3bfc4 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -249,7 +249,7 @@ namespace OpenSim.Framework public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); - public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape); + public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape); public delegate void CreateInventoryFolder( IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID); @@ -444,4 +444,4 @@ namespace OpenSim.Framework event Action OnConnectionClosed; void SendLogoutPacket(); } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 3b996d5007..1e14587762 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -243,7 +243,7 @@ namespace OpenSim.Region.ClientStack { ObjectAddPacket addPacket = (ObjectAddPacket) Pack; PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); - OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, shape); + OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape); } break; case PacketType.ObjectShape: diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e37ad597cf..8da22c4a39 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -568,12 +568,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape) + public void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) { if (PermissionsMngr.CanRezObject(ownerID, pos)) { SceneObjectGroup sceneOb = - new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); + new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); AddEntity(sceneOb); SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); // if grass or tree, make phantom @@ -1565,4 +1565,4 @@ namespace OpenSim.Region.Environment.Scenes } } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2f86d2f946..aaa25e791e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -322,7 +322,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, - PrimitiveBaseShape shape) + LLQuaternion rot, PrimitiveBaseShape shape) { m_regionHandle = regionHandle; m_scene = scene; @@ -330,13 +330,21 @@ namespace OpenSim.Region.Environment.Scenes // this.Pos = pos; LLVector3 rootOffset = new LLVector3(0, 0, 0); SceneObjectPart newPart = - new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset); + new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rot, rootOffset); m_parts.Add(newPart.UUID, newPart); SetPartAsRoot(newPart); AttachToBackup(); } + /// + /// + /// + public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, + PrimitiveBaseShape shape):this(scene, regionHandle, ownerID, localID, pos, LLQuaternion.Identity, shape) + { + } + #endregion public string ToXmlString() @@ -1386,4 +1394,4 @@ namespace OpenSim.Region.Environment.Scenes Text = text; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 80723fa081..dacac4b49c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -271,6 +271,11 @@ namespace OpenSim.Region.Environment.Scenes { } + public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, + PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition):this(regionHandle, parent, ownerID, localID, shape, groupPosition, LLQuaternion.Identity, offsetPosition) + { + } + /// /// Create a completely new SceneObjectPart (prim) /// @@ -281,7 +286,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, - PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition) + PrimitiveBaseShape shape, LLVector3 groupPosition, LLQuaternion rotationOffset, LLVector3 offsetPosition) { m_name = "Primitive"; m_regionHandle = regionHandle; @@ -297,7 +302,7 @@ namespace OpenSim.Region.Environment.Scenes GroupPosition = groupPosition; OffsetPosition = offsetPosition; - RotationOffset = LLQuaternion.Identity; + RotationOffset = rotationOffset; Velocity = new LLVector3(0, 0, 0); AngularVelocity = new LLVector3(0, 0, 0); Acceleration = new LLVector3(0, 0, 0);