diff options
author | Teravus Ovares | 2008-04-24 11:32:41 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-24 11:32:41 +0000 |
commit | aa8aee90a35458f1f601ca23e2298b212782d0a3 (patch) | |
tree | 37c2645867cba040a4ad7e32d1b5ccd56d155d87 /OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |
parent | * From: Alan M Webb <awebb.vnet.ibm.com> (diff) | |
download | opensim-SC_OLD-aa8aee90a35458f1f601ca23e2298b212782d0a3.zip opensim-SC_OLD-aa8aee90a35458f1f601ca23e2298b212782d0a3.tar.gz opensim-SC_OLD-aa8aee90a35458f1f601ca23e2298b212782d0a3.tar.bz2 opensim-SC_OLD-aa8aee90a35458f1f601ca23e2298b212782d0a3.tar.xz |
* 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.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 4f65cc7..27639ea 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
180 | set | 180 | set |
181 | { | 181 | { |
182 | LLVector3 val = value; | 182 | LLVector3 val = value; |
183 | if (val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) | 183 | if ((val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) && !m_rootPart.m_IsAttachment) |
184 | { | 184 | { |
185 | m_scene.CrossPrimGroupIntoNewRegion(val, this); | 185 | m_scene.CrossPrimGroupIntoNewRegion(val, this); |
186 | } | 186 | } |
@@ -612,6 +612,42 @@ namespace OpenSim.Region.Environment.Scenes | |||
612 | m_rootPart = part; | 612 | m_rootPart = part; |
613 | } | 613 | } |
614 | 614 | ||
615 | |||
616 | public void AttachToAgent(LLUUID agentID, uint attachmentpoint) | ||
617 | { | ||
618 | ScenePresence avatar = m_scene.GetScenePresence(agentID); | ||
619 | if (avatar != null) | ||
620 | { | ||
621 | m_rootPart.m_attachedAvatar = agentID; | ||
622 | m_rootPart.SetParentLocalId(avatar.LocalId); | ||
623 | m_rootPart.SetAttachmentPoint(attachmentpoint); | ||
624 | m_rootPart.m_IsAttachment = true; | ||
625 | if (m_rootPart.PhysActor != null) | ||
626 | { | ||
627 | m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor); | ||
628 | m_rootPart.PhysActor = null; | ||
629 | AbsolutePosition = LLVector3.Zero; | ||
630 | } | ||
631 | m_rootPart.ScheduleFullUpdate(); | ||
632 | } | ||
633 | } | ||
634 | |||
635 | public void DetachToGround() | ||
636 | { | ||
637 | ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.m_attachedAvatar); | ||
638 | LLVector3 detachedpos = new LLVector3(127f,127f,127f); | ||
639 | if (avatar != null) | ||
640 | { | ||
641 | detachedpos = avatar.AbsolutePosition; | ||
642 | } | ||
643 | AbsolutePosition = detachedpos; | ||
644 | m_rootPart.m_attachedAvatar = LLUUID.Zero; | ||
645 | m_rootPart.SetParentLocalId(0); | ||
646 | m_rootPart.SetAttachmentPoint((byte)0); | ||
647 | m_rootPart.m_IsAttachment = false; | ||
648 | m_rootPart.ApplyPhysics(m_rootPart.ObjectFlags, m_scene.m_physicalPrim); | ||
649 | m_rootPart.ScheduleFullUpdate(); | ||
650 | } | ||
615 | /// <summary> | 651 | /// <summary> |
616 | /// | 652 | /// |
617 | /// </summary> | 653 | /// </summary> |