mirror of
https://github.com/opensim/opensim.git
synced 2026-08-14 09:25:45 +08:00
* Fixes prim crossing. See bug 1050.
* Causes the internal handling of attachments to put the prim group conceptually at the position of the avatar instead of 0,0,0
This commit is contained in:
@@ -314,6 +314,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
List<EntityBase> EntityList = GetEntities();
|
||||
|
||||
if (AttachmentPt == 0)
|
||||
AttachmentPt = (uint)AttachmentPoint.LeftHand;
|
||||
|
||||
foreach (EntityBase obj in EntityList)
|
||||
{
|
||||
if (obj is SceneObjectGroup)
|
||||
|
||||
@@ -1368,14 +1368,19 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
m_sceneXmlLoader.SavePrimsToXml2(fileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Locate New region Handle and offset the prim position for the new region
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="position">current position of Group</param>
|
||||
/// <param name="grp">Scene Object Group that we're crossing</param>
|
||||
|
||||
public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp)
|
||||
{
|
||||
m_log.Warn("Prim crossing: " + grp.UUID.ToString());
|
||||
int thisx = (int)RegionInfo.RegionLocX;
|
||||
int thisy = (int)RegionInfo.RegionLocY;
|
||||
|
||||
int primcrossingXMLmethod = 0;
|
||||
|
||||
ulong newRegionHandle = 0;
|
||||
LLVector3 pos = position;
|
||||
|
||||
@@ -1410,6 +1415,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
// Offset the positions for the new region across the border
|
||||
grp.OffsetForNewRegion(pos);
|
||||
|
||||
CrossPrimGroupIntoNewRegion(newRegionHandle, grp);
|
||||
|
||||
}
|
||||
public void CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp)
|
||||
{
|
||||
int primcrossingXMLmethod = 0;
|
||||
if (newRegionHandle != 0)
|
||||
{
|
||||
bool successYN = false;
|
||||
|
||||
@@ -1077,7 +1077,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
if (m_rootPart.UUID == part.UUID)
|
||||
{
|
||||
part.SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags);
|
||||
if (m_rootPart.m_IsAttachment)
|
||||
{
|
||||
part.SendFullUpdateToClient(remoteClient, m_rootPart.m_attachedPos, clientFlags);
|
||||
}
|
||||
else
|
||||
{
|
||||
part.SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1094,7 +1101,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
if (m_rootPart.UUID == part.UUID)
|
||||
{
|
||||
part.SendTerseUpdateToClient(remoteClient, AbsolutePosition);
|
||||
if (m_rootPart.m_IsAttachment)
|
||||
{
|
||||
part.SendTerseUpdateToClient(remoteClient, m_rootPart.m_attachedPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
part.SendTerseUpdateToClient(remoteClient, AbsolutePosition);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2143,6 +2157,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
|
||||
{
|
||||
if (m_rootPart.m_IsAttachment)
|
||||
{
|
||||
m_rootPart.m_attachedPos = pos;
|
||||
}
|
||||
|
||||
AbsolutePosition = pos;
|
||||
}
|
||||
//we need to do a terse update even if the move wasn't allowed
|
||||
|
||||
@@ -103,6 +103,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
[XmlIgnore] public bool m_IsAttachment = false;
|
||||
[XmlIgnore] public uint m_attachmentPoint = (byte)0;
|
||||
[XmlIgnore] public LLUUID m_attachedAvatar = LLUUID.Zero;
|
||||
[XmlIgnore] public LLVector3 m_attachedPos = LLVector3.Zero;
|
||||
|
||||
public Int32 CreationDate;
|
||||
public uint ParentID = 0;
|
||||
@@ -276,6 +277,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
m_groupPosition.Y = PhysActor.Position.Y;
|
||||
m_groupPosition.Z = PhysActor.Position.Z;
|
||||
}
|
||||
if (m_IsAttachment)
|
||||
{
|
||||
ScenePresence sp = m_parentGroup.Scene.GetScenePresence(m_attachedAvatar);
|
||||
if (sp != null)
|
||||
{
|
||||
return sp.AbsolutePosition;
|
||||
}
|
||||
}
|
||||
|
||||
return m_groupPosition;
|
||||
}
|
||||
set
|
||||
@@ -340,7 +350,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
public LLVector3 AbsolutePosition
|
||||
{
|
||||
get { return m_offsetPosition + m_groupPosition; }
|
||||
get {
|
||||
if (m_IsAttachment)
|
||||
return GroupPosition;
|
||||
|
||||
return m_offsetPosition + m_groupPosition; }
|
||||
}
|
||||
|
||||
protected LLQuaternion m_rotationOffset;
|
||||
|
||||
Reference in New Issue
Block a user