Thank you, Melanie for solving: When receiving an ObjectAdd packet, the Rotation member is silently ignored and the prim is created with 0,0,0,1 rotation. The patch introduces a fix that passes the Rotation parameter from the packet to the object and uses it in the actual object creation.

afrisby
Charles Krinke 2007-11-01 03:56:54 +00:00
parent 41e71e5548
commit 8af272b3ab
5 changed files with 24 additions and 11 deletions

View File

@ -249,7 +249,7 @@ namespace OpenSim.Framework
public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); 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( public delegate void CreateInventoryFolder(
IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID); IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID);
@ -444,4 +444,4 @@ namespace OpenSim.Framework
event Action<IClientAPI> OnConnectionClosed; event Action<IClientAPI> OnConnectionClosed;
void SendLogoutPacket(); void SendLogoutPacket();
} }
} }

View File

@ -243,7 +243,7 @@ namespace OpenSim.Region.ClientStack
{ {
ObjectAddPacket addPacket = (ObjectAddPacket) Pack; ObjectAddPacket addPacket = (ObjectAddPacket) Pack;
PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket);
OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, shape); OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape);
} }
break; break;
case PacketType.ObjectShape: case PacketType.ObjectShape:

View File

@ -568,12 +568,12 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="addPacket"></param> /// <param name="addPacket"></param>
/// <param name="ownerID"></param> /// <param name="ownerID"></param>
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)) if (PermissionsMngr.CanRezObject(ownerID, pos))
{ {
SceneObjectGroup sceneOb = SceneObjectGroup sceneOb =
new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
AddEntity(sceneOb); AddEntity(sceneOb);
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
// if grass or tree, make phantom // if grass or tree, make phantom
@ -1565,4 +1565,4 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
} }
} }

View File

@ -322,7 +322,7 @@ namespace OpenSim.Region.Environment.Scenes
/// ///
/// </summary> /// </summary>
public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
PrimitiveBaseShape shape) LLQuaternion rot, PrimitiveBaseShape shape)
{ {
m_regionHandle = regionHandle; m_regionHandle = regionHandle;
m_scene = scene; m_scene = scene;
@ -330,13 +330,21 @@ namespace OpenSim.Region.Environment.Scenes
// this.Pos = pos; // this.Pos = pos;
LLVector3 rootOffset = new LLVector3(0, 0, 0); LLVector3 rootOffset = new LLVector3(0, 0, 0);
SceneObjectPart newPart = 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); m_parts.Add(newPart.UUID, newPart);
SetPartAsRoot(newPart); SetPartAsRoot(newPart);
AttachToBackup(); AttachToBackup();
} }
/// <summary>
///
/// </summary>
public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
PrimitiveBaseShape shape):this(scene, regionHandle, ownerID, localID, pos, LLQuaternion.Identity, shape)
{
}
#endregion #endregion
public string ToXmlString() public string ToXmlString()
@ -1386,4 +1394,4 @@ namespace OpenSim.Region.Environment.Scenes
Text = text; Text = text;
} }
} }
} }

View File

@ -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)
{
}
/// <summary> /// <summary>
/// Create a completely new SceneObjectPart (prim) /// Create a completely new SceneObjectPart (prim)
/// </summary> /// </summary>
@ -281,7 +286,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="shape"></param> /// <param name="shape"></param>
/// <param name="position"></param> /// <param name="position"></param>
public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, 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_name = "Primitive";
m_regionHandle = regionHandle; m_regionHandle = regionHandle;
@ -297,7 +302,7 @@ namespace OpenSim.Region.Environment.Scenes
GroupPosition = groupPosition; GroupPosition = groupPosition;
OffsetPosition = offsetPosition; OffsetPosition = offsetPosition;
RotationOffset = LLQuaternion.Identity; RotationOffset = rotationOffset;
Velocity = new LLVector3(0, 0, 0); Velocity = new LLVector3(0, 0, 0);
AngularVelocity = new LLVector3(0, 0, 0); AngularVelocity = new LLVector3(0, 0, 0);
Acceleration = new LLVector3(0, 0, 0); Acceleration = new LLVector3(0, 0, 0);