mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
Merge branch 'master' into bulletsim
This commit is contained in:
@@ -122,7 +122,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart sop = (SceneObjectPart)entity;
|
||||
if (sop.ParentGroup.RootPart.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||
if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart sop = (SceneObjectPart)entity;
|
||||
if (sop.ParentGroup.RootPart.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||
if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart sop = (SceneObjectPart)entity;
|
||||
if (sop.ParentGroup.RootPart.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||
if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
// Attachments are high priority,
|
||||
if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
|
||||
if (((SceneObjectPart)entity).ParentGroup.IsAttachment)
|
||||
return 1;
|
||||
|
||||
// Non physical prims are lower priority than physical prims
|
||||
|
||||
@@ -223,6 +223,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Retrieve group
|
||||
SceneObjectPart part = GetSceneObjectPart(primId);
|
||||
if (part == null)
|
||||
return new ArrayList();
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
if (null == group)
|
||||
{
|
||||
@@ -967,6 +969,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
if (part == null)
|
||||
return;
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
if (group != null)
|
||||
{
|
||||
@@ -2028,6 +2032,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
foreach (uint localID in localIDs)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
if (part == null)
|
||||
continue;
|
||||
if (!groups.Contains(part.ParentGroup))
|
||||
groups.Add(part.ParentGroup);
|
||||
}
|
||||
@@ -2073,6 +2079,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
foreach (uint localID in localIDs)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
if (part == null)
|
||||
continue;
|
||||
part.GetProperties(remoteClient);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4223,7 +4223,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// their scripts will actually run.
|
||||
// -- Leaf, Tue Aug 12 14:17:05 EDT 2008
|
||||
SceneObjectPart parent = part.ParentGroup.RootPart;
|
||||
if (parent != null && parent.IsAttachment)
|
||||
if (parent != null && part.ParentGroup.IsAttachment)
|
||||
return ScriptDanger(parent, parent.GetWorldPosition());
|
||||
else
|
||||
return ScriptDanger(part, part.GetWorldPosition());
|
||||
@@ -5030,7 +5030,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
delete = true;
|
||||
}
|
||||
|
||||
if (delete && !rootPart.IsAttachment && !deletes.Contains(g))
|
||||
if (delete && !g.IsAttachment && !deletes.Contains(g))
|
||||
deletes.Add(g);
|
||||
});
|
||||
break;
|
||||
|
||||
@@ -1546,8 +1546,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
|
||||
part.ClickAction = Convert.ToByte(clickAction);
|
||||
group.HasGroupChanged = true;
|
||||
if (part != null)
|
||||
{
|
||||
part.ClickAction = Convert.ToByte(clickAction);
|
||||
group.HasGroupChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1560,8 +1563,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId))
|
||||
{
|
||||
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID);
|
||||
part.Material = Convert.ToByte(material);
|
||||
group.HasGroupChanged = true;
|
||||
if (part != null)
|
||||
{
|
||||
part.Material = Convert.ToByte(material);
|
||||
group.HasGroupChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,27 +146,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Is this scene object acting as an attachment?
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// We return false if the group has already been deleted.
|
||||
///
|
||||
/// TODO: At the moment set must be done on the part itself. There may be a case for doing it here since I
|
||||
/// presume either all or no parts in a linkset can be part of an attachment (in which
|
||||
/// case the value would get proprogated down into all the descendent parts).
|
||||
/// </remarks>
|
||||
public bool IsAttachment
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!IsDeleted)
|
||||
return m_rootPart.IsAttachment;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public bool IsAttachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The avatar to which this scene object is attached.
|
||||
@@ -176,6 +160,31 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </remarks>
|
||||
public UUID AttachedAvatar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Attachment point of this scene object to an avatar.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 0 if we're not attached to anything
|
||||
/// </remarks>
|
||||
public uint AttachmentPoint
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_rootPart.Shape.State;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
IsAttachment = value != 0;
|
||||
m_rootPart.Shape.State = (byte)value;
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearPartAttachmentData()
|
||||
{
|
||||
AttachmentPoint = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is this scene object phantom?
|
||||
/// </summary>
|
||||
@@ -354,11 +363,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary>
|
||||
/// Check both the attachment property and the relevant properties of the underlying root part.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is necessary in some cases, particularly when a scene object has just crossed into a region and doesn't
|
||||
/// have the IsAttachment property yet checked.
|
||||
///
|
||||
/// FIXME: However, this should be fixed so that this property
|
||||
/// propertly reflects the underlying status.
|
||||
/// </remarks>
|
||||
/// <returns></returns>
|
||||
public bool IsAttachmentCheckFull()
|
||||
{
|
||||
@@ -982,23 +993,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public byte GetAttachmentPoint()
|
||||
{
|
||||
return m_rootPart.Shape.State;
|
||||
}
|
||||
|
||||
public void SetAttachmentPoint(byte point)
|
||||
{
|
||||
SceneObjectPart[] parts = m_parts.GetArray();
|
||||
for (int i = 0; i < parts.Length; i++)
|
||||
parts[i].SetAttachmentPoint(point);
|
||||
}
|
||||
|
||||
public void ClearPartAttachmentData()
|
||||
{
|
||||
SetAttachmentPoint((Byte)0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -1424,16 +1418,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// This is only necessary when userExposed is false!
|
||||
|
||||
bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
|
||||
bool previousAttachmentStatus = dupe.IsAttachment;
|
||||
|
||||
if (!userExposed)
|
||||
dupe.RootPart.IsAttachment = true;
|
||||
dupe.IsAttachment = true;
|
||||
|
||||
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
||||
|
||||
if (!userExposed)
|
||||
{
|
||||
dupe.RootPart.IsAttachment = previousAttachmentStatus;
|
||||
dupe.IsAttachment = previousAttachmentStatus;
|
||||
}
|
||||
|
||||
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
|
||||
|
||||
@@ -213,10 +213,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
get { return m_fromUserInventoryItemID; }
|
||||
}
|
||||
|
||||
|
||||
public bool IsAttachment;
|
||||
|
||||
|
||||
public scriptEvents AggregateScriptEvents;
|
||||
|
||||
@@ -224,9 +221,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public Vector3 AttachedPos;
|
||||
|
||||
|
||||
public uint AttachmentPoint;
|
||||
|
||||
|
||||
public Vector3 RotationAxis = Vector3.One;
|
||||
|
||||
|
||||
@@ -723,7 +717,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_groupPosition = actor.Position;
|
||||
}
|
||||
|
||||
if (IsAttachment)
|
||||
if (m_parentGroup.IsAttachment)
|
||||
{
|
||||
ScenePresence sp = m_parentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar);
|
||||
if (sp != null)
|
||||
@@ -807,7 +801,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (IsRoot)
|
||||
{
|
||||
if (IsAttachment)
|
||||
if (m_parentGroup.IsAttachment)
|
||||
return AttachedPos;
|
||||
else
|
||||
return AbsolutePosition;
|
||||
@@ -1090,7 +1084,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsAttachment)
|
||||
if (m_parentGroup.IsAttachment)
|
||||
return GroupPosition;
|
||||
|
||||
return m_offsetPosition + m_groupPosition;
|
||||
@@ -1588,7 +1582,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition
|
||||
// or flexible
|
||||
if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible))
|
||||
if (!isPhantom && !m_parentGroup.IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -2880,7 +2874,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void rotLookAt(Quaternion target, float strength, float damping)
|
||||
{
|
||||
if (IsAttachment)
|
||||
if (m_parentGroup.IsAttachment)
|
||||
{
|
||||
/*
|
||||
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
|
||||
@@ -3014,7 +3008,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (IsRoot)
|
||||
{
|
||||
if (IsAttachment)
|
||||
if (m_parentGroup.IsAttachment)
|
||||
{
|
||||
SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags);
|
||||
}
|
||||
@@ -3076,7 +3070,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
// Suppress full updates during attachment editing
|
||||
//
|
||||
if (ParentGroup.IsSelected && IsAttachment)
|
||||
if (ParentGroup.IsSelected && ParentGroup.IsAttachment)
|
||||
return;
|
||||
|
||||
if (ParentGroup.IsDeleted)
|
||||
@@ -3254,26 +3248,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
});
|
||||
}
|
||||
|
||||
public void SetAttachmentPoint(uint AttachmentPoint)
|
||||
{
|
||||
this.AttachmentPoint = AttachmentPoint;
|
||||
|
||||
if (AttachmentPoint != 0)
|
||||
{
|
||||
IsAttachment = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsAttachment = false;
|
||||
}
|
||||
|
||||
// save the attachment point.
|
||||
//if (AttachmentPoint != 0)
|
||||
//{
|
||||
m_shape.State = (byte)AttachmentPoint;
|
||||
//}
|
||||
}
|
||||
|
||||
public void SetAxisRotation(int axis, int rotate)
|
||||
{
|
||||
if (m_parentGroup != null)
|
||||
@@ -4497,7 +4471,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
if (SetPhantom || IsAttachment || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints
|
||||
if (SetPhantom
|
||||
|| ParentGroup.IsAttachment
|
||||
|| (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints
|
||||
{
|
||||
AddFlag(PrimFlags.Phantom);
|
||||
if (PhysActor != null)
|
||||
@@ -4928,7 +4904,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (ParentGroup == null || ParentGroup.IsDeleted)
|
||||
return;
|
||||
|
||||
if (IsAttachment && ParentGroup.RootPart != this)
|
||||
if (ParentGroup.IsAttachment && ParentGroup.RootPart != this)
|
||||
return;
|
||||
|
||||
// Causes this thread to dig into the Client Thread Data.
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Don't let this set the HasGroupChanged flag for attachments
|
||||
// as this happens during rez and we don't want a new asset
|
||||
// for each attachment each time
|
||||
if (!m_part.ParentGroup.RootPart.IsAttachment)
|
||||
if (!m_part.ParentGroup.IsAttachment)
|
||||
{
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
|
||||
@@ -965,6 +965,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
presence.Animator.SendAnimPackToClient(ControllingClient);
|
||||
});
|
||||
|
||||
// If we don't reset the movement flag here, an avatar that crosses to a neighbouring sim and returns will
|
||||
// stall on the border crossing since the existing child agent will still have the last movement
|
||||
// recorded, which stops the input from being processed.
|
||||
m_movementflag = 0;
|
||||
|
||||
m_scene.EventManager.TriggerOnMakeRootAgent(this);
|
||||
}
|
||||
|
||||
@@ -1247,6 +1252,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
|
||||
{
|
||||
// m_log.DebugFormat("[SCENE PRESENCE]: Received agent update from {0}", remoteClient.Name);
|
||||
|
||||
//if (m_isChildAgent)
|
||||
//{
|
||||
// // m_log.Debug("DEBUG: HandleAgentUpdate: child agent");
|
||||
@@ -1445,6 +1452,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_movementflag |= (byte)nudgehack;
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[SCENE PRESENCE]: Updating m_movementflag for {0} with {1}", Name, DCF);
|
||||
m_movementflag += (byte)(uint)DCF;
|
||||
update_movementflag = true;
|
||||
}
|
||||
@@ -1456,6 +1465,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
&& ((m_movementflag & (byte)nudgehack) == nudgehack))
|
||||
) // This or is for Nudge forward
|
||||
{
|
||||
// m_log.DebugFormat("[SCENE PRESENCE]: Updating m_movementflag for {0} with lack of {1}", Name, DCF);
|
||||
m_movementflag -= ((byte)(uint)DCF);
|
||||
update_movementflag = true;
|
||||
|
||||
@@ -1520,12 +1530,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// which occurs later in the main scene loop
|
||||
if (update_movementflag || (update_rotation && DCFlagKeyPressed))
|
||||
{
|
||||
// m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed));
|
||||
// m_log.DebugFormat(
|
||||
// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3);
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: In {0} adding velocity of {1} to {2}, umf = {3}, ur = {4}",
|
||||
// m_scene.RegionInfo.RegionName, agent_control_v3, Name, update_movementflag, update_rotation);
|
||||
|
||||
AddNewMovement(agent_control_v3);
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// if (!update_movementflag)
|
||||
// {
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: In {0} ignoring requested update of {1} for {2} as update_movementflag = false",
|
||||
// m_scene.RegionInfo.RegionName, agent_control_v3, Name);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (update_movementflag && m_parentID == 0)
|
||||
Animator.UpdateMovementAnimations();
|
||||
@@ -3178,7 +3197,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
ISceneObject clone = sog.CloneForNewScene();
|
||||
// Attachment module assumes that GroupPosition holds the offsets...!
|
||||
((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
|
||||
((SceneObjectGroup)clone).RootPart.IsAttachment = false;
|
||||
((SceneObjectGroup)clone).IsAttachment = false;
|
||||
cAgent.AttachmentObjects.Add(clone);
|
||||
string state = sog.GetStateSnapshot();
|
||||
cAgent.AttachmentObjectStates.Add(state);
|
||||
@@ -3477,7 +3496,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
foreach (SceneObjectGroup so in m_attachments)
|
||||
{
|
||||
if (attachmentPoint == so.RootPart.AttachmentPoint)
|
||||
if (attachmentPoint == so.AttachmentPoint)
|
||||
attachments.Add(so);
|
||||
}
|
||||
}
|
||||
@@ -3869,12 +3888,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (grp.HasGroupChanged) // Resizer scripts?
|
||||
{
|
||||
grp.RootPart.IsAttachment = false;
|
||||
grp.IsAttachment = false;
|
||||
grp.AbsolutePosition = grp.RootPart.AttachedPos;
|
||||
// grp.DetachToInventoryPrep();
|
||||
attachmentsModule.UpdateKnownItem(ControllingClient,
|
||||
grp, grp.GetFromItemID(), grp.OwnerID);
|
||||
grp.RootPart.IsAttachment = true;
|
||||
grp.IsAttachment = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,8 +120,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// We deal with the possibility that two updates occur at
|
||||
// the same unix time at the update point itself.
|
||||
|
||||
if ((update.LastFullUpdateTime < part.TimeStampFull) ||
|
||||
part.IsAttachment)
|
||||
if ((update.LastFullUpdateTime < part.TimeStampFull) || part.ParentGroup.IsAttachment)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
|
||||
|
||||
Reference in New Issue
Block a user