* 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:
Teravus Ovares
2008-04-24 11:32:41 +00:00
parent c49b25f19e
commit aa8aee90a3
8 changed files with 177 additions and 27 deletions

View File

@@ -99,6 +99,11 @@ namespace OpenSim.Region.Environment.Scenes
// TODO: This needs to be persisted in next XML version update!
[XmlIgnore] public int[] PayPrice = {0,0,0,0,0};
[XmlIgnore] public bool m_IsAttachment = false;
[XmlIgnore] public uint m_attachmentPoint = (byte)0;
[XmlIgnore] public LLUUID m_attachedAvatar = LLUUID.Zero;
public Int32 CreationDate;
public uint ParentID = 0;
@@ -1271,7 +1276,17 @@ namespace OpenSim.Region.Environment.Scenes
}
return returnresult;
}
// Use this for attachments! LocalID should be avatar's localid
public void SetParentLocalId(uint localID)
{
ParentID = localID;
}
public void SetAttachmentPoint(uint AttachmentPoint)
{
m_attachmentPoint = AttachmentPoint;
}
/// <summary>
///
/// </summary>
@@ -2212,7 +2227,7 @@ namespace OpenSim.Region.Environment.Scenes
byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A};
remoteClient.SendPrimitiveToClient(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, lPos, clientFlags, m_uuid,
OwnerID,
m_text, color, ParentID, m_particleSystem, lRot, m_clickAction, m_TextureAnimation);
m_text, color, ParentID, m_particleSystem, lRot, m_clickAction, m_TextureAnimation, m_IsAttachment, m_attachmentPoint);
}
/// Terse updates
@@ -2271,15 +2286,22 @@ namespace OpenSim.Region.Environment.Scenes
public void SendTerseUpdateToClient(IClientAPI remoteClient, LLVector3 lPos)
{
LLQuaternion mRot = RotationOffset;
if ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) == 0)
if (m_IsAttachment)
{
remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Shape.State);
remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, (byte)(((byte)m_attachmentPoint) << 4));
}
else
{
remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity,
RotationalVelocity);
//System.Console.WriteLine("LID: " + LocalID + "RVel:" + RotationalVelocity.ToString() + " TD: " + ((ushort)(m_parentGroup.Scene.TimeDilation * 500000f)).ToString() + ":" + m_parentGroup.Scene.TimeDilation.ToString());
if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) == 0)
{
remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Shape.State);
}
else
{
remoteClient.SendPrimTerseUpdate(m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, lPos, mRot, Velocity,
RotationalVelocity);
//System.Console.WriteLine("LID: " + LocalID + "RVel:" + RotationalVelocity.ToString() + " TD: " + ((ushort)(m_parentGroup.Scene.TimeDilation * 500000f)).ToString() + ":" + m_parentGroup.Scene.TimeDilation.ToString());
}
}
}