mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
* Adds much better support for attachments that you right click on in world.
* Your friends can see your attachments now. People who appear in the sim after you've attached something can also see your attachments. * You can position & rotate your attachments now. Positions do *not* save. * You can detach attachments now the regular way. * Attachments do not cross into other regions with you..(this isn't too far off) * Updated ODE to not request terse updates on child prim.
This commit is contained in:
@@ -235,6 +235,7 @@ namespace OpenSim.Region.ClientStack
|
||||
|
||||
private ScriptAnswer handlerScriptAnswer = null;
|
||||
private RequestPayPrice handlerRequestPayPrice = null;
|
||||
private ObjectDeselect handlerObjectDetach = null;
|
||||
|
||||
/* Properties */
|
||||
|
||||
@@ -689,6 +690,7 @@ namespace OpenSim.Region.ClientStack
|
||||
public event AvatarNowWearing OnAvatarNowWearing;
|
||||
public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
|
||||
public event ObjectAttach OnObjectAttach;
|
||||
public event ObjectDeselect OnObjectDetach;
|
||||
public event GenericCall2 OnCompleteMovementToRegion;
|
||||
public event UpdateAgent OnAgentUpdate;
|
||||
public event AgentRequestSit OnAgentRequestSit;
|
||||
@@ -1989,6 +1991,7 @@ namespace OpenSim.Region.ClientStack
|
||||
/// <param name="attachPoint"></param>
|
||||
public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint)
|
||||
{
|
||||
|
||||
ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach);
|
||||
Console.WriteLine("Attach object!");
|
||||
// TODO: don't create new blocks if recycling an old packet
|
||||
@@ -2013,13 +2016,13 @@ namespace OpenSim.Region.ClientStack
|
||||
|
||||
SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, flags,
|
||||
objectID, ownerID, text, color, parentID, particleSystem,
|
||||
rotation, clickAction, textureanim);
|
||||
rotation, clickAction, textureanim, false,(uint)0);
|
||||
}
|
||||
public void SendPrimitiveToClient(
|
||||
ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos,
|
||||
uint flags,
|
||||
LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
|
||||
LLQuaternion rotation, byte clickAction, byte[] textureanim)
|
||||
LLQuaternion rotation, byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint)
|
||||
{
|
||||
ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
|
||||
// TODO: don't create new blocks if recycling an old packet
|
||||
@@ -2050,6 +2053,18 @@ namespace OpenSim.Region.ClientStack
|
||||
outPacket.ObjectData[0].ClickAction = clickAction;
|
||||
//outPacket.ObjectData[0].Flags = 0;
|
||||
|
||||
if (attachment)
|
||||
{
|
||||
// Necessary???
|
||||
outPacket.ObjectData[0].JointAxisOrAnchor = new LLVector3(0, 0, 2);
|
||||
outPacket.ObjectData[0].JointPivot = new LLVector3(0, 0, 0);
|
||||
|
||||
// Item from inventory???
|
||||
outPacket.ObjectData[0].NameValue =
|
||||
Helpers.StringToField("AttachItemID STRING RW SV " + objectID.UUID);
|
||||
outPacket.ObjectData[0].State = (byte)(((byte)AttachPoint) << 4);
|
||||
}
|
||||
|
||||
// Sound Radius
|
||||
outPacket.ObjectData[0].Radius = 20;
|
||||
|
||||
@@ -3437,6 +3452,21 @@ namespace OpenSim.Region.ClientStack
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case PacketType.ObjectDetach:
|
||||
|
||||
ObjectDetachPacket dett = (ObjectDetachPacket)Pack;
|
||||
for (int j = 0; j < dett.ObjectData.Length; j++)
|
||||
{
|
||||
uint obj = dett.ObjectData[j].ObjectLocalID;
|
||||
handlerObjectDetach = OnObjectDetach;
|
||||
if (handlerObjectDetach != null)
|
||||
{
|
||||
handlerObjectDetach(obj,this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case PacketType.SetAlwaysRun:
|
||||
SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack;
|
||||
|
||||
Reference in New Issue
Block a user