* 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

@@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Scenes
set
{
LLVector3 val = value;
if (val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f)
if ((val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) && !m_rootPart.m_IsAttachment)
{
m_scene.CrossPrimGroupIntoNewRegion(val, this);
}
@@ -612,6 +612,42 @@ namespace OpenSim.Region.Environment.Scenes
m_rootPart = part;
}
public void AttachToAgent(LLUUID agentID, uint attachmentpoint)
{
ScenePresence avatar = m_scene.GetScenePresence(agentID);
if (avatar != null)
{
m_rootPart.m_attachedAvatar = agentID;
m_rootPart.SetParentLocalId(avatar.LocalId);
m_rootPart.SetAttachmentPoint(attachmentpoint);
m_rootPart.m_IsAttachment = true;
if (m_rootPart.PhysActor != null)
{
m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor);
m_rootPart.PhysActor = null;
AbsolutePosition = LLVector3.Zero;
}
m_rootPart.ScheduleFullUpdate();
}
}
public void DetachToGround()
{
ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.m_attachedAvatar);
LLVector3 detachedpos = new LLVector3(127f,127f,127f);
if (avatar != null)
{
detachedpos = avatar.AbsolutePosition;
}
AbsolutePosition = detachedpos;
m_rootPart.m_attachedAvatar = LLUUID.Zero;
m_rootPart.SetParentLocalId(0);
m_rootPart.SetAttachmentPoint((byte)0);
m_rootPart.m_IsAttachment = false;
m_rootPart.ApplyPhysics(m_rootPart.ObjectFlags, m_scene.m_physicalPrim);
m_rootPart.ScheduleFullUpdate();
}
/// <summary>
///
/// </summary>