From 8428b25939d39711e732eeb3928e8a8e64aad8a9 Mon Sep 17 00:00:00 2001
From: KittoFlora
Date: Mon, 26 Oct 2009 00:10:23 +0100
Subject: Add llRotLookat pt1.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 39 ++++++++++++++++++++++
1 file changed, 39 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 69b3ded..fff807a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1727,6 +1727,45 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ public void rotLookAt(Quaternion target, float strength, float damping)
+ {
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
+ {
+ if (IsAttachment)
+ {
+ /*
+ ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
+ if (avatar != null)
+ {
+ Rotate the Av?
+ } */
+ }
+ else
+ {
+ if (rootpart.PhysActor != null)
+ {
+ rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W);
+ rootpart.PhysActor.APIDStrength = strength;
+ rootpart.PhysActor.APIDDamping = damping;
+ rootpart.PhysActor.APIDActive = true;
+ }
+ }
+ }
+ }
+ public void stopLookAt()
+ {
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
+ {
+ if (rootpart.PhysActor != null)
+ {
+ rootpart.PhysActor.APIDActive = false;
+ }
+ }
+
+ }
+
///
/// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds.
///
--
cgit v1.1
From aa695e92f7d3b56e6e3371be021d9e6acf91077c Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 27 Nov 2009 08:58:26 +0000
Subject: Reset update flag when a SOG is deleted. This fixes llDie();
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f36ff1d..26a843e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1199,6 +1199,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!silent)
{
+ part.UpdateFlag = 0;
if (part == m_rootPart)
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
}
--
cgit v1.1
From 9888f95068373f1bfdb289e85560a7d873d22696 Mon Sep 17 00:00:00 2001
From: CasperW
Date: Fri, 27 Nov 2009 18:29:03 +0100
Subject: Convert multiple lock()s which directly hinder script performance in
linksets to ReaderWriterLockSlim.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 400 ++++++++++++++-------
1 file changed, 277 insertions(+), 123 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 26a843e..fb34ddc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -98,6 +98,66 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_hasGroupChanged = false;
private long timeFirstChanged;
private long timeLastChanged;
+ private System.Threading.ReaderWriterLockSlim m_partsLock = new System.Threading.ReaderWriterLockSlim();
+
+ public void lockPartsForRead(bool locked)
+ {
+ if (locked)
+ {
+ if (m_partsLock.RecursiveReadCount > 0)
+ {
+ m_log.Error("[SceneObjectGroup.m_parts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
+ m_partsLock.ExitReadLock();
+ }
+ if (m_partsLock.RecursiveWriteCount > 0)
+ {
+ m_log.Error("[SceneObjectGroup.m_parts] Recursive read lock requested. This should not happen and means something needs to be fixed.");
+ m_partsLock.ExitWriteLock();
+ }
+
+ while (!m_partsLock.TryEnterReadLock(60000))
+ {
+ m_log.Error("[SceneObjectGroup.m_parts] Thread lock detected while trying to aquire READ lock of m_parts in SceneObjectGroup. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
+ if (m_partsLock.IsWriteLockHeld)
+ {
+ m_partsLock = new System.Threading.ReaderWriterLockSlim();
+ }
+ }
+ }
+ else
+ {
+ m_partsLock.ExitReadLock();
+ }
+ }
+ public void lockPartsForWrite(bool locked)
+ {
+ if (locked)
+ {
+ if (m_partsLock.RecursiveReadCount > 0)
+ {
+ m_log.Error("[SceneObjectGroup.m_parts] Recursive write lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
+ m_partsLock.ExitReadLock();
+ }
+ if (m_partsLock.RecursiveWriteCount > 0)
+ {
+ m_log.Error("[SceneObjectGroup.m_parts] Recursive write lock requested. This should not happen and means something needs to be fixed.");
+ m_partsLock.ExitWriteLock();
+ }
+
+ while (!m_partsLock.TryEnterWriteLock(60000))
+ {
+ m_log.Error("[SceneObjectGroup.m_parts] Thread lock detected while trying to aquire WRITE lock of m_scripts in XEngine. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
+ if (m_partsLock.IsWriteLockHeld)
+ {
+ m_partsLock = new System.Threading.ReaderWriterLockSlim();
+ }
+ }
+ }
+ else
+ {
+ m_partsLock.ExitWriteLock();
+ }
+ }
public bool HasGroupChanged
{
@@ -243,13 +303,16 @@ namespace OpenSim.Region.Framework.Scenes
set
{
m_regionHandle = value;
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
part.RegionHandle = m_regionHandle;
+
}
}
+ lockPartsForRead(false);
}
}
@@ -275,13 +338,16 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
}
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
part.GroupPosition = val;
+
}
}
+ lockPartsForRead(false);
//if (m_rootPart.PhysActor != null)
//{
@@ -432,13 +498,16 @@ namespace OpenSim.Region.Framework.Scenes
public void SetFromItemID(UUID AssetId)
{
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
part.FromItemID = AssetId;
+
}
}
+ lockPartsForRead(false);
}
public UUID GetFromItemID()
@@ -505,10 +574,11 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 maxScale = Vector3.Zero;
Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
Vector3 partscale = part.Scale;
Vector3 partoffset = part.OffsetPosition;
@@ -519,8 +589,11 @@ namespace OpenSim.Region.Framework.Scenes
maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X;
maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y;
maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z;
+
}
}
+ lockPartsForRead(false);
+
finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
@@ -536,10 +609,11 @@ namespace OpenSim.Region.Framework.Scenes
EntityIntersection result = new EntityIntersection();
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
// Temporary commented to stop compiler warning
//Vector3 partPosition =
// new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z);
@@ -567,8 +641,10 @@ namespace OpenSim.Region.Framework.Scenes
result.distance = inter.distance;
}
}
+
}
}
+ lockPartsForRead(false);
return result;
}
@@ -581,10 +657,11 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 GetAxisAlignedBoundingBox(out float offsetHeight)
{
float maxX = -256f, maxY = -256f, maxZ = -256f, minX = 256f, minY = 256f, minZ = 256f;
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
Vector3 worldPos = part.GetWorldPosition();
Vector3 offset = worldPos - AbsolutePosition;
Quaternion worldRot;
@@ -643,6 +720,8 @@ namespace OpenSim.Region.Framework.Scenes
backBottomRight.Y = orig.Y + (part.Scale.Y / 2);
backBottomRight.Z = orig.Z - (part.Scale.Z / 2);
+
+
//m_log.InfoFormat("pre corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z);
//m_log.InfoFormat("pre corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z);
//m_log.InfoFormat("pre corner 3 is {0} {1} {2}", frontBottomRight.X, frontBottomRight.Y, frontBottomRight.Z);
@@ -814,6 +893,7 @@ namespace OpenSim.Region.Framework.Scenes
minZ = backBottomLeft.Z;
}
}
+ lockPartsForRead(false);
Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ);
@@ -842,17 +922,20 @@ namespace OpenSim.Region.Framework.Scenes
Dictionary states = new Dictionary();
// Capture script state while holding the lock
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
Dictionary pstates = part.Inventory.GetScriptStates();
foreach (UUID itemid in pstates.Keys)
{
states.Add(itemid, pstates[itemid]);
}
+
}
}
+ lockPartsForRead(false);
if (states.Count > 0)
{
@@ -1014,13 +1097,16 @@ namespace OpenSim.Region.Framework.Scenes
public override void UpdateMovement()
{
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
part.UpdateMovement();
+
}
}
+ lockPartsForRead(false);
}
public ushort GetTimeDilation()
@@ -1064,7 +1150,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void AddPart(SceneObjectPart part)
{
- lock (m_parts)
+ lockPartsForWrite(true);
{
part.SetParent(this);
m_parts.Add(part.UUID, part);
@@ -1074,6 +1160,7 @@ namespace OpenSim.Region.Framework.Scenes
if (part.LinkNum == 2 && RootPart != null)
RootPart.LinkNum = 1;
}
+ lockPartsForWrite(false);
}
///
@@ -1081,28 +1168,33 @@ namespace OpenSim.Region.Framework.Scenes
///
private void UpdateParentIDs()
{
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
if (part.UUID != m_rootPart.UUID)
{
part.ParentID = m_rootPart.LocalId;
}
+
}
}
+ lockPartsForRead(false);
}
public void RegenerateFullIDs()
{
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
part.UUID = UUID.Random();
-
+
}
}
+ lockPartsForRead(false);
}
// helper provided for parts.
@@ -1183,29 +1275,33 @@ namespace OpenSim.Region.Framework.Scenes
DetachFromBackup();
- lock (m_parts)
+ lockPartsForRead(true);
+ List values = new List(m_parts.Values);
+ lockPartsForRead(false);
+
+ foreach (SceneObjectPart part in values)
{
- foreach (SceneObjectPart part in m_parts.Values)
- {
// part.Inventory.RemoveScriptInstances();
-
- ScenePresence[] avatars = Scene.GetScenePresences();
- for (int i = 0; i < avatars.Length; i++)
+
+ ScenePresence[] avatars = Scene.GetScenePresences();
+ for (int i = 0; i < avatars.Length; i++)
+ {
+ if (avatars[i].ParentID == LocalId)
{
- if (avatars[i].ParentID == LocalId)
- {
- avatars[i].StandUp();
- }
+ avatars[i].StandUp();
+ }
- if (!silent)
- {
- part.UpdateFlag = 0;
- if (part == m_rootPart)
- avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
- }
+ if (!silent)
+ {
+ part.UpdateFlag = 0;
+ if (part == m_rootPart)
+ avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
}
}
+
}
+
+
}
public void AddScriptLPS(int count)
@@ -1230,17 +1326,20 @@ namespace OpenSim.Region.Framework.Scenes
scriptEvents aggregateScriptEvents=0;
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
if (part == null)
continue;
if (part != RootPart)
part.ObjectFlags = objectflagupdate;
aggregateScriptEvents |= part.AggregateScriptEvents;
+
}
}
+ lockPartsForRead(false);
m_scriptListens_atTarget = ((aggregateScriptEvents & scriptEvents.at_target) != 0);
m_scriptListens_notAtTarget = ((aggregateScriptEvents & scriptEvents.not_at_target) != 0);
@@ -1273,42 +1372,52 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ApplyPhysics(bool m_physicalPrim)
{
- lock (m_parts)
+ lockPartsForRead(true);
+
+ if (m_parts.Count > 1)
{
- if (m_parts.Count > 1)
+ List values = new List(m_parts.Values);
+ lockPartsForRead(false);
+ m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
+ foreach (SceneObjectPart part in values)
{
- m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
- foreach (SceneObjectPart part in m_parts.Values)
+
+ if (part.LocalId != m_rootPart.LocalId)
{
- if (part.LocalId != m_rootPart.LocalId)
- {
- part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim);
- }
+ part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim);
}
- // Hack to get the physics scene geometries in the right spot
- ResetChildPrimPhysicsPositions();
- }
- else
- {
- m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
}
+ // Hack to get the physics scene geometries in the right spot
+ ResetChildPrimPhysicsPositions();
+ }
+ else
+ {
+ lockPartsForRead(false);
+ m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
}
}
public void SetOwnerId(UUID userId)
{
- ForEachPart(delegate(SceneObjectPart part) { part.OwnerID = userId; });
+ ForEachPart(delegate(SceneObjectPart part)
+ {
+
+ part.OwnerID = userId;
+
+ });
}
public void ForEachPart(Action whatToDo)
{
- lock (m_parts)
+ lockPartsForRead(true);
+ List values = new List(m_parts.Values);
+ lockPartsForRead(false);
+ foreach (SceneObjectPart part in values)
{
- foreach (SceneObjectPart part in m_parts.Values)
- {
- whatToDo(part);
- }
+
+ whatToDo(part);
+
}
}
@@ -1407,14 +1516,17 @@ namespace OpenSim.Region.Framework.Scenes
{
SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
if (part != RootPart)
SendPartFullUpdate(remoteClient, part, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID));
+
}
}
+ lockPartsForRead(false);
}
///
@@ -1509,10 +1621,11 @@ namespace OpenSim.Region.Framework.Scenes
List partList;
- lock (m_parts)
- {
- partList = new List(m_parts.Values);
- }
+ lockPartsForRead(true);
+
+ partList = new List(m_parts.Values);
+
+ lockPartsForRead(false);
partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
{
@@ -1835,10 +1948,11 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
newPart.SetParent(this);
- lock (m_parts)
+ lockPartsForWrite(true);
{
m_parts.Add(newPart.UUID, newPart);
}
+ lockPartsForWrite(false);
SetPartAsNonRoot(newPart);
@@ -1901,7 +2015,7 @@ namespace OpenSim.Region.Framework.Scenes
//if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
// return;
- lock (m_parts)
+ lockPartsForRead(true);
{
bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
@@ -1919,34 +2033,43 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectPart part in m_parts.Values)
{
+
part.SendScheduledUpdates();
+
}
}
+ lockPartsForRead(false);
}
public void ScheduleFullUpdateToAvatar(ScenePresence presence)
{
RootPart.AddFullUpdateToAvatar(presence);
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
if (part != RootPart)
part.AddFullUpdateToAvatar(presence);
+
}
}
+ lockPartsForRead(false);
}
public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
{
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
part.AddTerseUpdateToAvatar(presence);
+
}
}
+ lockPartsForRead(false);
}
///
@@ -1957,14 +2080,17 @@ namespace OpenSim.Region.Framework.Scenes
checkAtTargets();
RootPart.ScheduleFullUpdate();
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
if (part != RootPart)
part.ScheduleFullUpdate();
+
}
}
+ lockPartsForRead(false);
}
///
@@ -1972,13 +2098,16 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ScheduleGroupForTerseUpdate()
{
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
part.ScheduleTerseUpdate();
+
}
}
+ lockPartsForRead(false);
}
///
@@ -1991,14 +2120,17 @@ namespace OpenSim.Region.Framework.Scenes
RootPart.SendFullUpdateToAllClients();
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
+
if (part != RootPart)
part.SendFullUpdateToAllClients();
+
}
}
+ lockPartsForRead(false);
}
///
@@ -2029,14 +2161,15 @@ namespace OpenSim.Region.Framework.Scenes
{
if (IsDeleted)
return;
-
- lock (m_parts)
+
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
part.SendTerseUpdateToAllClients();
}
}
+ lockPartsForRead(false);
}
#endregion
@@ -2050,16 +2183,18 @@ namespace OpenSim.Region.Framework.Scenes
/// null if no child part with that linknum or child part
public SceneObjectPart GetLinkNumPart(int linknum)
{
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
if (part.LinkNum == linknum)
{
+ lockPartsForRead(false);
return part;
}
}
}
+ lockPartsForRead(false);
return null;
}
@@ -2087,17 +2222,19 @@ namespace OpenSim.Region.Framework.Scenes
public SceneObjectPart GetChildPart(uint localID)
{
//m_log.DebugFormat("Entered looking for {0}", localID);
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
//m_log.DebugFormat("Found {0}", part.LocalId);
if (part.LocalId == localID)
{
+ lockPartsForRead(false);
return part;
}
}
}
+ lockPartsForRead(false);
return null;
}
@@ -2127,17 +2264,19 @@ namespace OpenSim.Region.Framework.Scenes
public bool HasChildPrim(uint localID)
{
//m_log.DebugFormat("Entered HasChildPrim looking for {0}", localID);
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
//m_log.DebugFormat("Found {0}", part.LocalId);
if (part.LocalId == localID)
{
+ lockPartsForRead(false);
return true;
}
}
}
+ lockPartsForRead(false);
return false;
}
@@ -2187,53 +2326,57 @@ namespace OpenSim.Region.Framework.Scenes
if (m_rootPart.LinkNum == 0)
m_rootPart.LinkNum = 1;
- lock (m_parts)
- {
- m_parts.Add(linkPart.UUID, linkPart);
+ lockPartsForWrite(true);
+
+ m_parts.Add(linkPart.UUID, linkPart);
+
+ lockPartsForWrite(false);
- // Insert in terms of link numbers, the new links
- // before the current ones (with the exception of
- // the root prim. Shuffle the old ones up
- foreach (KeyValuePair kvp in m_parts)
+ // Insert in terms of link numbers, the new links
+ // before the current ones (with the exception of
+ // the root prim. Shuffle the old ones up
+ lockPartsForRead(true);
+ foreach (KeyValuePair kvp in m_parts)
+ {
+ if (kvp.Value.LinkNum != 1)
{
- if (kvp.Value.LinkNum != 1)
- {
- // Don't update root prim link number
- kvp.Value.LinkNum += objectGroup.PrimCount;
- }
+ // Don't update root prim link number
+ kvp.Value.LinkNum += objectGroup.PrimCount;
}
+ }
+ lockPartsForRead(false);
- linkPart.LinkNum = 2;
+ linkPart.LinkNum = 2;
- linkPart.SetParent(this);
- linkPart.AddFlag(PrimFlags.CreateSelected);
+ linkPart.SetParent(this);
+ linkPart.AddFlag(PrimFlags.CreateSelected);
- //if (linkPart.PhysActor != null)
- //{
- // m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
-
- //linkPart.PhysActor = null;
- //}
+ //if (linkPart.PhysActor != null)
+ //{
+ // m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
+
+ //linkPart.PhysActor = null;
+ //}
- //TODO: rest of parts
- int linkNum = 3;
- foreach (SceneObjectPart part in objectGroup.Children.Values)
+ //TODO: rest of parts
+ int linkNum = 3;
+ foreach (SceneObjectPart part in objectGroup.Children.Values)
+ {
+ if (part.UUID != objectGroup.m_rootPart.UUID)
{
- if (part.UUID != objectGroup.m_rootPart.UUID)
- {
- LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
- }
- part.ClearUndoState();
+ LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
}
+ part.ClearUndoState();
}
m_scene.UnlinkSceneObject(objectGroup.UUID, true);
objectGroup.m_isDeleted = true;
+
+ objectGroup.lockPartsForWrite(true);
- lock (objectGroup.m_parts)
- {
- objectGroup.m_parts.Clear();
- }
+ objectGroup.m_parts.Clear();
+
+ objectGroup.lockPartsForWrite(false);
// Can't do this yet since backup still makes use of the root part without any synchronization
// objectGroup.m_rootPart = null;
@@ -2292,11 +2435,12 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion worldRot = linkPart.GetWorldRotation();
// Remove the part from this object
- lock (m_parts)
+ lockPartsForWrite(true);
{
m_parts.Remove(linkPart.UUID);
}
-
+ lockPartsForWrite(false);
+ lockPartsForRead(true);
if (m_parts.Count == 1 && RootPart != null) //Single prim is left
RootPart.LinkNum = 0;
else
@@ -2307,6 +2451,7 @@ namespace OpenSim.Region.Framework.Scenes
p.LinkNum--;
}
}
+ lockPartsForRead(false);
linkPart.ParentID = 0;
linkPart.LinkNum = 0;
@@ -2624,22 +2769,23 @@ namespace OpenSim.Region.Framework.Scenes
if (selectionPart != null)
{
- lock (m_parts)
+ lockPartsForRead(true);
+ List parts = new List(m_parts.Values);
+ lockPartsForRead(false);
+ foreach (SceneObjectPart part in parts)
{
- foreach (SceneObjectPart part in m_parts.Values)
+ if (part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0)
{
- if (part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0)
- {
- UsePhysics = false; // Reset physics
- break;
- }
+ UsePhysics = false; // Reset physics
+ break;
}
+ }
- foreach (SceneObjectPart part in m_parts.Values)
- {
- part.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
- }
+ foreach (SceneObjectPart part in parts)
+ {
+ part.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
}
+
}
}
@@ -2863,7 +3009,7 @@ namespace OpenSim.Region.Framework.Scenes
prevScale.Z *= z;
part.Resize(prevScale);
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart obPart in m_parts.Values)
{
@@ -2882,6 +3028,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
+ lockPartsForRead(false);
if (part.PhysActor != null)
{
@@ -2962,7 +3109,7 @@ namespace OpenSim.Region.Framework.Scenes
axDiff *= Quaternion.Inverse(partRotation);
diff = axDiff;
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart obPart in m_parts.Values)
{
@@ -2972,6 +3119,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
+ lockPartsForRead(false);
AbsolutePosition = newPos;
@@ -3089,7 +3237,7 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
}
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart prim in m_parts.Values)
{
@@ -3107,6 +3255,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
+ lockPartsForRead(false);
m_rootPart.ScheduleTerseUpdate();
}
@@ -3205,7 +3354,7 @@ namespace OpenSim.Region.Framework.Scenes
if (atTargets.Count > 0)
{
uint[] localids = new uint[0];
- lock (m_parts)
+ lockPartsForRead(true);
{
localids = new uint[m_parts.Count];
int cntr = 0;
@@ -3215,6 +3364,7 @@ namespace OpenSim.Region.Framework.Scenes
cntr++;
}
}
+ lockPartsForRead(false);
for (int ctr = 0; ctr < localids.Length; ctr++)
{
@@ -3233,7 +3383,7 @@ namespace OpenSim.Region.Framework.Scenes
{
//trigger not_at_target
uint[] localids = new uint[0];
- lock (m_parts)
+ lockPartsForRead(true);
{
localids = new uint[m_parts.Count];
int cntr = 0;
@@ -3243,7 +3393,8 @@ namespace OpenSim.Region.Framework.Scenes
cntr++;
}
}
-
+ lockPartsForRead(false);
+
for (int ctr = 0; ctr < localids.Length; ctr++)
{
m_scene.EventManager.TriggerNotAtTargetEvent(localids[ctr]);
@@ -3256,19 +3407,20 @@ namespace OpenSim.Region.Framework.Scenes
public float GetMass()
{
float retmass = 0f;
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
retmass += part.GetMass();
}
}
+ lockPartsForRead(false);
return retmass;
}
public void CheckSculptAndLoad()
{
- lock (m_parts)
+ lockPartsForRead(true);
{
if (!IsDeleted)
{
@@ -3293,6 +3445,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
+ lockPartsForRead(false);
}
protected void AssetReceived(string id, Object sender, AssetBase asset)
@@ -3313,7 +3466,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void SetGroup(UUID GroupID, IClientAPI client)
{
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
{
@@ -3323,7 +3476,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
}
-
+ lockPartsForRead(false);
ScheduleGroupForFullUpdate();
}
@@ -3342,11 +3495,12 @@ namespace OpenSim.Region.Framework.Scenes
public void SetAttachmentPoint(byte point)
{
- lock (m_parts)
+ lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
part.SetAttachmentPoint(point);
}
+ lockPartsForRead(false);
}
#region ISceneObject
--
cgit v1.1
From 2e6dce434f1fd20664a60e464e589798287dcfe3 Mon Sep 17 00:00:00 2001
From: CasperW
Date: Mon, 30 Nov 2009 21:52:55 +0100
Subject: Enforce physical prim max size on single prims. Also convert a lock()
to ReaderWriterLockSlim that i missed in the last commit
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 119 ++++++++++-----------
1 file changed, 58 insertions(+), 61 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index fb34ddc..42481ff 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2871,11 +2871,9 @@ namespace OpenSim.Region.Framework.Scenes
scale.Y = m_scene.m_maxNonphys;
if (scale.Z > m_scene.m_maxNonphys)
scale.Z = m_scene.m_maxNonphys;
-
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
- part.Resize(scale);
if (part.PhysActor != null)
{
if (part.PhysActor.IsPhysical)
@@ -2890,7 +2888,7 @@ namespace OpenSim.Region.Framework.Scenes
part.PhysActor.Size = scale;
m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
}
- //if (part.UUID != m_rootPart.UUID)
+ part.Resize(scale);
HasGroupChanged = true;
ScheduleGroupForFullUpdate();
@@ -2931,77 +2929,76 @@ namespace OpenSim.Region.Framework.Scenes
float y = (scale.Y / part.Scale.Y);
float z = (scale.Z / part.Scale.Z);
- lock (m_parts)
+ lockPartsForRead(true);
+ if (x > 1.0f || y > 1.0f || z > 1.0f)
{
- if (x > 1.0f || y > 1.0f || z > 1.0f)
+ foreach (SceneObjectPart obPart in m_parts.Values)
{
- foreach (SceneObjectPart obPart in m_parts.Values)
+ if (obPart.UUID != m_rootPart.UUID)
{
- if (obPart.UUID != m_rootPart.UUID)
- {
- Vector3 oldSize = new Vector3(obPart.Scale);
+ Vector3 oldSize = new Vector3(obPart.Scale);
- float f = 1.0f;
- float a = 1.0f;
+ float f = 1.0f;
+ float a = 1.0f;
- if (part.PhysActor != null && part.PhysActor.IsPhysical)
+ if (part.PhysActor != null && part.PhysActor.IsPhysical)
+ {
+ if (oldSize.X*x > m_scene.m_maxPhys)
{
- if (oldSize.X*x > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.X;
- a = f / x;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Y*y > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.Y;
- a = f / y;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Z*z > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.Z;
- a = f / z;
- x *= a;
- y *= a;
- z *= a;
- }
+ f = m_scene.m_maxPhys / oldSize.X;
+ a = f / x;
+ x *= a;
+ y *= a;
+ z *= a;
}
- else
+ if (oldSize.Y*y > m_scene.m_maxPhys)
+ {
+ f = m_scene.m_maxPhys / oldSize.Y;
+ a = f / y;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+ if (oldSize.Z*z > m_scene.m_maxPhys)
+ {
+ f = m_scene.m_maxPhys / oldSize.Z;
+ a = f / z;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+ }
+ else
+ {
+ if (oldSize.X*x > m_scene.m_maxNonphys)
{
- if (oldSize.X*x > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.X;
- a = f / x;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Y*y > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.Y;
- a = f / y;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Z*z > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.Z;
- a = f / z;
- x *= a;
- y *= a;
- z *= a;
- }
+ f = m_scene.m_maxNonphys / oldSize.X;
+ a = f / x;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+ if (oldSize.Y*y > m_scene.m_maxNonphys)
+ {
+ f = m_scene.m_maxNonphys / oldSize.Y;
+ a = f / y;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+ if (oldSize.Z*z > m_scene.m_maxNonphys)
+ {
+ f = m_scene.m_maxNonphys / oldSize.Z;
+ a = f / z;
+ x *= a;
+ y *= a;
+ z *= a;
}
}
}
}
}
+ lockPartsForRead(false);
Vector3 prevScale = part.Scale;
prevScale.X *= x;
--
cgit v1.1
From ceccfe02d0e25c234560b6ef25306b8db4cd9875 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 6 Dec 2009 00:02:24 +0000
Subject: Eliminate multiple updates on link/unlink
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ecda80c..fa2e3ce 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2389,8 +2389,8 @@ namespace OpenSim.Region.Framework.Scenes
// unmoved prims!
ResetChildPrimPhysicsPositions();
- HasGroupChanged = true;
- ScheduleGroupForFullUpdate();
+ //HasGroupChanged = true;
+ //ScheduleGroupForFullUpdate();
}
///
@@ -2483,8 +2483,8 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.Rezzed = RootPart.Rezzed;
- HasGroupChanged = true;
- ScheduleGroupForFullUpdate();
+ //HasGroupChanged = true;
+ //ScheduleGroupForFullUpdate();
}
///
--
cgit v1.1
From f2891e77383f70d807f4ef1ceefbf9a0f2bf6a84 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 6 Dec 2009 00:50:28 +0000
Subject: Remove extra forced updates. They're not needed for each prim.
Really.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index fa2e3ce..93888f1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2292,14 +2292,14 @@ namespace OpenSim.Region.Framework.Scenes
public void LinkToGroup(SceneObjectGroup objectGroup)
{
// Make sure we have sent any pending unlinks or stuff.
- if (objectGroup.RootPart.UpdateFlag > 0)
- {
- m_log.WarnFormat(
- "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.",
- objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
+ //if (objectGroup.RootPart.UpdateFlag > 0)
+ //{
+ // m_log.WarnFormat(
+ // "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.",
+ // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
- objectGroup.RootPart.SendScheduledUpdates();
- }
+ // objectGroup.RootPart.SendScheduledUpdates();
+ //}
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
--
cgit v1.1
From 172e2f4e7609c278d02ad83ca207fd79624db587 Mon Sep 17 00:00:00 2001
From: CasperW
Date: Sun, 6 Dec 2009 17:23:07 +0100
Subject: Fix to existing ReaderWriterLockSlim implementations
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 93888f1..eacd219 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -126,7 +126,10 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
- m_partsLock.ExitReadLock();
+ if (m_partsLock.RecursiveReadCount > 0)
+ {
+ m_partsLock.ExitReadLock();
+ }
}
}
public void lockPartsForWrite(bool locked)
@@ -155,7 +158,10 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
- m_partsLock.ExitWriteLock();
+ if (m_partsLock.RecursiveWriteCount > 0)
+ {
+ m_partsLock.ExitWriteLock();
+ }
}
}
--
cgit v1.1
From 5caae0293ab0f69cced21923c36db230698c7970 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 3 Mar 2010 22:14:06 +0000
Subject: Fix bug where approximately half the time, attachments would rez only
their root prim until right clicked (or otherwise updated). The root cause of
this problem was that multiple ObjectUpdates were being sent on attachment
which differed enough to confuse the client. Sometimes these would eliminate
each other and sometimes not, depending on whether the scheduler looked at
the queued updates. The solution here is to only schedule the ObjectUpdate
once the attachment code has done all it needs to do.
Backport from head.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 35 +++++++++++++++++-----
1 file changed, 28 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c5a6171..c14b39a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -567,8 +567,10 @@ namespace OpenSim.Region.Framework.Scenes
}
ApplyPhysics(m_scene.m_physicalPrim);
-
- ScheduleGroupForFullUpdate();
+
+ // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
+ // for the same object with very different properties. The caller must schedule the update.
+ //ScheduleGroupForFullUpdate();
}
public Vector3 GroupScale()
@@ -956,10 +958,11 @@ namespace OpenSim.Region.Framework.Scenes
// don't attach attachments to child agents
if (avatar.IsChildAgent) return;
+// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
+
DetachFromBackup();
// Remove from database and parcel prim count
- //
m_scene.DeleteFromStorage(UUID);
m_scene.EventManager.TriggerParcelPrimCountTainted();
@@ -985,7 +988,6 @@ namespace OpenSim.Region.Framework.Scenes
SetAttachmentPoint(Convert.ToByte(attachmentpoint));
avatar.AddAttachment(this);
- m_log.Debug("[SOG]: Added attachment " + UUID + " to avatar " + avatar.UUID);
if (!silent)
{
@@ -1002,6 +1004,12 @@ namespace OpenSim.Region.Framework.Scenes
ScheduleGroupForFullUpdate();
}
}
+ else
+ {
+ m_log.WarnFormat(
+ "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present",
+ UUID, agentID, Scene.RegionInfo.RegionName);
+ }
}
public byte GetAttachmentPoint()
@@ -1986,6 +1994,8 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleFullUpdateToAvatar(ScenePresence presence)
{
+// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
+
RootPart.AddFullUpdateToAvatar(presence);
lock (m_parts)
@@ -2000,6 +2010,8 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
{
+// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
+
lock (m_parts)
{
foreach (SceneObjectPart part in m_parts.Values)
@@ -2014,6 +2026,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ScheduleGroupForFullUpdate()
{
+// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID);
+
checkAtTargets();
RootPart.ScheduleFullUpdate();
@@ -2032,6 +2046,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ScheduleGroupForTerseUpdate()
{
+// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
+
lock (m_parts)
{
foreach (SceneObjectPart part in m_parts.Values)
@@ -2045,9 +2061,11 @@ namespace OpenSim.Region.Framework.Scenes
/// Immediately send a full update for this scene object.
///
public void SendGroupFullUpdate()
- {
+ {
if (IsDeleted)
return;
+
+// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
RootPart.SendFullUpdateToAllClients();
@@ -2064,7 +2082,7 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Immediately send an update for this scene object's root prim only.
/// This is for updates regarding the object as a whole, and none of its parts in particular.
- /// Note: this may not be cused by opensim (it probably should) but it's used by
+ /// Note: this may not be used by opensim (it probably should) but it's used by
/// external modules.
///
public void SendGroupRootTerseUpdate()
@@ -2079,6 +2097,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_scene == null) // Need to check here as it's null during object creation
return;
+
m_scene.SceneGraph.AddToUpdateList(this);
}
@@ -3557,7 +3576,9 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
}
- ScheduleGroupForFullUpdate();
+ // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
+ // for the same object with very different properties. The caller must schedule the update.
+ //ScheduleGroupForFullUpdate();
}
public void TriggerScriptChangedEvent(Changed val)
--
cgit v1.1
From 819806261026cccd68dee649f11938ae5bf10029 Mon Sep 17 00:00:00 2001
From: Kitto Flora
Date: Sun, 14 Mar 2010 16:22:13 -0400
Subject: RotLookAt repaired; debug msg cleanup.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f35a7c5..5443c28 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1955,7 +1955,7 @@ namespace OpenSim.Region.Framework.Scenes
else
{
if (rootpart.PhysActor != null)
- {
+ { // APID must be implemented in your physics system for this to function.
rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W);
rootpart.PhysActor.APIDStrength = strength;
rootpart.PhysActor.APIDDamping = damping;
@@ -1971,7 +1971,7 @@ namespace OpenSim.Region.Framework.Scenes
if (rootpart != null)
{
if (rootpart.PhysActor != null)
- {
+ { // APID must be implemented in your physics system for this to function.
rootpart.PhysActor.APIDActive = false;
}
}
--
cgit v1.1
From 7d917e7c5c599549d2a87451fe3d6ca2bf6e62a4 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 30 Mar 2010 23:29:03 +0100
Subject: Rename Meta7Windlight to LightShare
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3895d93..7ed29a5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1370,21 +1370,20 @@ namespace OpenSim.Region.Framework.Scenes
{
// part.Inventory.RemoveScriptInstances();
- List avatars = Scene.GetScenePresences();
- for (int i = 0; i < avatars.Count; i++)
+ Scene.ForEachScenePresence(delegate (ScenePresence sp)
{
- if (avatars[i].ParentID == LocalId)
+ if (sp.ParentID == LocalId)
{
- avatars[i].StandUp();
+ sp.StandUp();
}
if (!silent)
{
part.UpdateFlag = 0;
if (part == m_rootPart)
- avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
+ sp.ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
}
- }
+ });
}
--
cgit v1.1
From 2fbbc13c71052e66269035031e894b736e2ead5d Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 5 Apr 2010 19:42:15 +0100
Subject: Fix some overlooked merge conflicts that got committed
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 ----------
1 file changed, 10 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5951a92..0785f7f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2203,13 +2203,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ScheduleGroupForTerseUpdate()
{
-<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
lockPartsForRead(true);
-=======
-// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
-
- lock (m_parts)
->>>>>>> 0.6.9-post-fixes:OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
{
foreach (SceneObjectPart part in m_parts.Values)
{
@@ -3765,15 +3759,11 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
}
-<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
lockPartsForRead(false);
- ScheduleGroupForFullUpdate();
-=======
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
// for the same object with very different properties. The caller must schedule the update.
//ScheduleGroupForFullUpdate();
->>>>>>> 0.6.9-post-fixes:OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
}
public void TriggerScriptChangedEvent(Changed val)
--
cgit v1.1
From 7a3bb266ebc057a1af589fc642bfeca08de72c98 Mon Sep 17 00:00:00 2001
From: Thomas Grimshaw
Date: Mon, 5 Apr 2010 22:11:05 +0200
Subject: This commit adds some randomness to object persistence. It's a Work
In Progress, I am working on improving this to a tiered approach.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 46 ++++++++++++++++++++--
1 file changed, 42 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5443c28..9a205e0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -104,8 +104,12 @@ namespace OpenSim.Region.Framework.Scenes
/// since the group's last persistent backup
///
private bool m_hasGroupChanged = false;
- private long timeFirstChanged;
- private long timeLastChanged;
+ private long timeFirstChanged = 0;
+ private long timeLastChanged = 0;
+ long m_maxPersistTime = 0;
+ long m_minPersistTime = 0;
+ Random m_rand;
+
private System.Threading.ReaderWriterLockSlim m_partsLock = new System.Threading.ReaderWriterLockSlim();
public void lockPartsForRead(bool locked)
@@ -182,6 +186,28 @@ namespace OpenSim.Region.Framework.Scenes
timeLastChanged = DateTime.Now.Ticks;
if (!m_hasGroupChanged)
timeFirstChanged = DateTime.Now.Ticks;
+ if (m_rand == null)
+ {
+ byte[] val = new byte[16];
+ m_rootPart.UUID.ToBytes(val, 0);
+ m_rand = new Random(BitConverter.ToInt32(val, 0));
+ }
+ if (Scene.GetRootAgentCount() == 0)
+ {
+ //If the region is empty, this change has been made by an automated process
+ //and thus we delay the persist time by a random amount between 1.5 and 2.5.
+
+ float factor = 1.5f + (float)(m_rand.NextDouble());
+ m_maxPersistTime = (long)((float)Scene.m_persistAfter * factor);
+ m_minPersistTime = (long)((float)Scene.m_dontPersistBefore * factor);
+ }
+ else
+ {
+ //If the region is not empty, we want to obey the minimum and maximum persist times
+ //but add a random factor so we stagger the object persistance a little
+ m_maxPersistTime = (long)((float)Scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
+ m_minPersistTime = (long)((float)Scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
+ }
}
m_hasGroupChanged = value;
}
@@ -197,8 +223,19 @@ namespace OpenSim.Region.Framework.Scenes
return false;
if (m_scene.ShuttingDown)
return true;
+
+ if (m_minPersistTime == 0 || m_maxPersistTime == 0)
+ {
+ m_maxPersistTime = m_scene.m_persistAfter;
+ m_minPersistTime = m_scene.m_dontPersistBefore;
+ }
+
long currentTime = DateTime.Now.Ticks;
- if (currentTime - timeLastChanged > m_scene.m_dontPersistBefore || currentTime - timeFirstChanged > m_scene.m_persistAfter)
+
+ if (timeLastChanged == 0) timeLastChanged = currentTime;
+ if (timeFirstChanged == 0) timeFirstChanged = currentTime;
+
+ if (currentTime - timeLastChanged > m_minPersistTime || currentTime - timeFirstChanged > m_maxPersistTime)
return true;
return false;
}
@@ -529,6 +566,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectGroup()
{
+
}
///
@@ -545,7 +583,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Constructor. This object is added to the scene later via AttachToScene()
///
public SceneObjectGroup(UUID ownerID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
- {
+ {
SetRootPart(new SceneObjectPart(ownerID, shape, pos, rot, Vector3.Zero));
}
--
cgit v1.1
From 2f454843d82ce0253af393817cf6f0ebb9046112 Mon Sep 17 00:00:00 2001
From: Thomas Grimshaw
Date: Mon, 5 Apr 2010 23:17:06 +0200
Subject: Fix up my own shoddy code! Fixes prim rez break. Whups!
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 48 ++++++++++++----------
1 file changed, 26 insertions(+), 22 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0277ed8..13d1d4e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -106,9 +106,9 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_hasGroupChanged = false;
private long timeFirstChanged = 0;
private long timeLastChanged = 0;
- long m_maxPersistTime = 0;
- long m_minPersistTime = 0;
- Random m_rand;
+ private long m_maxPersistTime = 0;
+ private long m_minPersistTime = 0;
+ private Random m_rand;
private System.Threading.ReaderWriterLockSlim m_partsLock = new System.Threading.ReaderWriterLockSlim();
@@ -186,27 +186,31 @@ namespace OpenSim.Region.Framework.Scenes
timeLastChanged = DateTime.Now.Ticks;
if (!m_hasGroupChanged)
timeFirstChanged = DateTime.Now.Ticks;
- if (m_rand == null)
+ if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null)
{
- byte[] val = new byte[16];
- m_rootPart.UUID.ToBytes(val, 0);
- m_rand = new Random(BitConverter.ToInt32(val, 0));
- }
- if (Scene.GetRootAgentCount() == 0)
- {
- //If the region is empty, this change has been made by an automated process
- //and thus we delay the persist time by a random amount between 1.5 and 2.5.
+ if (m_rand == null)
+ {
+ byte[] val = new byte[16];
+ m_rootPart.UUID.ToBytes(val, 0);
+ m_rand = new Random(BitConverter.ToInt32(val, 0));
+ }
+
+ if (m_scene.GetRootAgentCount() == 0)
+ {
+ //If the region is empty, this change has been made by an automated process
+ //and thus we delay the persist time by a random amount between 1.5 and 2.5.
- float factor = 1.5f + (float)(m_rand.NextDouble());
- m_maxPersistTime = (long)((float)Scene.m_persistAfter * factor);
- m_minPersistTime = (long)((float)Scene.m_dontPersistBefore * factor);
- }
- else
- {
- //If the region is not empty, we want to obey the minimum and maximum persist times
- //but add a random factor so we stagger the object persistance a little
- m_maxPersistTime = (long)((float)Scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
- m_minPersistTime = (long)((float)Scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
+ float factor = 1.5f + (float)(m_rand.NextDouble());
+ m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor);
+ m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor);
+ }
+ else
+ {
+ //If the region is not empty, we want to obey the minimum and maximum persist times
+ //but add a random factor so we stagger the object persistance a little
+ m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
+ m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
+ }
}
}
m_hasGroupChanged = value;
--
cgit v1.1
From 780630d7c05f7306ffceb52db0eda1401112f426 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Fri, 23 Apr 2010 14:41:20 +0200
Subject: Fix a nullref in attachment handling. Add some debug to find the
attachment state issue
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 84c3719..1f8c732 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -612,6 +612,7 @@ namespace OpenSim.Region.Framework.Scenes
{
UUID itemid = new UUID(node.Attributes["UUID"].Value);
m_savedScriptState.Add(itemid, node.InnerXml);
+ m_log.DebugFormat("[ScriptState]: Retrieved state for script item ID {0}", itemid.ToString());
}
}
}
--
cgit v1.1
From 31e0704c8d7f6100153ddedd64be7f2ab1ad9311 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Fri, 23 Apr 2010 17:48:50 +0200
Subject: Remove debug output, the culprit has been identified
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1f8c732..84c3719 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -612,7 +612,6 @@ namespace OpenSim.Region.Framework.Scenes
{
UUID itemid = new UUID(node.Attributes["UUID"].Value);
m_savedScriptState.Add(itemid, node.InnerXml);
- m_log.DebugFormat("[ScriptState]: Retrieved state for script item ID {0}", itemid.ToString());
}
}
}
--
cgit v1.1
From 81ff5eaba09e7569ef5359874ffcfc7f8855f0b4 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Sun, 25 Apr 2010 22:03:35 +0200
Subject: Make scripted attachment states work. Finally. Also replace two
monitor locks with RWLocks, hunting the 10^3 bug. Not successful, but needed
to be done anyway
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 84c3719..1c6f2d1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1041,6 +1041,11 @@ namespace OpenSim.Region.Framework.Scenes
public void SaveScriptedState(XmlTextWriter writer)
{
+ SaveScriptedState(writer, false);
+ }
+
+ public void SaveScriptedState(XmlTextWriter writer, bool oldIDs)
+ {
XmlDocument doc = new XmlDocument();
Dictionary states = new Dictionary();
@@ -1050,7 +1055,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectPart part in m_parts.Values)
{
- Dictionary pstates = part.Inventory.GetScriptStates();
+ Dictionary pstates = part.Inventory.GetScriptStates(oldIDs);
foreach (UUID itemid in pstates.Keys)
{
states.Add(itemid, pstates[itemid]);
--
cgit v1.1
From 87664017773227d07b39382efa2aa94f22bbe6c6 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Mon, 3 May 2010 04:28:30 +0200
Subject: Adapt CM to the new CHANGED_OWNER handling
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++++++
1 file changed, 8 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1c6f2d1..ff471e0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3931,5 +3931,13 @@ namespace OpenSim.Region.Framework.Scenes
return priority;
}
+
+ public void ResetOwnerChangeFlag()
+ {
+ ForEachPart(delegate(SceneObjectPart part)
+ {
+ part.ResetOwnerChangeFlag();
+ });
+ }
}
}
--
cgit v1.1
From 3cda854ef312a71f3ceab6cb8339a0d2d2fce803 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Mon, 10 May 2010 08:47:41 -0700
Subject: Fix overlooked readLock which was left open
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ff471e0..35134d6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -123,7 +123,7 @@ namespace OpenSim.Region.Framework.Scenes
}
if (m_partsLock.RecursiveWriteCount > 0)
{
- m_log.Error("[SceneObjectGroup.m_parts] Recursive read lock requested. This should not happen and means something needs to be fixed.");
+ m_log.Error("[SceneObjectGroup.m_parts] Recursive read lock requested (write lock exists on this thread). This should not happen and means something needs to be fixed.");
m_partsLock.ExitWriteLock();
}
@@ -1667,6 +1667,7 @@ namespace OpenSim.Region.Framework.Scenes
remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID));
}
}
+ lockPartsForRead(false);
}
#region Copying
--
cgit v1.1
From fd37a21b59836143f50fdf994c691d65bd641d52 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Wed, 12 May 2010 08:34:47 -0700
Subject: Kill some locks that have crept into SOG
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 35134d6..a4b8944 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3651,7 +3651,8 @@ namespace OpenSim.Region.Framework.Scenes
if (atRotTargets.Count > 0)
{
uint[] localids = new uint[0];
- lock (m_parts)
+ lockPartsForRead(true);
+ try
{
localids = new uint[m_parts.Count];
int cntr = 0;
@@ -3661,6 +3662,10 @@ namespace OpenSim.Region.Framework.Scenes
cntr++;
}
}
+ finally
+ {
+ lockPartsForRead(false);
+ }
for (int ctr = 0; ctr < localids.Length; ctr++)
{
@@ -3679,7 +3684,8 @@ namespace OpenSim.Region.Framework.Scenes
{
//trigger not_at_target
uint[] localids = new uint[0];
- lock (m_parts)
+ lockPartsForRead(true);
+ try
{
localids = new uint[m_parts.Count];
int cntr = 0;
@@ -3689,6 +3695,10 @@ namespace OpenSim.Region.Framework.Scenes
cntr++;
}
}
+ finally
+ {
+ lockPartsForRead(false);
+ }
for (int ctr = 0; ctr < localids.Length; ctr++)
{
--
cgit v1.1
From e3dac1292ef000daadda3e264354d8df0fc77c22 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sat, 29 May 2010 02:10:34 -0700
Subject: Implement suspended updates - When an operation is occurring on lots
of prims in a single group, don't schedule any updates until the operation
has completed. This makes things like llSetAlpha(LINK_SET,0.0,ALL_SIDES); a
*lot* faster, more efficient and less buggy, and also makes unlinking a lot
better. Linking is still treacherous.. this needs to be analysed.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index cee2be3..9ebb168 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -109,9 +109,26 @@ namespace OpenSim.Region.Framework.Scenes
private long m_maxPersistTime = 0;
private long m_minPersistTime = 0;
private Random m_rand;
+ private bool m_suspendUpdates;
private System.Threading.ReaderWriterLockSlim m_partsLock = new System.Threading.ReaderWriterLockSlim();
+ public bool areUpdatesSuspended
+ {
+ get
+ {
+ return m_suspendUpdates;
+ }
+ set
+ {
+ m_suspendUpdates = value;
+ if (!value)
+ {
+ QueueForUpdateCheck();
+ }
+ }
+ }
+
public void lockPartsForRead(bool locked)
{
if (locked)
--
cgit v1.1
From d4b4cbf5a5fead727b5e2e48f69d2016eb942cff Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Mon, 31 May 2010 19:00:02 +0200
Subject: Fix create selection getting overwritten by multiple updates for the
same prim.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9ebb168..509ec01 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2486,7 +2486,7 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.LinkNum = 2;
linkPart.SetParent(this);
- linkPart.AddFlag(PrimFlags.CreateSelected);
+ linkPart.CreateSelected = true;
//if (linkPart.PhysActor != null)
//{
--
cgit v1.1
From 70f779041334e7cf3642c334e9800362afde7895 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 1 Jun 2010 01:07:46 +0200
Subject: Split GetAxisAlignedBoundingBox into two methods to allow calculation
of combined bounding boxes and offsets
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 509ec01..4203ba9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -794,9 +794,15 @@ namespace OpenSim.Region.Framework.Scenes
/// offsetHeight is the offset in the Z axis from the centre of the bounding box to the centre of the root prim
///
///
- public Vector3 GetAxisAlignedBoundingBox(out float offsetHeight)
+ public void GetAxisAlignedBoundingBoxRaw(out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ)
{
- float maxX = -256f, maxY = -256f, maxZ = -256f, minX = 256f, minY = 256f, minZ = 256f;
+ maxX = -256f;
+ maxY = -256f;
+ maxZ = -256f;
+ minX = 256f;
+ minY = 256f;
+ minZ = 256f;
+
lockPartsForRead(true);
{
foreach (SceneObjectPart part in m_parts.Values)
@@ -1034,7 +1040,18 @@ namespace OpenSim.Region.Framework.Scenes
}
}
lockPartsForRead(false);
+ }
+
+ public Vector3 GetAxisAlignedBoundingBox(out float offsetHeight)
+ {
+ float minX;
+ float maxX;
+ float minY;
+ float maxY;
+ float minZ;
+ float maxZ;
+ GetAxisAlignedBoundingBoxRaw(out minX, out maxX, out minY, out maxY, out minZ, out maxZ);
Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ);
offsetHeight = 0;
--
cgit v1.1
From 16d8602d3cad613a830a4903bb0d2beb1fa6b7e2 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 1 Jun 2010 03:04:49 +0200
Subject: Fix prim returns I broke earlier
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4203ba9..7e73f91 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -801,7 +801,7 @@ namespace OpenSim.Region.Framework.Scenes
maxZ = -256f;
minX = 256f;
minY = 256f;
- minZ = 256f;
+ minZ = 8192f;
lockPartsForRead(true);
{
--
cgit v1.1
From 3ea11fe2e6593fe0455a7c5bf842deca307f373e Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sat, 12 Jun 2010 04:35:51 -0700
Subject: Get rid of spamming SOG debug message
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 66ad14f..c7d21bb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2230,8 +2230,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ScheduleGroupForFullUpdate()
{
- if (IsAttachment)
- m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
+ //if (IsAttachment)
+ // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
checkAtTargets();
RootPart.ScheduleFullUpdate();
--
cgit v1.1
From f59e272643a92b20e7f7eb97f54a30c8b045725d Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Sun, 13 Jun 2010 22:21:05 +0200
Subject: Introduce SOP.UpdateSitters() to update sitting avatars' chat
position if needed
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 +++++++++
1 file changed, 9 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c7d21bb..6f68029 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2174,6 +2174,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_rootPart.UpdateFlag = 1;
lastPhysGroupPos = AbsolutePosition;
+ UpdateSitters();
}
if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
@@ -3832,6 +3833,14 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ private void UpdateSitters()
+ {
+ foreach (SceneObjectPart part in Children.Values)
+ {
+ part.UpdateSitter();
+ }
+ }
+
public override string ToString()
{
return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition);
--
cgit v1.1
From f9b4f5f594caf609d255c585c4224f0455403908 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Mon, 14 Jun 2010 00:05:01 +0200
Subject: Revert "Introduce SOP.UpdateSitters() to update sitting avatars' chat
position if"
This reverts commit f59e272643a92b20e7f7eb97f54a30c8b045725d.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 ---------
1 file changed, 9 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6f68029..c7d21bb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2174,7 +2174,6 @@ namespace OpenSim.Region.Framework.Scenes
{
m_rootPart.UpdateFlag = 1;
lastPhysGroupPos = AbsolutePosition;
- UpdateSitters();
}
if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
@@ -3833,14 +3832,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- private void UpdateSitters()
- {
- foreach (SceneObjectPart part in Children.Values)
- {
- part.UpdateSitter();
- }
- }
-
public override string ToString()
{
return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition);
--
cgit v1.1
From 49d7d8534ccd037f4690c5ac6aecd66a460960df Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sat, 19 Jun 2010 10:06:09 -0700
Subject: Allow moving an avatar as part of a linkset using
llSetLinkPrimitiveParams. This unlocks an awful lot of poseball-free content,
and is a step towards resolving mantis #59.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 56 +++++++++++++++++++++-
1 file changed, 54 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c7d21bb..3e92954 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -110,8 +110,8 @@ namespace OpenSim.Region.Framework.Scenes
private long m_minPersistTime = 0;
private Random m_rand;
private bool m_suspendUpdates;
-
- private System.Threading.ReaderWriterLockSlim m_partsLock = new System.Threading.ReaderWriterLockSlim();
+ private System.Threading.ReaderWriterLockSlim m_partsLock = new System.Threading.ReaderWriterLockSlim();
+ private List m_linkedAvatars = new List();
public bool areUpdatesSuspended
{
@@ -1116,6 +1116,47 @@ namespace OpenSim.Region.Framework.Scenes
}
///
+ /// Add the avatar to this linkset (avatar is sat).
+ ///
+ ///
+ public void AddAvatar(UUID agentID)
+ {
+ ScenePresence presence;
+ if (m_scene.TryGetScenePresence(agentID, out presence))
+ {
+ if (!m_linkedAvatars.Contains(presence))
+ {
+ m_linkedAvatars.Add(presence);
+ }
+ }
+ }
+
+ ///
+ /// Delete the avatar from this linkset (avatar is unsat).
+ ///
+ ///
+ public void DeleteAvatar(UUID agentID)
+ {
+ ScenePresence presence;
+ if (m_scene.TryGetScenePresence(agentID, out presence))
+ {
+ if (m_linkedAvatars.Contains(presence))
+ {
+ m_linkedAvatars.Remove(presence);
+ }
+ }
+ }
+
+ ///
+ /// Returns the list of linked presences (avatars sat on this group)
+ ///
+ ///
+ public List GetLinkedAvatars()
+ {
+ return m_linkedAvatars;
+ }
+
+ ///
/// Attach this scene object to the given avatar.
///
///
@@ -2974,6 +3015,17 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+
+
+ ///
+ /// Gets the number of parts
+ ///
+ ///
+ public int GetPartCount()
+ {
+ return Children.Count;
+ }
+
///
/// Get the parts of this scene object
///
--
cgit v1.1
From 96e649189f24b6261d0bcdd6aa7f5a078b8d3f7f Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Fri, 25 Jun 2010 14:25:39 -0700
Subject: Add two events: OnAttachToBackup and OnDetachFromBackup.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3e92954..e18dfd2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -658,6 +658,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public virtual void AttachToBackup()
{
+ m_scene.SceneGraph.FireAttachToBackup(this);
+
if (InSceneBackup)
{
//m_log.DebugFormat(
@@ -2703,6 +2705,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public virtual void DetachFromBackup()
{
+ m_scene.SceneGraph.FireDetachFromBackup(this);
+
if (m_isBackedUp)
m_scene.EventManager.OnBackup -= ProcessBackup;
--
cgit v1.1
From f64d1cb3967b5352921b296348f618a62fdfa622 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Fri, 25 Jun 2010 14:39:15 -0700
Subject: Add new event: OnChangedBackup
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e18dfd2..7081ced 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -200,6 +200,10 @@ namespace OpenSim.Region.Framework.Scenes
{
if (value)
{
+ if (m_isBackedUp)
+ {
+ m_scene.SceneGraph.FireChangeBackup(this);
+ }
timeLastChanged = DateTime.Now.Ticks;
if (!m_hasGroupChanged)
timeFirstChanged = DateTime.Now.Ticks;
--
cgit v1.1
From d570cffa39e9ca6417ebd1c05cbdfea1d3beabd2 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Mon, 28 Jun 2010 01:29:30 +0200
Subject: Fix Copy on Ray, Drag Copy and other little things. Removed the wrong
and nonworking ownership assignment in SOG, which messed things up before. No
longer trust the client to send the ID of the person something is copied as,
since it allows to run a script with someone else's permissions. Properly
adjust inventory ownership and perms.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7081ced..241295f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1781,7 +1781,9 @@ namespace OpenSim.Region.Framework.Scenes
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
if (!userExposed)
+ {
dupe.RootPart.IsAttachment = previousAttachmentStatus;
+ }
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
@@ -1806,16 +1808,6 @@ namespace OpenSim.Region.Framework.Scenes
dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
}
- // Now we've made a copy that replaces this one, we need to
- // switch the owner to the person who did the copying
- // Second Life copies an object and duplicates the first one in it's place
- // So, we have to make a copy of this one, set it in it's place then set the owner on this one
- if (userExposed)
- {
- SetRootPartOwner(m_rootPart, cAgentID, cGroupID);
- m_rootPart.ScheduleFullUpdate();
- }
-
List partList;
lockPartsForRead(true);
@@ -1837,12 +1829,6 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
newPart.LinkNum = part.LinkNum;
-
- if (userExposed)
- {
- SetPartOwner(newPart, cAgentID, cGroupID);
- newPart.ScheduleFullUpdate();
- }
}
}
--
cgit v1.1
From a817f6b48c27fe5e950846d687edcd4d375a3c6c Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Mon, 28 Jun 2010 01:48:24 +0200
Subject: Remove AgentID and GroupOD from the signature of SOG.Copy(). They
were never used, but made for a very mispleading read of the code in the
callers.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 241295f..c48ce3b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1700,7 +1700,7 @@ namespace OpenSim.Region.Framework.Scenes
"[SCENE]: Storing {0}, {1} in {2}",
Name, UUID, m_scene.RegionInfo.RegionName);
- SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false);
+ SceneObjectGroup backup_group = Copy(false);
backup_group.RootPart.Velocity = RootPart.Velocity;
backup_group.RootPart.Acceleration = RootPart.Acceleration;
backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
@@ -1758,7 +1758,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Duplicates this object, including operations such as physics set up and attaching to the backup event.
///
///
- public SceneObjectGroup Copy(UUID cAgentID, UUID cGroupID, bool userExposed)
+ public SceneObjectGroup Copy(bool userExposed)
{
SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
dupe.m_isBackedUp = false;
@@ -3897,7 +3897,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual ISceneObject CloneForNewScene()
{
- SceneObjectGroup sog = Copy(this.OwnerID, this.GroupID, false);
+ SceneObjectGroup sog = Copy(false);
sog.m_isDeleted = false;
return sog;
}
--
cgit v1.1
From fe2b044d38f3bd3aa669334d34567fd991a67b3e Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sat, 3 Jul 2010 06:10:55 -0700
Subject: Fix Undo! Made a lot of changes to Undo state saving; it now
considers that groups of objects can be moved and not just individual prims..
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 39 ++++++++++++++++------
1 file changed, 28 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c48ce3b..da664da 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -349,7 +349,21 @@ namespace OpenSim.Region.Framework.Scenes
public virtual Quaternion Rotation
{
get { return m_rotation; }
- set { m_rotation = value; }
+ set {
+ lockPartsForRead(true);
+ try
+ {
+ foreach(SceneObjectPart p in m_parts.Values)
+ {
+ p.StoreUndoState(true);
+ }
+ }
+ finally
+ {
+ lockPartsForRead(false);
+ }
+ m_rotation = value;
+ }
}
public Quaternion GroupRotation
@@ -421,6 +435,7 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_rootPart.GroupPosition; }
set
{
+
Vector3 val = value;
if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
@@ -431,7 +446,10 @@ namespace OpenSim.Region.Framework.Scenes
}
lockPartsForRead(true);
-
+ foreach (SceneObjectPart part in m_parts.Values)
+ {
+ part.IgnoreUndoUpdate = true;
+ }
if (RootPart.GetStatusSandbox())
{
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
@@ -443,12 +461,12 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
}
-
foreach (SceneObjectPart part in m_parts.Values)
{
+ part.IgnoreUndoUpdate = false;
+ part.StoreUndoState(true);
part.GroupPosition = val;
}
-
lockPartsForRead(false);
//if (m_rootPart.PhysActor != null)
@@ -724,7 +742,6 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (SceneObjectPart part in m_parts.Values)
{
-
Vector3 partscale = part.Scale;
Vector3 partoffset = part.OffsetPosition;
@@ -3132,7 +3149,6 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
- part.IgnoreUndoUpdate = true;
if (scale.X > m_scene.m_maxNonphys)
scale.X = m_scene.m_maxNonphys;
if (scale.Y > m_scene.m_maxNonphys)
@@ -3218,8 +3234,7 @@ namespace OpenSim.Region.Framework.Scenes
y *= a;
z *= a;
}
- obPart.IgnoreUndoUpdate = false;
- obPart.StoreUndoState();
+
}
}
}
@@ -3229,13 +3244,17 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 prevScale = part.Scale;
prevScale.X *= x;
prevScale.Y *= y;
- prevScale.Z *= z;
+ prevScale.Z *= z;;
+ part.IgnoreUndoUpdate = true;
part.Resize(prevScale);
+ part.IgnoreUndoUpdate = false;
lockPartsForRead(true);
{
foreach (SceneObjectPart obPart in m_parts.Values)
{
+ obPart.IgnoreUndoUpdate = false;
+ obPart.StoreUndoState(true);
obPart.IgnoreUndoUpdate = true;
if (obPart.UUID != m_rootPart.UUID)
{
@@ -3251,7 +3270,6 @@ namespace OpenSim.Region.Framework.Scenes
obPart.UpdateOffSet(currentpos);
}
obPart.IgnoreUndoUpdate = false;
- obPart.StoreUndoState();
}
}
lockPartsForRead(false);
@@ -3263,7 +3281,6 @@ namespace OpenSim.Region.Framework.Scenes
}
part.IgnoreUndoUpdate = false;
- part.StoreUndoState();
HasGroupChanged = true;
ScheduleGroupForTerseUpdate();
}
--
cgit v1.1
From 5b68343361cbd000a2f024b37797ec235abb7207 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sun, 4 Jul 2010 19:28:39 -0700
Subject: The majority of the Undo fix. There is still an issue with Rotation
which i'll address next; however position undo and scale undo should be
working just fine now. Also removed some residual debug logging.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 38 +++++++++++-----------
1 file changed, 19 insertions(+), 19 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index da664da..34712b8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -355,7 +355,7 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach(SceneObjectPart p in m_parts.Values)
{
- p.StoreUndoState(true);
+ p.StoreUndoState(UndoType.STATE_GROUP_ROTATION);
}
}
finally
@@ -435,7 +435,6 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_rootPart.GroupPosition; }
set
{
-
Vector3 val = value;
if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
@@ -464,7 +463,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectPart part in m_parts.Values)
{
part.IgnoreUndoUpdate = false;
- part.StoreUndoState(true);
+ part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
part.GroupPosition = val;
}
lockPartsForRead(false);
@@ -1488,7 +1487,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void OnGrabPart(SceneObjectPart part, Vector3 offsetPos, IClientAPI remoteClient)
{
- part.StoreUndoState();
+ part.StoreUndoState(UndoType.STATE_PRIM_ALL);
part.OnGrab(offsetPos, remoteClient);
}
@@ -3245,6 +3244,9 @@ namespace OpenSim.Region.Framework.Scenes
prevScale.X *= x;
prevScale.Y *= y;
prevScale.Z *= z;;
+
+ part.IgnoreUndoUpdate = false;
+ part.StoreUndoState(UndoType.STATE_GROUP_SCALE);
part.IgnoreUndoUpdate = true;
part.Resize(prevScale);
part.IgnoreUndoUpdate = false;
@@ -3253,11 +3255,12 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (SceneObjectPart obPart in m_parts.Values)
{
- obPart.IgnoreUndoUpdate = false;
- obPart.StoreUndoState(true);
- obPart.IgnoreUndoUpdate = true;
if (obPart.UUID != m_rootPart.UUID)
{
+ obPart.IgnoreUndoUpdate = false;
+ obPart.StoreUndoState(UndoType.STATE_GROUP_SCALE);
+ obPart.IgnoreUndoUpdate = true;
+
Vector3 currentpos = new Vector3(obPart.OffsetPosition);
currentpos.X *= x;
currentpos.Y *= y;
@@ -3296,14 +3299,11 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupPosition(Vector3 pos)
{
- foreach (SceneObjectPart part in Children.Values)
- {
- part.StoreUndoState();
- }
if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
{
if (IsAttachment)
{
+ m_rootPart.StoreUndoState(UndoType.STATE_GROUP_POSITION);
m_rootPart.AttachedPos = pos;
}
if (RootPart.GetStatusSandbox())
@@ -3336,7 +3336,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetChildPart(localID);
foreach (SceneObjectPart parts in Children.Values)
{
- parts.StoreUndoState();
+ parts.StoreUndoState(UndoType.STATE_PRIM_POSITION);
}
if (part != null)
{
@@ -3361,7 +3361,7 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (SceneObjectPart part in Children.Values)
{
- part.StoreUndoState();
+ part.StoreUndoState(UndoType.STATE_PRIM_POSITION);
}
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
Vector3 oldPos =
@@ -3409,7 +3409,7 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (SceneObjectPart parts in Children.Values)
{
- parts.StoreUndoState();
+ parts.StoreUndoState(UndoType.STATE_GROUP_ROTATION);
}
m_rootPart.UpdateRotation(rot);
@@ -3433,7 +3433,7 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (SceneObjectPart parts in Children.Values)
{
- parts.StoreUndoState();
+ parts.StoreUndoState(UndoType.STATE_GROUP_ROTATION);
}
m_rootPart.UpdateRotation(rot);
@@ -3460,7 +3460,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetChildPart(localID);
foreach (SceneObjectPart parts in Children.Values)
{
- parts.StoreUndoState();
+ parts.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
}
if (part != null)
{
@@ -3496,7 +3496,7 @@ namespace OpenSim.Region.Framework.Scenes
part.UpdateRotation(rot);
part.OffsetPosition = pos;
part.IgnoreUndoUpdate = false;
- part.StoreUndoState();
+ part.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
}
}
}
@@ -3510,7 +3510,7 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion axRot = rot;
Quaternion oldParentRot = m_rootPart.RotationOffset;
- m_rootPart.StoreUndoState();
+ m_rootPart.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
m_rootPart.UpdateRotation(rot);
if (m_rootPart.PhysActor != null)
{
@@ -3542,7 +3542,7 @@ namespace OpenSim.Region.Framework.Scenes
if (childpart != m_rootPart)
{
childpart.IgnoreUndoUpdate = false;
- childpart.StoreUndoState();
+ childpart.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
}
}
--
cgit v1.1
From 8849b9af8bd3260152dede0ccf61fd98137ef6c5 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Sun, 4 Jul 2010 20:45:11 -0700
Subject: Fix single prim rotation undo. All UNDO functions are now working
correctly except for when the root prim is moved or rotated as a single prim
(coming soon).
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 34712b8..7492601 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3492,11 +3492,11 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
+ part.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
part.IgnoreUndoUpdate = true;
part.UpdateRotation(rot);
part.OffsetPosition = pos;
part.IgnoreUndoUpdate = false;
- part.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
}
}
}
--
cgit v1.1
From e947d04038f7b42929368d9f7b6d440be139e675 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Mon, 5 Jul 2010 05:44:35 -0700
Subject: Undo fix is now complete. This commit repairs the special case of the
root prim moving or rotating independently of the rest of the group.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 49 +++++++++++++++++-----
1 file changed, 38 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7492601..f85d3d9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3386,10 +3386,27 @@ namespace OpenSim.Region.Framework.Scenes
}
lockPartsForRead(false);
- AbsolutePosition = newPos;
+ //We have to set undoing here because otherwise an undo state will be saved
+ if (!m_rootPart.Undoing)
+ {
+ m_rootPart.Undoing = true;
+ AbsolutePosition = newPos;
+ m_rootPart.Undoing = false;
+ }
+ else
+ {
+ AbsolutePosition = newPos;
+ }
HasGroupChanged = true;
- ScheduleGroupForTerseUpdate();
+ if (m_rootPart.Undoing)
+ {
+ ScheduleGroupForFullUpdate();
+ }
+ else
+ {
+ ScheduleGroupForTerseUpdate();
+ }
}
public void OffsetForNewRegion(Vector3 offset)
@@ -3488,7 +3505,16 @@ namespace OpenSim.Region.Framework.Scenes
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
- AbsolutePosition = pos;
+ if (!m_rootPart.Undoing)
+ {
+ m_rootPart.Undoing = true;
+ AbsolutePosition = pos;
+ m_rootPart.Undoing = false;
+ }
+ else
+ {
+ AbsolutePosition = pos;
+ }
}
else
{
@@ -3511,6 +3537,12 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion oldParentRot = m_rootPart.RotationOffset;
m_rootPart.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
+ bool cancelUndo = false;
+ if (!m_rootPart.Undoing)
+ {
+ m_rootPart.Undoing = true;
+ cancelUndo = true;
+ }
m_rootPart.UpdateRotation(rot);
if (m_rootPart.PhysActor != null)
{
@@ -3534,18 +3566,13 @@ namespace OpenSim.Region.Framework.Scenes
newRot *= Quaternion.Inverse(axRot);
prim.RotationOffset = newRot;
prim.ScheduleTerseUpdate();
+ prim.IgnoreUndoUpdate = false;
}
}
-
- foreach (SceneObjectPart childpart in Children.Values)
+ if (cancelUndo == true)
{
- if (childpart != m_rootPart)
- {
- childpart.IgnoreUndoUpdate = false;
- childpart.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
- }
+ m_rootPart.Undoing = false;
}
-
lockPartsForRead(false);
m_rootPart.ScheduleTerseUpdate();
--
cgit v1.1
From c5891c14c7547dc0cbbf1bd5bf3a0d2923616f25 Mon Sep 17 00:00:00 2001
From: Tom Grimshaw
Date: Tue, 13 Jul 2010 15:32:35 -0700
Subject: Bail out in AttachToBackup if the group is an attachment
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f85d3d9..7053c02 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -679,6 +679,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public virtual void AttachToBackup()
{
+ if (IsAttachment) return;
m_scene.SceneGraph.FireAttachToBackup(this);
if (InSceneBackup)
--
cgit v1.1
From c72c84b4559ea164bcb77c2d64a046729662bf04 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Wed, 21 Jul 2010 12:16:17 +0200
Subject: Refine autoreturn a bit
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7053c02..e738dd2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1681,7 +1681,10 @@ namespace OpenSim.Region.Framework.Scenes
try
{
- if (!m_scene.ShuttingDown) // if shutting down then there will be nothing to handle the return so leave till next restart
+ if (!m_scene.ShuttingDown || // if shutting down then there will be nothing to handle the return so leave till next restart
+ m_scene.LoginsDisabled || // We're starting up or doing maintenance, don't mess with things
+ m_scene.LoadingPrims) // Land may not be valid yet
+
{
ILandObject parcel = m_scene.LandChannel.GetLandObject(
m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
--
cgit v1.1
From 516ec4acd01d70276329d251155775cedf7b8941 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Sun, 25 Jul 2010 08:11:39 +0200
Subject: Eat a lockign exception that kills scripts. May bear more
investigation in the long run.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 24d260e..dbf493c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -136,12 +136,21 @@ namespace OpenSim.Region.Framework.Scenes
if (m_partsLock.RecursiveReadCount > 0)
{
m_log.Error("[SceneObjectGroup.m_parts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
- m_partsLock.ExitReadLock();
+ try
+ {
+ m_partsLock.ExitReadLock();
+ }
+ catch { } // Ignore errors, to allow resync
}
if (m_partsLock.RecursiveWriteCount > 0)
{
m_log.Error("[SceneObjectGroup.m_parts] Recursive read lock requested (write lock exists on this thread). This should not happen and means something needs to be fixed.");
- m_partsLock.ExitWriteLock();
+ try
+ {
+ m_partsLock.ExitWriteLock();
+ }
+ catch { }
+
}
while (!m_partsLock.TryEnterReadLock(60000))
--
cgit v1.1
From a636af13e77aae588f425b7bc9504854a7ed1261 Mon Sep 17 00:00:00 2001
From: Tom
Date: Fri, 6 Aug 2010 06:37:40 -0700
Subject: Make sure the avatar position gets moved along with a prim it is
sitting on. This fixes mantis #208 and (maybe) issues with chat and sound
coming from the wrong place when sat on a vehicle.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index dbf493c..5a3dc20 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -469,13 +469,22 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
}
- foreach (SceneObjectPart part in m_parts.Values)
+ List parts = new List(m_parts.Values);
+ lockPartsForRead(false);
+ foreach (SceneObjectPart part in parts)
{
part.IgnoreUndoUpdate = false;
part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
part.GroupPosition = val;
}
- lockPartsForRead(false);
+
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition;
+ av.AbsolutePosition += offset;
+ av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
+ av.SendFullUpdateToAllClients();
+ }
//if (m_rootPart.PhysActor != null)
//{
--
cgit v1.1
From 4f80d75bf3fa6de226203c6752e7a8e53fda8108 Mon Sep 17 00:00:00 2001
From: Tom
Date: Sat, 7 Aug 2010 06:28:04 -0700
Subject: Add a CHANGED_POSITION event so scripts don't have to run expensive
loops to check for position changes
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8ce79a2..cac3df6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -476,6 +476,7 @@ namespace OpenSim.Region.Framework.Scenes
part.IgnoreUndoUpdate = false;
part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
part.GroupPosition = val;
+ part.TriggerScriptChangedEvent(Changed.POSITION);
}
foreach (ScenePresence av in m_linkedAvatars)
--
cgit v1.1
From 00cc42a607c59add54af3c1113162576e6109e41 Mon Sep 17 00:00:00 2001
From: sacha
Date: Sat, 7 Aug 2010 13:40:38 +0000
Subject: and another endless debug cleaning
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8ce79a2..0dc63ef 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1734,9 +1734,9 @@ namespace OpenSim.Region.Framework.Scenes
// don't backup while it's selected or you're asking for changes mid stream.
if ((isTimeToPersist()) || (forcedBackup))
{
- m_log.DebugFormat(
- "[SCENE]: Storing {0}, {1} in {2}",
- Name, UUID, m_scene.RegionInfo.RegionName);
+ // m_log.DebugFormat(
+ // "[SCENE]: Storing {0}, {1} in {2}",
+ // Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(false);
backup_group.RootPart.Velocity = RootPart.Velocity;
--
cgit v1.1
From 19ab4c950880beb3ac88a172b775c3973782ec3d Mon Sep 17 00:00:00 2001
From: meta7
Date: Sat, 7 Aug 2010 16:52:03 -0700
Subject: Fix a rather nasty issue where the Backup() process causes objects
and avatars sitting on them to be pushed to the corner of the sim.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 199 +++++++++++----------
1 file changed, 106 insertions(+), 93 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a828127..0d15cb4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -317,8 +317,8 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_scriptListens_notAtTarget = false;
private bool m_scriptListens_atRotTarget = false;
- private bool m_scriptListens_notAtRotTarget = false;
-
+ private bool m_scriptListens_notAtRotTarget = false;
+ public bool m_dupeInProgress = false;
internal Dictionary m_savedScriptState = null;
#region Properties
@@ -475,16 +475,21 @@ namespace OpenSim.Region.Framework.Scenes
{
part.IgnoreUndoUpdate = false;
part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
- part.GroupPosition = val;
- part.TriggerScriptChangedEvent(Changed.POSITION);
- }
-
- foreach (ScenePresence av in m_linkedAvatars)
- {
- Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition;
- av.AbsolutePosition += offset;
- av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
- av.SendFullUpdateToAllClients();
+ part.GroupPosition = val;
+ if (!m_dupeInProgress)
+ {
+ part.TriggerScriptChangedEvent(Changed.POSITION);
+ }
+ }
+ if (!m_dupeInProgress)
+ {
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition;
+ av.AbsolutePosition += offset;
+ av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
+ av.SendFullUpdateToAllClients();
+ }
}
//if (m_rootPart.PhysActor != null)
@@ -1800,88 +1805,96 @@ namespace OpenSim.Region.Framework.Scenes
/// True if the duplicate will immediately be in the scene, false otherwise
///
public SceneObjectGroup Copy(bool userExposed)
- {
- SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
- dupe.m_isBackedUp = false;
- dupe.m_parts = new Dictionary();
-
- // Warning, The following code related to previousAttachmentStatus is needed so that clones of
- // attachments do not bordercross while they're being duplicated. This is hacktastic!
- // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
- // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
- // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
- // then restore it's attachment state
-
- // This is only necessary when userExposed is false!
-
- bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
-
- if (!userExposed)
- dupe.RootPart.IsAttachment = true;
-
- dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
-
- if (!userExposed)
- {
- dupe.RootPart.IsAttachment = previousAttachmentStatus;
- }
-
- dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
- dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
-
- if (userExposed)
- dupe.m_rootPart.TrimPermissions();
-
- /// may need to create a new Physics actor.
- if (dupe.RootPart.PhysActor != null && userExposed)
- {
- PrimitiveBaseShape pbs = dupe.RootPart.Shape;
-
- dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
- dupe.RootPart.Name,
- pbs,
- dupe.RootPart.AbsolutePosition,
- dupe.RootPart.Scale,
- dupe.RootPart.RotationOffset,
- dupe.RootPart.PhysActor.IsPhysical);
-
- dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
- dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
+ {
+ SceneObjectGroup dupe;
+ try
+ {
+ m_dupeInProgress = true;
+ dupe = (SceneObjectGroup)MemberwiseClone();
+ dupe.m_isBackedUp = false;
+ dupe.m_parts = new Dictionary();
+
+ // Warning, The following code related to previousAttachmentStatus is needed so that clones of
+ // attachments do not bordercross while they're being duplicated. This is hacktastic!
+ // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
+ // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
+ // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
+ // then restore it's attachment state
+
+ // This is only necessary when userExposed is false!
+
+ bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
+
+ if (!userExposed)
+ dupe.RootPart.IsAttachment = true;
+
+ dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
+
+ if (!userExposed)
+ {
+ dupe.RootPart.IsAttachment = previousAttachmentStatus;
+ }
+
+ dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
+ dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
+
+ if (userExposed)
+ dupe.m_rootPart.TrimPermissions();
+
+ /// may need to create a new Physics actor.
+ if (dupe.RootPart.PhysActor != null && userExposed)
+ {
+ PrimitiveBaseShape pbs = dupe.RootPart.Shape;
+
+ dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
+ dupe.RootPart.Name,
+ pbs,
+ dupe.RootPart.AbsolutePosition,
+ dupe.RootPart.Scale,
+ dupe.RootPart.RotationOffset,
+ dupe.RootPart.PhysActor.IsPhysical);
+
+ dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
+ dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
+ }
+
+ List partList;
+
+ lockPartsForRead(true);
+
+ partList = new List(m_parts.Values);
+
+ lockPartsForRead(false);
+
+ partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
+ {
+ return p1.LinkNum.CompareTo(p2.LinkNum);
+ }
+ );
+
+ foreach (SceneObjectPart part in partList)
+ {
+ if (part.UUID != m_rootPart.UUID)
+ {
+ SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
+
+ newPart.LinkNum = part.LinkNum;
+ }
+ }
+
+ if (userExposed)
+ {
+ dupe.UpdateParentIDs();
+ dupe.HasGroupChanged = true;
+ dupe.AttachToBackup();
+
+ ScheduleGroupForFullUpdate();
+ }
+ }
+ finally
+ {
+ m_dupeInProgress = false;
}
-
- List partList;
-
- lockPartsForRead(true);
-
- partList = new List(m_parts.Values);
-
- lockPartsForRead(false);
-
- partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
- {
- return p1.LinkNum.CompareTo(p2.LinkNum);
- }
- );
-
- foreach (SceneObjectPart part in partList)
- {
- if (part.UUID != m_rootPart.UUID)
- {
- SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
-
- newPart.LinkNum = part.LinkNum;
- }
- }
-
- if (userExposed)
- {
- dupe.UpdateParentIDs();
- dupe.HasGroupChanged = true;
- dupe.AttachToBackup();
-
- ScheduleGroupForFullUpdate();
- }
-
return dupe;
}
--
cgit v1.1
From 1ead2ed5eea379c500d2657e7bed8908b376e336 Mon Sep 17 00:00:00 2001
From: meta7
Date: Tue, 10 Aug 2010 09:07:17 -0700
Subject: Add a stack trace to the error output on the recursive read lock
warning on my RWlocks. Whilst recursive locks are safe, coupled with other
issues we're experiencing with the TaskInventoryDictionary it implies that
somewhere the lock is not being freed possibly due to a merge error
somewhere, and thus it needs to be looked into.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 218 +++++++++++----------
1 file changed, 114 insertions(+), 104 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3c3f4b7..4f6bc52 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -29,6 +29,7 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
+using System.Diagnostics;
using System.Threading;
using System.Xml;
using System.Xml.Serialization;
@@ -138,6 +139,15 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Error("[SceneObjectGroup.m_parts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
try
{
+ StackTrace stackTrace = new StackTrace(); // get call stack
+ StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
+
+ // write call stack method names
+ foreach (StackFrame stackFrame in stackFrames)
+ {
+ m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name); // write method name
+ }
+
m_partsLock.ExitReadLock();
}
catch { } // Ignore errors, to allow resync
@@ -317,7 +327,7 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_scriptListens_notAtTarget = false;
private bool m_scriptListens_atRotTarget = false;
- private bool m_scriptListens_notAtRotTarget = false;
+ private bool m_scriptListens_notAtRotTarget = false;
public bool m_dupeInProgress = false;
internal Dictionary m_savedScriptState = null;
@@ -475,21 +485,21 @@ namespace OpenSim.Region.Framework.Scenes
{
part.IgnoreUndoUpdate = false;
part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
- part.GroupPosition = val;
- if (!m_dupeInProgress)
- {
- part.TriggerScriptChangedEvent(Changed.POSITION);
+ part.GroupPosition = val;
+ if (!m_dupeInProgress)
+ {
+ part.TriggerScriptChangedEvent(Changed.POSITION);
+ }
+ }
+ if (!m_dupeInProgress)
+ {
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition;
+ av.AbsolutePosition += offset;
+ av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
+ av.SendFullUpdateToAllClients();
}
- }
- if (!m_dupeInProgress)
- {
- foreach (ScenePresence av in m_linkedAvatars)
- {
- Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition;
- av.AbsolutePosition += offset;
- av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
- av.SendFullUpdateToAllClients();
- }
}
//if (m_rootPart.PhysActor != null)
@@ -1805,95 +1815,95 @@ namespace OpenSim.Region.Framework.Scenes
/// True if the duplicate will immediately be in the scene, false otherwise
///
public SceneObjectGroup Copy(bool userExposed)
- {
- SceneObjectGroup dupe;
- try
- {
- m_dupeInProgress = true;
- dupe = (SceneObjectGroup)MemberwiseClone();
- dupe.m_isBackedUp = false;
- dupe.m_parts = new Dictionary();
-
- // Warning, The following code related to previousAttachmentStatus is needed so that clones of
- // attachments do not bordercross while they're being duplicated. This is hacktastic!
- // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
- // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
- // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
- // then restore it's attachment state
-
- // This is only necessary when userExposed is false!
-
- bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
-
- if (!userExposed)
- dupe.RootPart.IsAttachment = true;
-
- dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
-
- if (!userExposed)
- {
- dupe.RootPart.IsAttachment = previousAttachmentStatus;
- }
-
- dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
- dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
-
- if (userExposed)
- dupe.m_rootPart.TrimPermissions();
-
- /// may need to create a new Physics actor.
- if (dupe.RootPart.PhysActor != null && userExposed)
- {
- PrimitiveBaseShape pbs = dupe.RootPart.Shape;
-
- dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
- dupe.RootPart.Name,
- pbs,
- dupe.RootPart.AbsolutePosition,
- dupe.RootPart.Scale,
- dupe.RootPart.RotationOffset,
- dupe.RootPart.PhysActor.IsPhysical);
-
- dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
- dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
- }
-
- List partList;
-
- lockPartsForRead(true);
-
- partList = new List(m_parts.Values);
-
- lockPartsForRead(false);
-
- partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
- {
- return p1.LinkNum.CompareTo(p2.LinkNum);
- }
- );
-
- foreach (SceneObjectPart part in partList)
- {
- if (part.UUID != m_rootPart.UUID)
- {
- SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
-
- newPart.LinkNum = part.LinkNum;
- }
- }
-
- if (userExposed)
- {
- dupe.UpdateParentIDs();
- dupe.HasGroupChanged = true;
- dupe.AttachToBackup();
-
- ScheduleGroupForFullUpdate();
- }
- }
- finally
- {
- m_dupeInProgress = false;
+ {
+ SceneObjectGroup dupe;
+ try
+ {
+ m_dupeInProgress = true;
+ dupe = (SceneObjectGroup)MemberwiseClone();
+ dupe.m_isBackedUp = false;
+ dupe.m_parts = new Dictionary();
+
+ // Warning, The following code related to previousAttachmentStatus is needed so that clones of
+ // attachments do not bordercross while they're being duplicated. This is hacktastic!
+ // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
+ // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
+ // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
+ // then restore it's attachment state
+
+ // This is only necessary when userExposed is false!
+
+ bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
+
+ if (!userExposed)
+ dupe.RootPart.IsAttachment = true;
+
+ dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
+
+ if (!userExposed)
+ {
+ dupe.RootPart.IsAttachment = previousAttachmentStatus;
+ }
+
+ dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
+ dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
+
+ if (userExposed)
+ dupe.m_rootPart.TrimPermissions();
+
+ /// may need to create a new Physics actor.
+ if (dupe.RootPart.PhysActor != null && userExposed)
+ {
+ PrimitiveBaseShape pbs = dupe.RootPart.Shape;
+
+ dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
+ dupe.RootPart.Name,
+ pbs,
+ dupe.RootPart.AbsolutePosition,
+ dupe.RootPart.Scale,
+ dupe.RootPart.RotationOffset,
+ dupe.RootPart.PhysActor.IsPhysical);
+
+ dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
+ dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
+ }
+
+ List partList;
+
+ lockPartsForRead(true);
+
+ partList = new List(m_parts.Values);
+
+ lockPartsForRead(false);
+
+ partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
+ {
+ return p1.LinkNum.CompareTo(p2.LinkNum);
+ }
+ );
+
+ foreach (SceneObjectPart part in partList)
+ {
+ if (part.UUID != m_rootPart.UUID)
+ {
+ SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
+
+ newPart.LinkNum = part.LinkNum;
+ }
+ }
+
+ if (userExposed)
+ {
+ dupe.UpdateParentIDs();
+ dupe.HasGroupChanged = true;
+ dupe.AttachToBackup();
+
+ ScheduleGroupForFullUpdate();
+ }
+ }
+ finally
+ {
+ m_dupeInProgress = false;
}
return dupe;
}
--
cgit v1.1
From d98d5ee6be233cf644be5ee1011c4a7f4b86ae46 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 10 Aug 2010 19:42:18 +0100
Subject: Remove windows line endinge
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 208 ++++++++++-----------
1 file changed, 104 insertions(+), 104 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3c3f4b7..a862fa2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -317,7 +317,7 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_scriptListens_notAtTarget = false;
private bool m_scriptListens_atRotTarget = false;
- private bool m_scriptListens_notAtRotTarget = false;
+ private bool m_scriptListens_notAtRotTarget = false;
public bool m_dupeInProgress = false;
internal Dictionary m_savedScriptState = null;
@@ -475,21 +475,21 @@ namespace OpenSim.Region.Framework.Scenes
{
part.IgnoreUndoUpdate = false;
part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
- part.GroupPosition = val;
- if (!m_dupeInProgress)
- {
- part.TriggerScriptChangedEvent(Changed.POSITION);
+ part.GroupPosition = val;
+ if (!m_dupeInProgress)
+ {
+ part.TriggerScriptChangedEvent(Changed.POSITION);
+ }
+ }
+ if (!m_dupeInProgress)
+ {
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition;
+ av.AbsolutePosition += offset;
+ av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
+ av.SendFullUpdateToAllClients();
}
- }
- if (!m_dupeInProgress)
- {
- foreach (ScenePresence av in m_linkedAvatars)
- {
- Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition;
- av.AbsolutePosition += offset;
- av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
- av.SendFullUpdateToAllClients();
- }
}
//if (m_rootPart.PhysActor != null)
@@ -1805,95 +1805,95 @@ namespace OpenSim.Region.Framework.Scenes
/// True if the duplicate will immediately be in the scene, false otherwise
///
public SceneObjectGroup Copy(bool userExposed)
- {
- SceneObjectGroup dupe;
- try
- {
- m_dupeInProgress = true;
- dupe = (SceneObjectGroup)MemberwiseClone();
- dupe.m_isBackedUp = false;
- dupe.m_parts = new Dictionary();
-
- // Warning, The following code related to previousAttachmentStatus is needed so that clones of
- // attachments do not bordercross while they're being duplicated. This is hacktastic!
- // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
- // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
- // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
- // then restore it's attachment state
-
- // This is only necessary when userExposed is false!
-
- bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
-
- if (!userExposed)
- dupe.RootPart.IsAttachment = true;
-
- dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
-
- if (!userExposed)
- {
- dupe.RootPart.IsAttachment = previousAttachmentStatus;
- }
-
- dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
- dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
-
- if (userExposed)
- dupe.m_rootPart.TrimPermissions();
-
- /// may need to create a new Physics actor.
- if (dupe.RootPart.PhysActor != null && userExposed)
- {
- PrimitiveBaseShape pbs = dupe.RootPart.Shape;
-
- dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
- dupe.RootPart.Name,
- pbs,
- dupe.RootPart.AbsolutePosition,
- dupe.RootPart.Scale,
- dupe.RootPart.RotationOffset,
- dupe.RootPart.PhysActor.IsPhysical);
-
- dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
- dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
- }
-
- List partList;
-
- lockPartsForRead(true);
-
- partList = new List(m_parts.Values);
-
- lockPartsForRead(false);
-
- partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
- {
- return p1.LinkNum.CompareTo(p2.LinkNum);
- }
- );
-
- foreach (SceneObjectPart part in partList)
- {
- if (part.UUID != m_rootPart.UUID)
- {
- SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
-
- newPart.LinkNum = part.LinkNum;
- }
- }
-
- if (userExposed)
- {
- dupe.UpdateParentIDs();
- dupe.HasGroupChanged = true;
- dupe.AttachToBackup();
-
- ScheduleGroupForFullUpdate();
- }
- }
- finally
- {
- m_dupeInProgress = false;
+ {
+ SceneObjectGroup dupe;
+ try
+ {
+ m_dupeInProgress = true;
+ dupe = (SceneObjectGroup)MemberwiseClone();
+ dupe.m_isBackedUp = false;
+ dupe.m_parts = new Dictionary();
+
+ // Warning, The following code related to previousAttachmentStatus is needed so that clones of
+ // attachments do not bordercross while they're being duplicated. This is hacktastic!
+ // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
+ // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
+ // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
+ // then restore it's attachment state
+
+ // This is only necessary when userExposed is false!
+
+ bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
+
+ if (!userExposed)
+ dupe.RootPart.IsAttachment = true;
+
+ dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
+
+ if (!userExposed)
+ {
+ dupe.RootPart.IsAttachment = previousAttachmentStatus;
+ }
+
+ dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
+ dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
+
+ if (userExposed)
+ dupe.m_rootPart.TrimPermissions();
+
+ /// may need to create a new Physics actor.
+ if (dupe.RootPart.PhysActor != null && userExposed)
+ {
+ PrimitiveBaseShape pbs = dupe.RootPart.Shape;
+
+ dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
+ dupe.RootPart.Name,
+ pbs,
+ dupe.RootPart.AbsolutePosition,
+ dupe.RootPart.Scale,
+ dupe.RootPart.RotationOffset,
+ dupe.RootPart.PhysActor.IsPhysical);
+
+ dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
+ dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
+ }
+
+ List partList;
+
+ lockPartsForRead(true);
+
+ partList = new List(m_parts.Values);
+
+ lockPartsForRead(false);
+
+ partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
+ {
+ return p1.LinkNum.CompareTo(p2.LinkNum);
+ }
+ );
+
+ foreach (SceneObjectPart part in partList)
+ {
+ if (part.UUID != m_rootPart.UUID)
+ {
+ SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
+
+ newPart.LinkNum = part.LinkNum;
+ }
+ }
+
+ if (userExposed)
+ {
+ dupe.UpdateParentIDs();
+ dupe.HasGroupChanged = true;
+ dupe.AttachToBackup();
+
+ ScheduleGroupForFullUpdate();
+ }
+ }
+ finally
+ {
+ m_dupeInProgress = false;
}
return dupe;
}
--
cgit v1.1
From 24b9a2885f1204d32cd032aa8ea9905fa9ce19b1 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 10 Aug 2010 20:11:55 +0100
Subject: Resolve merge issues
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 68 +++++++++++++++-------
1 file changed, 46 insertions(+), 22 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a0f267c..b179646 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1838,6 +1838,26 @@ namespace OpenSim.Region.Framework.Scenes
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
+ if (userExposed)
+ dupe.m_rootPart.TrimPermissions();
+
+ /// may need to create a new Physics actor.
+ if (dupe.RootPart.PhysActor != null && userExposed)
+ {
+ PrimitiveBaseShape pbs = dupe.RootPart.Shape;
+
+ dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
+ dupe.RootPart.Name,
+ pbs,
+ dupe.RootPart.AbsolutePosition,
+ dupe.RootPart.Scale,
+ dupe.RootPart.RotationOffset,
+ dupe.RootPart.PhysActor.IsPhysical);
+
+ dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
+ dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
+ }
+
lockPartsForRead(true);
List partList;
@@ -1860,34 +1880,37 @@ namespace OpenSim.Region.Framework.Scenes
newPart.LinkNum = part.LinkNum;
}
- }
+ // Need to duplicate the physics actor as well
+ if (part.PhysActor != null && userExposed)
+ {
+ PrimitiveBaseShape pbs = part.Shape;
+
+ part.PhysActor
+ = m_scene.PhysicsScene.AddPrimShape(
+ part.Name,
+ pbs,
+ part.AbsolutePosition,
+ part.Scale,
+ part.RotationOffset,
+ part.PhysActor.IsPhysical);
+
+ part.PhysActor.LocalID = part.LocalId;
+ part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
+ }
+
+ }
if (userExposed)
{
- SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
- newPart.LinkNum = part.LinkNum;
+ dupe.UpdateParentIDs();
+ dupe.HasGroupChanged = true;
+ dupe.AttachToBackup();
+
+ ScheduleGroupForFullUpdate();
}
- // Need to duplicate the physics actor as well
- if (part.PhysActor != null && userExposed)
- {
- PrimitiveBaseShape pbs = part.Shape;
-
- part.PhysActor
- = m_scene.PhysicsScene.AddPrimShape(
- part.Name,
- pbs,
- part.AbsolutePosition,
- part.Scale,
- part.RotationOffset,
- part.PhysActor.IsPhysical);
-
- part.PhysActor.LocalID = part.LocalId;
- part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
- }
}
-
- if (userExposed)
+ finally
{
m_dupeInProgress = false;
}
@@ -1905,6 +1928,7 @@ namespace OpenSim.Region.Framework.Scenes
SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed));
}
+ public void ScriptSetPhysicsStatus(bool UsePhysics)
{
bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
--
cgit v1.1
From fb14390fb0446e225bca08ec2dc25960d1441728 Mon Sep 17 00:00:00 2001
From: meta7
Date: Tue, 10 Aug 2010 09:17:30 -0700
Subject: Note to self: don't break the build
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ffe2094..20a2abc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -145,7 +145,7 @@ namespace OpenSim.Region.Framework.Scenes
// write call stack method names
foreach (StackFrame stackFrame in stackFrames)
{
- m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name); // write method name
+ m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name)); // write method name
}
m_partsLock.ExitReadLock();
--
cgit v1.1
From d299f8b55cb0e3848dbcbb941a5789d52459bc44 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 14 Sep 2010 19:41:53 +0200
Subject: Fix a small left over buglet and also add checking of the physics
actor position on backup. This way, ant object that has been moved will be
checked for ghost prims as soon as it is persisted.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 ++++++++++
1 file changed, 10 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a952508..37630e0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1786,6 +1786,16 @@ namespace OpenSim.Region.Framework.Scenes
// don't backup while it's selected or you're asking for changes mid stream.
if (isTimeToPersist() || forcedBackup)
{
+ if (m_rootPart.PhysActor != null &&
+ (!m_rootPart.PhysActor.IsPhysical))
+ {
+ if (m_rootPart.PhysActor.Position != m_rootPart.GroupPosition)
+ {
+ m_rootPart.PhysActor.Position = m_rootPart.GroupPosition;
+ m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset;
+ m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
+ }
+ }
// m_log.DebugFormat(
// "[SCENE]: Storing {0}, {1} in {2}",
// Name, UUID, m_scene.RegionInfo.RegionName);
--
cgit v1.1
From cc290abf7a2bd651205e8978a095cb83ffeddcf7 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 14 Sep 2010 22:13:44 +0200
Subject: Adjust the code for ghost prim removal to new information from Kitto
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 37630e0..e933e77 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1789,11 +1789,15 @@ namespace OpenSim.Region.Framework.Scenes
if (m_rootPart.PhysActor != null &&
(!m_rootPart.PhysActor.IsPhysical))
{
+ // Possible ghost prim
if (m_rootPart.PhysActor.Position != m_rootPart.GroupPosition)
{
- m_rootPart.PhysActor.Position = m_rootPart.GroupPosition;
- m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset;
- m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
+ foreach (SceneObjectPart part in Children.Values)
+ {
+ // Re-set physics actor positions and
+ // orientations
+ part.GroupPosition = m_rootPart.GroupPosition;
+ }
}
}
// m_log.DebugFormat(
--
cgit v1.1
From ec89dc99b705f86fb4ed2f984125c2196d8c6288 Mon Sep 17 00:00:00 2001
From: root
Date: Thu, 16 Sep 2010 18:58:25 +0200
Subject: Some small bug fixes
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3411d18..142f5d8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -29,6 +29,7 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
+using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Xml;
--
cgit v1.1
From a0c87b5af6bba104fe50de3006b5dd515a8eb833 Mon Sep 17 00:00:00 2001
From: root
Date: Thu, 16 Sep 2010 23:12:32 +0200
Subject: JustinCC is evil. f7b28dd3 broke script persistence. This fixes it.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 142f5d8..ab9cbd7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -696,6 +696,7 @@ namespace OpenSim.Region.Framework.Scenes
if (node.Attributes["UUID"] != null)
{
UUID itemid = new UUID(node.Attributes["UUID"].Value);
+ m_log.DebugFormat("[SCRIPT STATE]: Adding state for oldID {0}", itemid);
m_savedScriptState.Add(itemid, node.InnerXml);
}
}
--
cgit v1.1
From 1e4e978f7ff798292211c58ef07eee37cd76ef8e Mon Sep 17 00:00:00 2001
From: root
Date: Thu, 16 Sep 2010 23:26:53 +0200
Subject: Removing debug
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ab9cbd7..142f5d8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -696,7 +696,6 @@ namespace OpenSim.Region.Framework.Scenes
if (node.Attributes["UUID"] != null)
{
UUID itemid = new UUID(node.Attributes["UUID"].Value);
- m_log.DebugFormat("[SCRIPT STATE]: Adding state for oldID {0}", itemid);
m_savedScriptState.Add(itemid, node.InnerXml);
}
}
--
cgit v1.1
From 87a1e00f058f737628d50732ffbe46d5d6638779 Mon Sep 17 00:00:00 2001
From: root
Date: Fri, 17 Sep 2010 04:00:00 +0200
Subject: Remove the now unused partslock
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3bc7834..f9bfffd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -112,7 +112,6 @@ namespace OpenSim.Region.Framework.Scenes
private long m_minPersistTime = 0;
private Random m_rand;
private bool m_suspendUpdates;
- private System.Threading.ReaderWriterLockSlim m_partsLock = new System.Threading.ReaderWriterLockSlim();
private List m_linkedAvatars = new List();
public bool areUpdatesSuspended
--
cgit v1.1
From 9cf8795ecf1a2f34f803babf318d9c1f394ee18b Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 19 Sep 2010 22:53:05 +0200
Subject: Fix a merge artefact that broke script state persistence in
XAttachments
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f9bfffd..41b0a42 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1029,7 +1029,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
- Dictionary pstates = parts[i].Inventory.GetScriptStates();
+ Dictionary pstates = parts[i].Inventory.GetScriptStates(oldIDs);
foreach (KeyValuePair kvp in pstates)
states.Add(kvp.Key, kvp.Value);
}
--
cgit v1.1
From 9522881404e9496cb68d97fae537d60bbfa5233b Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 30 Sep 2010 02:46:47 +0200
Subject: Fix a potential key collision
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a9502ed..a00a7c4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1035,7 +1035,7 @@ namespace OpenSim.Region.Framework.Scenes
{
Dictionary pstates = parts[i].Inventory.GetScriptStates(oldIDs);
foreach (KeyValuePair kvp in pstates)
- states.Add(kvp.Key, kvp.Value);
+ states[kvp.Key] = kvp.Value;
}
if (states.Count > 0)
--
cgit v1.1
From 42f76773a15d83fd31f249cc4a21985184b0cdbf Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 6 Oct 2010 19:59:30 +0200
Subject: Plumb the path for multiple object deletes
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a00a7c4..a6d89cf 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1569,6 +1569,8 @@ namespace OpenSim.Region.Framework.Scenes
ILandObject parcel = m_scene.LandChannel.GetLandObject(
m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
+ List returns = new List();
+
if (parcel != null && parcel.LandData != null &&
parcel.LandData.OtherCleanTime != 0)
{
@@ -1582,13 +1584,15 @@ namespace OpenSim.Region.Framework.Scenes
DetachFromBackup();
m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString());
m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel auto return");
- m_scene.DeRezObject(null, RootPart.LocalId,
- RootPart.GroupID, DeRezAction.Return, UUID.Zero);
+ returns.Add(RootPart.LocalId);
return;
}
}
}
+
+ m_scene.DeRezObjects(null, returns, UUID.Zero,
+ DeRezAction.Return, UUID.Zero);
}
if (HasGroupChanged)
--
cgit v1.1
From 2db0ac74c72f18d1bceb15b8a368777e42b366c0 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 7 Oct 2010 01:13:17 +0200
Subject: Implement taking of coalesced objects. WARNING!!!!! You can TAKE
them, but you can't REZ them again. Only the first of the contained objects
will rez, the rest is inaccessible until rezzing them is implemented. Also,
rotations are not explicitly stored. This MAY work. Or not.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a6d89cf..9a7d560 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1569,8 +1569,6 @@ namespace OpenSim.Region.Framework.Scenes
ILandObject parcel = m_scene.LandChannel.GetLandObject(
m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
- List returns = new List();
-
if (parcel != null && parcel.LandData != null &&
parcel.LandData.OtherCleanTime != 0)
{
@@ -1584,15 +1582,14 @@ namespace OpenSim.Region.Framework.Scenes
DetachFromBackup();
m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString());
m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel auto return");
- returns.Add(RootPart.LocalId);
+ m_scene.DeRezObjects(null, new List() { RootPart.LocalId }, UUID.Zero,
+ DeRezAction.Return, UUID.Zero);
return;
}
}
}
- m_scene.DeRezObjects(null, returns, UUID.Zero,
- DeRezAction.Return, UUID.Zero);
}
if (HasGroupChanged)
--
cgit v1.1
From 52dd547863c0cdd22f53f0efcaef11ae096855a0 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 8 Oct 2010 11:31:52 +0200
Subject: Make SendKillObject send multiple localIDs in one packet. This avoids
the halting visual behavior of large group deletes and eliminates the packet
flood
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9a7d560..c870797 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1151,7 +1151,7 @@ namespace OpenSim.Region.Framework.Scenes
//
if (IsSelected)
{
- m_scene.SendKillObject(m_rootPart.LocalId);
+ m_scene.SendKillObject(new List { m_rootPart.LocalId });
}
IsSelected = false; // fudge....
@@ -1415,11 +1415,7 @@ namespace OpenSim.Region.Framework.Scenes
avatar.StandUp();
if (!silent)
- {
part.UpdateFlag = 0;
- if (part == m_rootPart)
- avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
- }
});
}
--
cgit v1.1
From b8924167e004cba5e9b426cbb0b2619816ee6858 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 4 Nov 2010 10:37:39 +0100
Subject: Fix creation of a duplicate physics actor on chained drag-copy
operations, the main cause for "ghost prims"
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 17 -----------------
1 file changed, 17 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c870797..93d223e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1704,23 +1704,6 @@ namespace OpenSim.Region.Framework.Scenes
if (userExposed)
dupe.m_rootPart.TrimPermissions();
- /// may need to create a new Physics actor.
- if (dupe.RootPart.PhysActor != null && userExposed)
- {
- PrimitiveBaseShape pbs = dupe.RootPart.Shape;
-
- dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape(
- dupe.RootPart.Name,
- pbs,
- dupe.RootPart.AbsolutePosition,
- dupe.RootPart.Scale,
- dupe.RootPart.RotationOffset,
- dupe.RootPart.PhysActor.IsPhysical);
-
- dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
- dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
- }
-
List partList = new List(m_parts.GetArray());
partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
--
cgit v1.1
From 15da52d73aab37ba32447d317bab89baaceb38ba Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 8 Nov 2010 19:00:03 +0100
Subject: Prevent temp-on-rez prims from being persisted
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 +++
1 file changed, 3 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 93d223e..79f7162 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1553,6 +1553,9 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
+ if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
+ return;
+
// Since this is the top of the section of call stack for backing up a particular scene object, don't let
// any exception propogate upwards.
try
--
cgit v1.1
From 4f15b8d4e6be1e1fe88ad32aa43595861d1005ad Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 16 Nov 2010 20:44:39 +0100
Subject: Change the way attachments are persisted. Editing a worn attachment
will now save properly, as will the results of a resizer script working.
Attachment positions are no longer saved on each move, but instead are saved
once on logout. Attachment script states are saved as part of the attachment
now when detaching.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 79f7162..ee08072 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -586,13 +586,15 @@ namespace OpenSim.Region.Framework.Scenes
XmlNodeList nodes = doc.GetElementsByTagName("SavedScriptState");
if (nodes.Count > 0)
{
- m_savedScriptState = new Dictionary();
+ if (m_savedScriptState == null)
+ m_savedScriptState = new Dictionary();
foreach (XmlNode node in nodes)
{
if (node.Attributes["UUID"] != null)
{
UUID itemid = new UUID(node.Attributes["UUID"].Value);
- m_savedScriptState.Add(itemid, node.InnerXml);
+ if (itemid != UUID.Zero)
+ m_savedScriptState[itemid] = node.InnerXml;
}
}
}
--
cgit v1.1
From b3a71c6df1538c61247f7d4711aba4c840508db8 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 24 Nov 2010 18:56:25 +0100
Subject: Prevent an overlength button label from producing a debug dump and
aborting the script.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f3964c2..bcb715b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -398,7 +398,7 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
av.AbsolutePosition += offset;
av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
- av.SendFullUpdateToAllClients();
+ av.SendAvatarDataToAllAgents();
}
}
}
--
cgit v1.1
From 62e66b17bcc6e9dd856a0d46b3097f452d865a3b Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 15 Dec 2010 17:54:57 +0100
Subject: Make sure the material is set on physical prims
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 896300f..72443b9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1749,6 +1749,7 @@ namespace OpenSim.Region.Framework.Scenes
part.Scale,
part.RotationOffset,
part.PhysActor.IsPhysical);
+ part.PhysActor.SetMaterial((int)part.Material);
part.PhysActor.LocalID = part.LocalId;
part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
--
cgit v1.1
From f2dd324bc8fd7ef4be7426a660d7548e53c54962 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 26 Dec 2010 20:42:47 +0100
Subject: Fix linking link sets to rotated prims.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 72443b9..304de67 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2584,7 +2584,8 @@ namespace OpenSim.Region.Framework.Scenes
axPos *= parentRot;
part.OffsetPosition = axPos;
- part.GroupPosition = oldGroupPosition + part.OffsetPosition;
+ Vector3 newPos = oldGroupPosition + part.OffsetPosition;
+ part.GroupPosition = newPos;
part.OffsetPosition = Vector3.Zero;
part.RotationOffset = worldRot;
@@ -2595,7 +2596,7 @@ namespace OpenSim.Region.Framework.Scenes
part.LinkNum = linkNum;
- part.OffsetPosition = part.GroupPosition - AbsolutePosition;
+ part.OffsetPosition = newPos - AbsolutePosition;
Quaternion rootRotation = m_rootPart.RotationOffset;
@@ -2605,7 +2606,7 @@ namespace OpenSim.Region.Framework.Scenes
parentRot = m_rootPart.RotationOffset;
oldRot = part.RotationOffset;
- Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
+ Quaternion newRot = Quaternion.Inverse(parentRot) * worldRot;
part.RotationOffset = newRot;
}
--
cgit v1.1
From 72048169c0f8aea6806f987f8ef932798f73a8aa Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 10 Jan 2011 22:02:09 +0100
Subject: Taint SOGs the right way
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 304de67..6e0fc43 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2857,8 +2857,12 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ RootPart.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
for (int i = 0; i < parts.Length; i++)
- parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
+ {
+ if (parts[i] != RootPart)
+ parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
+ }
}
}
--
cgit v1.1
From b6dda231f2d6be6ac7684048a11f1f0516ed3067 Mon Sep 17 00:00:00 2001
From: Kitto Flora
Date: Fri, 4 Feb 2011 17:31:52 +0000
Subject: Corrections for Avatar Auto-pilot target; add llStopMoveToTarget()
for Avatar-attached.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6e0fc43..4cbf3e1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1912,6 +1912,7 @@ namespace OpenSim.Region.Framework.Scenes
return Vector3.Zero;
}
+ // This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object
public void moveToTarget(Vector3 target, float tau)
{
SceneObjectPart rootpart = m_rootPart;
@@ -1951,9 +1952,17 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart rootpart = m_rootPart;
if (rootpart != null)
{
- if (rootpart.PhysActor != null)
+ if (IsAttachment)
{
- rootpart.PhysActor.PIDActive = false;
+ ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
+ if (avatar != null) avatar.StopMoveToPosition();
+ }
+ else
+ {
+ if (rootpart.PhysActor != null)
+ {
+ rootpart.PhysActor.PIDActive = false;
+ }
}
}
}
--
cgit v1.1
From 553a195493db93f9718c1e48b408c1e6839bfde0 Mon Sep 17 00:00:00 2001
From: Tom
Date: Sun, 27 Mar 2011 13:09:19 -0700
Subject: Fix issues with UpdateRootRotation and also increase efficiency
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4cbf3e1..92a275e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3393,7 +3393,9 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.Undoing = true;
cancelUndo = true;
}
- m_rootPart.UpdateRotation(rot);
+
+ //Don't use UpdateRotation because it schedules an update prematurely
+ m_rootPart.RotationOffset = rot;
if (m_rootPart.PhysActor != null)
{
m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset;
@@ -3408,14 +3410,13 @@ namespace OpenSim.Region.Framework.Scenes
{
prim.IgnoreUndoUpdate = true;
Vector3 axPos = prim.OffsetPosition;
+
axPos *= oldParentRot;
axPos *= Quaternion.Inverse(axRot);
prim.OffsetPosition = axPos;
- Quaternion primsRot = prim.RotationOffset;
- Quaternion newRot = primsRot * oldParentRot;
- newRot *= Quaternion.Inverse(axRot);
- prim.RotationOffset = newRot;
- prim.ScheduleTerseUpdate();
+
+ prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset);
+
prim.IgnoreUndoUpdate = false;
}
}
@@ -3424,7 +3425,7 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.Undoing = false;
}
- m_rootPart.ScheduleTerseUpdate();
+ ScheduleGroupForTerseUpdate();
}
#endregion
--
cgit v1.1
From 2d2a1acfae712585f1f00ec8d26b5aa4c00482fc Mon Sep 17 00:00:00 2001
From: Tom
Date: Sun, 27 Mar 2011 13:43:32 -0700
Subject: Upgrade terse to full update on root rotation change. Not entirely
sure why, but it seems that the terse update causes the first prim to rotate
improperly on occasion (only temporary, it's fixed by the full update on
deselect, but this will prevent confusion.)
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 92a275e..631a7a0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3425,7 +3425,7 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.Undoing = false;
}
- ScheduleGroupForTerseUpdate();
+ ScheduleGroupForFullUpdate();
}
#endregion
--
cgit v1.1
From f7276dda027c6ac8d500f20e44a3a7a0218a70b7 Mon Sep 17 00:00:00 2001
From: Tom
Date: Sun, 27 Mar 2011 14:20:25 -0700
Subject: Flag root prim changes for persistence
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 631a7a0..776b3b3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3424,7 +3424,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_rootPart.Undoing = false;
}
-
+ HasGroupChanged = true;
ScheduleGroupForFullUpdate();
}
--
cgit v1.1
From 62e0c960363e0949bbc41b072a0dfffb90d19762 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 24 May 2011 03:37:25 +0200
Subject: Allow disabling the legacy backup mechanism to avoid the object clone
if backup is not used.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b100b39..62277ff 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1613,7 +1613,7 @@ namespace OpenSim.Region.Framework.Scenes
}
- if (HasGroupChanged)
+ if (m_scene.UseBackup && HasGroupChanged)
{
// don't backup while it's selected or you're asking for changes mid stream.
if (isTimeToPersist() || forcedBackup)
--
cgit v1.1
From 4d324f1b74deb1bc08b02ad1fe781d46cff43ccc Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 26 May 2011 16:29:00 +0200
Subject: Change setter on changed flags to public so modules can reset it
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 62277ff..d3d5d08 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Has the group changed due to an unlink operation? We record this in order to optimize deletion, since
/// an unlinked group currently has to be persisted to the database before we can perform an unlink operation.
///
- public bool HasGroupChangedDueToDelink { get; private set; }
+ public bool HasGroupChangedDueToDelink { get; set; }
private bool isTimeToPersist()
{
--
cgit v1.1
From 61bf2bf2ddce323255d7d009274d8da5a2da54c9 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 2 Jun 2011 18:32:25 +0200
Subject: Make Buoyancy a prim property
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 +++
1 file changed, 3 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d3d5d08..74d24a6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -680,6 +680,9 @@ namespace OpenSim.Region.Framework.Scenes
ApplyPhysics(m_scene.m_physicalPrim);
+ if (RootPart.PhysActor != null)
+ RootPart.Buoyancy = RootPart.Buoyancy;
+
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
// for the same object with very different properties. The caller must schedule the update.
//ScheduleGroupForFullUpdate();
--
cgit v1.1
From bb402d0d95c934fbcd8b1c03e228ec1d0a14f14d Mon Sep 17 00:00:00 2001
From: Tom
Date: Fri, 15 Jul 2011 12:08:40 -0700
Subject: Add localid support to ch0de properly
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 482597d..aeb03a2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1767,7 +1767,8 @@ namespace OpenSim.Region.Framework.Scenes
part.AbsolutePosition,
part.Scale,
part.RotationOffset,
- part.PhysActor.IsPhysical);
+ part.PhysActor.IsPhysical,
+ m_localId);
part.PhysActor.SetMaterial((int)part.Material);
part.PhysActor.LocalID = part.LocalId;
--
cgit v1.1
From 8dff9d564dfbf4841f03a919df44e8ae3d76de25 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 15 Jul 2011 19:35:49 +0200
Subject: Revert "Add localid support to ch0de properly"
This reverts commit bb402d0d95c934fbcd8b1c03e228ec1d0a14f14d.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index aeb03a2..482597d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1767,8 +1767,7 @@ namespace OpenSim.Region.Framework.Scenes
part.AbsolutePosition,
part.Scale,
part.RotationOffset,
- part.PhysActor.IsPhysical,
- m_localId);
+ part.PhysActor.IsPhysical);
part.PhysActor.SetMaterial((int)part.Material);
part.PhysActor.LocalID = part.LocalId;
--
cgit v1.1
From c7dbd7cbd035ccc412624cd221348479d43798d6 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 15 Jul 2011 12:08:40 -0700
Subject: Fox some local id issues in physics glue
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 482597d..aeb03a2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1767,7 +1767,8 @@ namespace OpenSim.Region.Framework.Scenes
part.AbsolutePosition,
part.Scale,
part.RotationOffset,
- part.PhysActor.IsPhysical);
+ part.PhysActor.IsPhysical,
+ m_localId);
part.PhysActor.SetMaterial((int)part.Material);
part.PhysActor.LocalID = part.LocalId;
--
cgit v1.1
From b5fcd2caba91fc4c524c5f58836e2d5a08573549 Mon Sep 17 00:00:00 2001
From: root
Date: Fri, 15 Jul 2011 20:11:12 +0100
Subject: Fix some local id issues in physics glue
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index aeb03a2..6c47645 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
using System;
using System.Collections.Generic;
using System.Drawing;
--
cgit v1.1
From 9ab951a954ff85371dc3dd92563d7c8cdefb7c20 Mon Sep 17 00:00:00 2001
From: Tom
Date: Sun, 4 Sep 2011 07:38:25 -0700
Subject: I fucked up the merge for SOG, so reverting back to OpenSim Core's
version...
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 1260 ++++----------------
1 file changed, 255 insertions(+), 1005 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b1b76dd..5762717 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -24,12 +24,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
-using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Xml;
@@ -106,29 +105,8 @@ namespace OpenSim.Region.Framework.Scenes
/// since the group's last persistent backup
///
private bool m_hasGroupChanged = false;
- private long timeFirstChanged = 0;
- private long timeLastChanged = 0;
- private long m_maxPersistTime = 0;
- private long m_minPersistTime = 0;
- private Random m_rand;
- private bool m_suspendUpdates;
- private List m_linkedAvatars = new List();
-
- public bool areUpdatesSuspended
- {
- get
- {
- return m_suspendUpdates;
- }
- set
- {
- m_suspendUpdates = value;
- if (!value)
- {
- QueueForUpdateCheck();
- }
- }
- }
+ private long timeFirstChanged;
+ private long timeLastChanged;
public bool HasGroupChanged
{
@@ -136,54 +114,24 @@ namespace OpenSim.Region.Framework.Scenes
{
if (value)
{
- if (m_isBackedUp)
- {
- m_scene.SceneGraph.FireChangeBackup(this);
- }
timeLastChanged = DateTime.Now.Ticks;
if (!m_hasGroupChanged)
timeFirstChanged = DateTime.Now.Ticks;
- if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null)
- {
- if (m_rand == null)
- {
- byte[] val = new byte[16];
- m_rootPart.UUID.ToBytes(val, 0);
- m_rand = new Random(BitConverter.ToInt32(val, 0));
- }
-
- if (m_scene.GetRootAgentCount() == 0)
- {
- //If the region is empty, this change has been made by an automated process
- //and thus we delay the persist time by a random amount between 1.5 and 2.5.
-
- float factor = 1.5f + (float)(m_rand.NextDouble());
- m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor);
- m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor);
- }
- else
- {
- //If the region is not empty, we want to obey the minimum and maximum persist times
- //but add a random factor so we stagger the object persistance a little
- m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
- m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
- }
- }
}
m_hasGroupChanged = value;
-
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: HasGroupChanged set to {0} for {1} {2}", m_hasGroupChanged, Name, LocalId);
+
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: HasGroupChanged set to {0} for {1} {2}", m_hasGroupChanged, Name, LocalId);
}
get { return m_hasGroupChanged; }
}
-
+
///
/// Has the group changed due to an unlink operation? We record this in order to optimize deletion, since
/// an unlinked group currently has to be persisted to the database before we can perform an unlink operation.
///
- public bool HasGroupChangedDueToDelink { get; set; }
+ public bool HasGroupChangedDueToDelink { get; private set; }
private bool isTimeToPersist()
{
@@ -193,19 +141,8 @@ namespace OpenSim.Region.Framework.Scenes
return false;
if (m_scene.ShuttingDown)
return true;
-
- if (m_minPersistTime == 0 || m_maxPersistTime == 0)
- {
- m_maxPersistTime = m_scene.m_persistAfter;
- m_minPersistTime = m_scene.m_dontPersistBefore;
- }
-
long currentTime = DateTime.Now.Ticks;
-
- if (timeLastChanged == 0) timeLastChanged = currentTime;
- if (timeFirstChanged == 0) timeFirstChanged = currentTime;
-
- if (currentTime - timeLastChanged > m_minPersistTime || currentTime - timeFirstChanged > m_maxPersistTime)
+ if (currentTime - timeLastChanged > m_scene.m_dontPersistBefore || currentTime - timeFirstChanged > m_scene.m_persistAfter)
return true;
return false;
}
@@ -310,10 +247,10 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_scriptListens_atTarget;
private bool m_scriptListens_notAtTarget;
+
private bool m_scriptListens_atRotTarget;
private bool m_scriptListens_notAtRotTarget;
- public bool m_dupeInProgress = false;
internal Dictionary m_savedScriptState;
#region Properties
@@ -349,13 +286,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual Quaternion Rotation
{
get { return m_rotation; }
- set {
- foreach(SceneObjectPart p in m_parts.GetArray())
- {
- p.StoreUndoState(UndoType.STATE_GROUP_ROTATION);
- }
- m_rotation = value;
- }
+ set { m_rotation = value; }
}
public Quaternion GroupRotation
@@ -370,27 +301,27 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 minScale = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionSize);
Vector3 maxScale = Vector3.Zero;
Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
-
+
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
Vector3 partscale = part.Scale;
Vector3 partoffset = part.OffsetPosition;
-
+
minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X;
minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.Y + partoffset.Y : minScale.Y;
minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z;
-
+
maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X;
maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y;
maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z;
}
-
+
finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
-
+
return finalScale;
}
}
@@ -446,7 +377,7 @@ namespace OpenSim.Region.Framework.Scenes
{
return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0));
}
-
+
///
/// The absolute position of this scene object in the scene
///
@@ -460,55 +391,30 @@ namespace OpenSim.Region.Framework.Scenes
if (Scene != null)
{
if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
- || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
+ || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
}
}
- foreach (SceneObjectPart part in m_parts.GetArray())
- {
- part.IgnoreUndoUpdate = true;
- }
if (RootPart.GetStatusSandbox())
{
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
{
RootPart.ScriptSetPhysicsStatus(false);
-
+
if (Scene != null)
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
-
+
return;
}
}
+
SceneObjectPart[] parts = m_parts.GetArray();
- foreach (SceneObjectPart part in parts)
- {
- part.IgnoreUndoUpdate = false;
- part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
- part.GroupPosition = val;
- if (!m_dupeInProgress)
- {
- part.TriggerScriptChangedEvent(Changed.POSITION);
- }
- }
- if (!m_dupeInProgress)
- {
- foreach (ScenePresence av in m_linkedAvatars)
- {
- SceneObjectPart p;
- if (m_parts.TryGetValue(av.LinkedPrim, out p))
- {
- Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
- av.AbsolutePosition += offset;
- av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
- av.SendAvatarDataToAllAgents();
- }
- }
- }
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].GroupPosition = val;
//if (m_rootPart.PhysActor != null)
//{
@@ -517,7 +423,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_rootPart.GroupPosition.Z);
//m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
//}
-
+
if (Scene != null)
Scene.EventManager.TriggerParcelPrimCountTainted();
}
@@ -532,7 +438,7 @@ namespace OpenSim.Region.Framework.Scenes
public override UUID UUID
{
get { return m_rootPart.UUID; }
- set
+ set
{
lock (m_parts.SyncRoot)
{
@@ -563,9 +469,10 @@ namespace OpenSim.Region.Framework.Scenes
public string Text
{
- get {
+ get
+ {
string returnstr = m_rootPart.Text;
- if (returnstr.Length > 255)
+ if (returnstr.Length > 255)
{
returnstr = returnstr.Substring(0, 255);
}
@@ -578,7 +485,7 @@ namespace OpenSim.Region.Framework.Scenes
{
get { return true; }
}
-
+
private bool m_passCollision;
public bool PassCollision
{
@@ -655,10 +562,10 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
-// ~SceneObjectGroup()
-// {
-// m_log.DebugFormat("[SCENE OBJECT GROUP]: Destructor called for {0}, local id {1}", Name, LocalId);
-// }
+ // ~SceneObjectGroup()
+ // {
+ // m_log.DebugFormat("[SCENE OBJECT GROUP]: Destructor called for {0}, local id {1}", Name, LocalId);
+ // }
#region Constructors
@@ -667,7 +574,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectGroup()
{
-
}
///
@@ -711,7 +617,7 @@ namespace OpenSim.Region.Framework.Scenes
if (itemid != UUID.Zero)
m_savedScriptState[itemid] = node.InnerXml;
}
- }
+ }
}
}
@@ -732,9 +638,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public virtual void AttachToBackup()
{
- if (IsAttachment) return;
- m_scene.SceneGraph.FireAttachToBackup(this);
-
if (InSceneBackup)
{
//m_log.DebugFormat(
@@ -742,11 +645,11 @@ namespace OpenSim.Region.Framework.Scenes
if (!m_isBackedUp)
m_scene.EventManager.OnBackup += ProcessBackup;
-
+
m_isBackedUp = true;
}
}
-
+
///
/// Attach this object to a scene. It will also now appear to agents.
///
@@ -777,9 +680,6 @@ namespace OpenSim.Region.Framework.Scenes
ApplyPhysics(m_scene.m_physicalPrim);
- if (RootPart.PhysActor != null)
- RootPart.Buoyancy = RootPart.Buoyancy;
-
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
// for the same object with very different properties. The caller must schedule the update.
//ScheduleGroupForFullUpdate();
@@ -825,9 +725,9 @@ namespace OpenSim.Region.Framework.Scenes
result.normal = inter.normal;
result.distance = inter.distance;
}
-
}
}
+
return result;
}
@@ -847,19 +747,17 @@ namespace OpenSim.Region.Framework.Scenes
minZ = 8192f;
SceneObjectPart[] parts = m_parts.GetArray();
- foreach (SceneObjectPart part in parts)
+ for (int i = 0; i < parts.Length; i++)
{
+ SceneObjectPart part = parts[i];
+
Vector3 worldPos = part.GetWorldPosition();
Vector3 offset = worldPos - AbsolutePosition;
Quaternion worldRot;
if (part.ParentID == 0)
- {
worldRot = part.RotationOffset;
- }
else
- {
worldRot = part.GetWorldRotation();
- }
Vector3 frontTopLeft;
Vector3 frontTopRight;
@@ -871,8 +769,6 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 backBottomLeft;
Vector3 backBottomRight;
- // Vector3[] corners = new Vector3[8];
-
Vector3 orig = Vector3.Zero;
frontTopLeft.X = orig.X - (part.Scale.X / 2);
@@ -907,38 +803,6 @@ namespace OpenSim.Region.Framework.Scenes
backBottomRight.Y = orig.Y + (part.Scale.Y / 2);
backBottomRight.Z = orig.Z - (part.Scale.Z / 2);
-
-
- //m_log.InfoFormat("pre corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z);
- //m_log.InfoFormat("pre corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z);
- //m_log.InfoFormat("pre corner 3 is {0} {1} {2}", frontBottomRight.X, frontBottomRight.Y, frontBottomRight.Z);
- //m_log.InfoFormat("pre corner 4 is {0} {1} {2}", frontBottomLeft.X, frontBottomLeft.Y, frontBottomLeft.Z);
- //m_log.InfoFormat("pre corner 5 is {0} {1} {2}", backTopLeft.X, backTopLeft.Y, backTopLeft.Z);
- //m_log.InfoFormat("pre corner 6 is {0} {1} {2}", backTopRight.X, backTopRight.Y, backTopRight.Z);
- //m_log.InfoFormat("pre corner 7 is {0} {1} {2}", backBottomRight.X, backBottomRight.Y, backBottomRight.Z);
- //m_log.InfoFormat("pre corner 8 is {0} {1} {2}", backBottomLeft.X, backBottomLeft.Y, backBottomLeft.Z);
-
- //for (int i = 0; i < 8; i++)
- //{
- // corners[i] = corners[i] * worldRot;
- // corners[i] += offset;
-
- // if (corners[i].X > maxX)
- // maxX = corners[i].X;
- // if (corners[i].X < minX)
- // minX = corners[i].X;
-
- // if (corners[i].Y > maxY)
- // maxY = corners[i].Y;
- // if (corners[i].Y < minY)
- // minY = corners[i].Y;
-
- // if (corners[i].Z > maxZ)
- // maxZ = corners[i].Y;
- // if (corners[i].Z < minZ)
- // minZ = corners[i].Z;
- //}
-
frontTopLeft = frontTopLeft * worldRot;
frontTopRight = frontTopRight * worldRot;
frontBottomLeft = frontBottomLeft * worldRot;
@@ -960,15 +824,6 @@ namespace OpenSim.Region.Framework.Scenes
backTopLeft += offset;
backTopRight += offset;
- //m_log.InfoFormat("corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z);
- //m_log.InfoFormat("corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z);
- //m_log.InfoFormat("corner 3 is {0} {1} {2}", frontBottomRight.X, frontBottomRight.Y, frontBottomRight.Z);
- //m_log.InfoFormat("corner 4 is {0} {1} {2}", frontBottomLeft.X, frontBottomLeft.Y, frontBottomLeft.Z);
- //m_log.InfoFormat("corner 5 is {0} {1} {2}", backTopLeft.X, backTopLeft.Y, backTopLeft.Z);
- //m_log.InfoFormat("corner 6 is {0} {1} {2}", backTopRight.X, backTopRight.Y, backTopRight.Z);
- //m_log.InfoFormat("corner 7 is {0} {1} {2}", backBottomRight.X, backBottomRight.Y, backBottomRight.Z);
- //m_log.InfoFormat("corner 8 is {0} {1} {2}", backBottomLeft.X, backBottomLeft.Y, backBottomLeft.Z);
-
if (frontTopRight.X > maxX)
maxX = frontTopRight.X;
if (frontTopLeft.X > maxX)
@@ -1106,7 +961,7 @@ namespace OpenSim.Region.Framework.Scenes
offsetHeight *= -1;
}
- // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z);
+ // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z);
return boundingBox;
}
@@ -1114,20 +969,15 @@ namespace OpenSim.Region.Framework.Scenes
public void SaveScriptedState(XmlTextWriter writer)
{
- SaveScriptedState(writer, false);
- }
-
- public void SaveScriptedState(XmlTextWriter writer, bool oldIDs)
- {
XmlDocument doc = new XmlDocument();
- Dictionary states = new Dictionary();
+ Dictionary states = new Dictionary();
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
- Dictionary pstates = parts[i].Inventory.GetScriptStates(oldIDs);
+ Dictionary pstates = parts[i].Inventory.GetScriptStates();
foreach (KeyValuePair kvp in pstates)
- states[kvp.Key] = kvp.Value;
+ states.Add(kvp.Key, kvp.Value);
}
if (states.Count > 0)
@@ -1146,190 +996,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
-<<<<<<< HEAD
- ///
- /// Add the avatar to this linkset (avatar is sat).
- ///
- ///
- public void AddAvatar(UUID agentID)
- {
- ScenePresence presence;
- if (m_scene.TryGetScenePresence(agentID, out presence))
- {
- if (!m_linkedAvatars.Contains(presence))
- {
- m_linkedAvatars.Add(presence);
- }
- }
- }
-
- ///
- /// Delete the avatar from this linkset (avatar is unsat).
- ///
- ///
- public void DeleteAvatar(UUID agentID)
- {
- ScenePresence presence;
- if (m_scene.TryGetScenePresence(agentID, out presence))
- {
- if (m_linkedAvatars.Contains(presence))
- {
- m_linkedAvatars.Remove(presence);
- }
- }
- }
-
- ///
- /// Returns the list of linked presences (avatars sat on this group)
- ///
- ///
- public List GetLinkedAvatars()
- {
- return m_linkedAvatars;
- }
-
- ///
- /// Attach this scene object to the given avatar.
- ///
- ///
- ///
- ///
- public void AttachToAgent(UUID agentID, uint attachmentpoint, Vector3 AttachOffset, bool silent)
- {
- ScenePresence avatar = m_scene.GetScenePresence(agentID);
- if (avatar != null)
- {
- // don't attach attachments to child agents
- if (avatar.IsChildAgent) return;
-
-// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
-
- DetachFromBackup();
-
- // Remove from database and parcel prim count
- m_scene.DeleteFromStorage(UUID);
- m_scene.EventManager.TriggerParcelPrimCountTainted();
-
- m_rootPart.AttachedAvatar = agentID;
-
- //Anakin Lohner bug #3839
- lock (m_parts)
- {
- foreach (SceneObjectPart p in m_parts.GetArray())
- {
- p.AttachedAvatar = agentID;
- }
- }
-
- if (m_rootPart.PhysActor != null)
- {
- m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor);
- m_rootPart.PhysActor = null;
- }
-
- AbsolutePosition = AttachOffset;
- m_rootPart.AttachedPos = AttachOffset;
- m_rootPart.IsAttachment = true;
-
- m_rootPart.SetParentLocalId(avatar.LocalId);
- SetAttachmentPoint(Convert.ToByte(attachmentpoint));
-
- avatar.AddAttachment(this);
-
- if (!silent)
- {
- // Killing it here will cause the client to deselect it
- // It then reappears on the avatar, deselected
- // through the full update below
- //
- if (IsSelected)
- {
- m_scene.SendKillObject(new List { m_rootPart.LocalId });
- }
-
- IsSelected = false; // fudge....
- ScheduleGroupForFullUpdate();
- }
- }
- else
- {
- m_log.WarnFormat(
- "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present",
- UUID, agentID, Scene.RegionInfo.RegionName);
- }
- }
-
- public byte GetAttachmentPoint()
- {
- return m_rootPart.Shape.State;
- }
-
- public void ClearPartAttachmentData()
- {
- SetAttachmentPoint((Byte)0);
- }
-
- public void DetachToGround()
- {
- ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar);
- if (avatar == null)
- return;
-
- avatar.RemoveAttachment(this);
-
- Vector3 detachedpos = new Vector3(127f,127f,127f);
- if (avatar == null)
- return;
-
- detachedpos = avatar.AbsolutePosition;
- RootPart.FromItemID = UUID.Zero;
-
- AbsolutePosition = detachedpos;
- m_rootPart.AttachedAvatar = UUID.Zero;
-
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].AttachedAvatar = UUID.Zero;
-
- m_rootPart.SetParentLocalId(0);
- SetAttachmentPoint((byte)0);
- m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_scene.m_physicalPrim);
- HasGroupChanged = true;
- RootPart.Rezzed = DateTime.Now;
- RootPart.RemFlag(PrimFlags.TemporaryOnRez);
- AttachToBackup();
- m_scene.EventManager.TriggerParcelPrimCountTainted();
- m_rootPart.ScheduleFullUpdate();
- m_rootPart.ClearUndoState();
- }
-
- public void DetachToInventoryPrep()
- {
- ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar);
- //Vector3 detachedpos = new Vector3(127f, 127f, 127f);
- if (avatar != null)
- {
- //detachedpos = avatar.AbsolutePosition;
- avatar.RemoveAttachment(this);
- }
-
- m_rootPart.AttachedAvatar = UUID.Zero;
-
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].AttachedAvatar = UUID.Zero;
-
- m_rootPart.SetParentLocalId(0);
- //m_rootPart.SetAttachmentPoint((byte)0);
- m_rootPart.IsAttachment = false;
- AbsolutePosition = m_rootPart.AttachedPos;
- //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
- //AttachToBackup();
- //m_rootPart.ScheduleFullUpdate();
- }
-
-=======
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
///
///
///
@@ -1361,7 +1027,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_scene = scene;
}
-
+
///
/// Set a part to act as the root part for this scene object
///
@@ -1376,7 +1042,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!IsAttachment)
part.ParentID = 0;
part.LinkNum = 0;
-
+
m_parts.Add(m_rootPart.UUID, m_rootPart);
}
@@ -1387,16 +1053,8 @@ namespace OpenSim.Region.Framework.Scenes
public void AddPart(SceneObjectPart part)
{
part.SetParent(this);
-<<<<<<< HEAD
- m_parts.Add(part.UUID, part);
-
- part.LinkNum = m_parts.Count;
-
- if (part.LinkNum == 2 && RootPart != null)
-=======
part.LinkNum = m_parts.Add(part.UUID, part);
if (part.LinkNum == 2)
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
RootPart.LinkNum = 1;
}
@@ -1432,19 +1090,19 @@ namespace OpenSim.Region.Framework.Scenes
// justincc: I don't believe this hack is needed any longer, especially since the physics
// parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false
// this method was preventing proper reload of scene objects.
-
+
// dahlia: I had to uncomment it, without it meshing was failing on some prims and objects
// at region startup
-
+
// teravus: After this was removed from the linking algorithm, Linked prims no longer collided
// properly when non-physical if they havn't been moved. This breaks ALL builds.
// see: http://opensimulator.org/mantis/view.php?id=3108
-
+
// Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the
// position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and
// unmoved prims! As soon as you move a Prim/group, it will collide properly because Absolute
// Position has been set!
-
+
public void ResetChildPrimPhysicsPositions()
{
AbsolutePosition = AbsolutePosition; // could someone in the know please explain how this works?
@@ -1479,15 +1137,11 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void OnGrabPart(SceneObjectPart part, Vector3 offsetPos, IClientAPI remoteClient)
{
-<<<<<<< HEAD
- part.StoreUndoState(UndoType.STATE_PRIM_ALL);
-=======
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Processing OnGrabPart for {0} on {1} {2}, offsetPos {3}",
-// remoteClient.Name, part.Name, part.LocalId, offsetPos);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Processing OnGrabPart for {0} on {1} {2}, offsetPos {3}",
+ // remoteClient.Name, part.Name, part.LocalId, offsetPos);
part.StoreUndoState();
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
part.OnGrab(offsetPos, remoteClient);
}
@@ -1507,11 +1161,6 @@ namespace OpenSim.Region.Framework.Scenes
/// If true then deletion is not broadcast to clients
public void DeleteGroupFromScene(bool silent)
{
- // We need to keep track of this state in case this group is still queued for backup.
- m_isDeleted = true;
-
- DetachFromBackup();
-
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
@@ -1523,11 +1172,13 @@ namespace OpenSim.Region.Framework.Scenes
avatar.StandUp();
if (!silent)
+ {
part.UpdateFlag = 0;
+ if (part == m_rootPart)
+ avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
+ }
});
}
-
-
}
public void AddScriptLPS(int count)
@@ -1587,10 +1238,10 @@ namespace OpenSim.Region.Framework.Scenes
public void SetText(string text, Vector3 color, double alpha)
{
- Color = Color.FromArgb(0xff - (int) (alpha * 0xff),
- (int) (color.X * 0xff),
- (int) (color.Y * 0xff),
- (int) (color.Z * 0xff));
+ Color = Color.FromArgb(0xff - (int)(alpha * 0xff),
+ (int)(color.X * 0xff),
+ (int)(color.Y * 0xff),
+ (int)(color.Z * 0xff));
Text = text;
HasGroupChanged = true;
@@ -1605,7 +1256,7 @@ namespace OpenSim.Region.Framework.Scenes
{
// Apply physics to the root prim
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
-
+
// Apply physics to child prims
SceneObjectPart[] parts = m_parts.GetArray();
if (parts.Length > 1)
@@ -1624,12 +1275,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SetOwnerId(UUID userId)
{
- ForEachPart(delegate(SceneObjectPart part)
- {
-
- part.OwnerID = userId;
-
- });
+ ForEachPart(delegate(SceneObjectPart part) { part.OwnerID = userId; });
}
public void ForEachPart(Action whatToDo)
@@ -1649,29 +1295,23 @@ namespace OpenSim.Region.Framework.Scenes
{
if (!m_isBackedUp)
{
-// m_log.DebugFormat(
-// "[WATER WARS]: Ignoring backup of {0} {1} since object is not marked to be backed up", Name, UUID);
+ // m_log.DebugFormat(
+ // "[WATER WARS]: Ignoring backup of {0} {1} since object is not marked to be backed up", Name, UUID);
return;
}
if (IsDeleted || UUID == UUID.Zero)
{
-// m_log.DebugFormat(
-// "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID);
+ // m_log.DebugFormat(
+ // "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID);
return;
}
- if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
- return;
-
// Since this is the top of the section of call stack for backing up a particular scene object, don't let
// any exception propogate upwards.
try
{
- if (!m_scene.ShuttingDown || // if shutting down then there will be nothing to handle the return so leave till next restart
- m_scene.LoginsDisabled || // We're starting up or doing maintenance, don't mess with things
- m_scene.LoadingPrims) // Land may not be valid yet
-
+ if (!m_scene.ShuttingDown) // if shutting down then there will be nothing to handle the return so leave till next restart
{
ILandObject parcel = m_scene.LandChannel.GetLandObject(
m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
@@ -1688,7 +1328,7 @@ namespace OpenSim.Region.Framework.Scenes
{
DetachFromBackup();
m_log.DebugFormat(
- "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
+ "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
RootPart.UUID);
m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn");
m_scene.DeRezObjects(null, new List() { RootPart.LocalId }, UUID.Zero,
@@ -1698,7 +1338,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
}
if (m_scene.UseBackup && HasGroupChanged)
@@ -1706,23 +1345,9 @@ namespace OpenSim.Region.Framework.Scenes
// don't backup while it's selected or you're asking for changes mid stream.
if (isTimeToPersist() || forcedBackup)
{
- if (m_rootPart.PhysActor != null &&
- (!m_rootPart.PhysActor.IsPhysical))
- {
- // Possible ghost prim
- if (m_rootPart.PhysActor.Position != m_rootPart.GroupPosition)
- {
- foreach (SceneObjectPart part in m_parts.GetArray())
- {
- // Re-set physics actor positions and
- // orientations
- part.GroupPosition = m_rootPart.GroupPosition;
- }
- }
- }
-// m_log.DebugFormat(
-// "[SCENE]: Storing {0}, {1} in {2}",
-// Name, UUID, m_scene.RegionInfo.RegionName);
+ // m_log.DebugFormat(
+ // "[SCENE]: Storing {0}, {1} in {2}",
+ // Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(false);
backup_group.RootPart.Velocity = RootPart.Velocity;
@@ -1735,25 +1360,25 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
- backup_group.ForEachPart(delegate(SceneObjectPart part)
- {
- part.Inventory.ProcessInventoryBackup(datastore);
+ backup_group.ForEachPart(delegate(SceneObjectPart part)
+ {
+ part.Inventory.ProcessInventoryBackup(datastore);
});
backup_group = null;
}
-// else
-// {
-// m_log.DebugFormat(
-// "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
-// Name, UUID, IsSelected);
-// }
+ // else
+ // {
+ // m_log.DebugFormat(
+ // "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
+ // Name, UUID, IsSelected);
+ // }
}
}
catch (Exception e)
{
m_log.ErrorFormat(
- "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}",
+ "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}",
Name, UUID, m_scene.RegionInfo.RegionName, e.Message, e.StackTrace);
}
}
@@ -1783,106 +1408,63 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectGroup Copy(bool userExposed)
{
- SceneObjectGroup dupe;
- try
- {
- m_dupeInProgress = true;
- dupe = (SceneObjectGroup)MemberwiseClone();
- dupe.m_isBackedUp = false;
- dupe.m_parts = new MapAndArray();
-
-<<<<<<< HEAD
- // Warning, The following code related to previousAttachmentStatus is needed so that clones of
- // attachments do not bordercross while they're being duplicated. This is hacktastic!
- // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
- // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
- // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
- // then restore it's attachment state
-=======
+ SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
+ dupe.m_isBackedUp = false;
+ dupe.m_parts = new MapAndArray();
+
+ // Warning, The following code related to previousAttachmentStatus is needed so that clones of
+ // attachments do not bordercross while they're being duplicated. This is hacktastic!
+ // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
+ // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
+ // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
+ // then restore it's attachment state
+
+ // This is only necessary when userExposed is false!
+
bool previousAttachmentStatus = dupe.IsAttachment;
-
+
if (!userExposed)
dupe.IsAttachment = true;
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
- // This is only necessary when userExposed is false!
+ dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
-<<<<<<< HEAD
- bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
-=======
if (!userExposed)
{
dupe.IsAttachment = previousAttachmentStatus;
}
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
-
- if (!userExposed)
- dupe.RootPart.IsAttachment = true;
-
- dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
-
- if (!userExposed)
- {
- dupe.RootPart.IsAttachment = previousAttachmentStatus;
- }
- dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
- dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
+ dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
+ dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
- if (userExposed)
- dupe.m_rootPart.TrimPermissions();
+ if (userExposed)
+ dupe.m_rootPart.TrimPermissions();
- List partList = new List(m_parts.GetArray());
+ List partList = new List(m_parts.GetArray());
- partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
- {
- return p1.LinkNum.CompareTo(p2.LinkNum);
- }
- );
+ partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
+ {
+ return p1.LinkNum.CompareTo(p2.LinkNum);
+ }
+ );
- foreach (SceneObjectPart part in partList)
+ foreach (SceneObjectPart part in partList)
+ {
+ SceneObjectPart newPart;
+ if (part.UUID != m_rootPart.UUID)
{
- if (part.UUID != m_rootPart.UUID)
- {
- SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
-
- newPart.LinkNum = part.LinkNum;
- }
-
- // Need to duplicate the physics actor as well
- if (part.PhysActor != null && userExposed)
- {
- PrimitiveBaseShape pbs = part.Shape;
-
- part.PhysActor
- = m_scene.PhysicsScene.AddPrimShape(
- string.Format("{0}/{1}", part.Name, part.UUID),
- pbs,
- part.AbsolutePosition,
- part.Scale,
- part.RotationOffset,
- part.PhysActor.IsPhysical,
- m_localId);
- part.PhysActor.SetMaterial((int)part.Material);
-
- part.PhysActor.LocalID = part.LocalId;
- part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
- }
+ newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
+ newPart.LinkNum = part.LinkNum;
}
- if (userExposed)
+ else
{
- dupe.UpdateParentIDs();
- dupe.HasGroupChanged = true;
- dupe.AttachToBackup();
+ newPart = dupe.m_rootPart;
+ }
-<<<<<<< HEAD
- ScheduleGroupForFullUpdate();
-=======
// Need to duplicate the physics actor as well
if (part.PhysActor != null && userExposed)
{
PrimitiveBaseShape pbs = newPart.Shape;
-
+
newPart.PhysActor
= m_scene.PhysicsScene.AddPrimShape(
string.Format("{0}/{1}", newPart.Name, newPart.UUID),
@@ -1892,15 +1474,20 @@ namespace OpenSim.Region.Framework.Scenes
newPart.RotationOffset,
part.PhysActor.IsPhysical,
newPart.LocalId);
-
+
newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
}
}
- finally
+
+ if (userExposed)
{
- m_dupeInProgress = false;
+ dupe.UpdateParentIDs();
+ dupe.HasGroupChanged = true;
+ dupe.AttachToBackup();
+
+ ScheduleGroupForFullUpdate();
}
+
return dupe;
}
@@ -2006,7 +1593,6 @@ namespace OpenSim.Region.Framework.Scenes
return Vector3.Zero;
}
- // This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object
public void moveToTarget(Vector3 target, float tau)
{
if (IsAttachment)
@@ -2030,72 +1616,14 @@ namespace OpenSim.Region.Framework.Scenes
public void stopMoveToTarget()
{
-<<<<<<< HEAD
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
- {
- if (IsAttachment)
- {
- ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
- if (avatar != null) avatar.StopMoveToPosition();
- }
- else
- {
- if (rootpart.PhysActor != null)
- {
- rootpart.PhysActor.PIDActive = false;
- }
- }
- }
-=======
if (RootPart.PhysActor != null)
RootPart.PhysActor.PIDActive = false;
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
- }
-
- public void rotLookAt(Quaternion target, float strength, float damping)
- {
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
- {
- if (IsAttachment)
- {
- /*
- ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
- if (avatar != null)
- {
- Rotate the Av?
- } */
- }
- else
- {
- if (rootpart.PhysActor != null)
- { // APID must be implemented in your physics system for this to function.
- rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W);
- rootpart.PhysActor.APIDStrength = strength;
- rootpart.PhysActor.APIDDamping = damping;
- rootpart.PhysActor.APIDActive = true;
- }
- }
- }
}
public void stopLookAt()
{
-<<<<<<< HEAD
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
- {
- if (rootpart.PhysActor != null)
- { // APID must be implemented in your physics system for this to function.
- rootpart.PhysActor.APIDActive = false;
- }
- }
-
-=======
if (RootPart.PhysActor != null)
RootPart.PhysActor.APIDActive = false;
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
}
///
@@ -2153,8 +1681,6 @@ namespace OpenSim.Region.Framework.Scenes
public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{
SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
- newPart.SetParent(this);
-
AddPart(newPart);
SetPartAsNonRoot(newPart);
@@ -2188,11 +1714,11 @@ namespace OpenSim.Region.Framework.Scenes
public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, UUID AgentID, uint RequestFlags)
{
remoteClient.SendObjectPropertiesFamilyData(RootPart, RequestFlags);
-
-// remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.OwnerID, RootPart.GroupID, RootPart.BaseMask,
-// RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask,
-// RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category,
-// RootPart.CreatorID, RootPart.Name, RootPart.Description);
+
+ // remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.OwnerID, RootPart.GroupID, RootPart.BaseMask,
+ // RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask,
+ // RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category,
+ // RootPart.CreatorID, RootPart.Name, RootPart.Description);
}
public void SetPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID)
@@ -2245,8 +1771,8 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleFullUpdateToAvatar(ScenePresence presence)
{
-// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
-
+ // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
+
RootPart.AddFullUpdateToAvatar(presence);
SceneObjectPart[] parts = m_parts.GetArray();
@@ -2260,7 +1786,7 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
{
-// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
+ // m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
@@ -2272,9 +1798,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ScheduleGroupForFullUpdate()
{
-// if (IsAttachment)
-// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
-
+ // if (IsAttachment)
+ // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
+
checkAtTargets();
RootPart.ScheduleFullUpdate();
@@ -2292,7 +1818,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ScheduleGroupForTerseUpdate()
{
-// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
+ // m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
@@ -2303,12 +1829,12 @@ namespace OpenSim.Region.Framework.Scenes
/// Immediately send a full update for this scene object.
///
public void SendGroupFullUpdate()
- {
+ {
if (IsDeleted)
return;
-// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
-
+ // m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
+
RootPart.SendFullUpdateToAllClients();
SceneObjectPart[] parts = m_parts.GetArray();
@@ -2338,7 +1864,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_scene == null) // Need to check here as it's null during object creation
return;
-
+
m_scene.SceneGraph.AddToUpdateList(this);
}
@@ -2454,9 +1980,9 @@ namespace OpenSim.Region.Framework.Scenes
// objectGroup.RootPart.SendScheduledUpdates();
//}
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
-// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
+ // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
SceneObjectPart linkPart = objectGroup.m_rootPart;
@@ -2496,15 +2022,12 @@ namespace OpenSim.Region.Framework.Scenes
part.LinkNum += objectGroup.PrimCount;
}
}
- }
- linkPart.LinkNum = 2;
+ linkPart.LinkNum = 2;
- linkPart.SetParent(this);
- linkPart.CreateSelected = true;
+ linkPart.SetParent(this);
+ linkPart.CreateSelected = true;
- lock (m_parts.SyncRoot)
- {
//if (linkPart.PhysActor != null)
//{
// m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
@@ -2528,9 +2051,9 @@ namespace OpenSim.Region.Framework.Scenes
objectGroup.IsDeleted = true;
objectGroup.m_parts.Clear();
-
+
// Can't do this yet since backup still makes use of the root part without any synchronization
-// objectGroup.m_rootPart = null;
+ // objectGroup.m_rootPart = null;
AttachToBackup();
@@ -2588,10 +2111,10 @@ namespace OpenSim.Region.Framework.Scenes
/// The object group of the newly delinked prim.
public SceneObjectGroup DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
-// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
-
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
+ // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
+
linkPart.ClearUndoState();
Quaternion worldRot = linkPart.GetWorldRotation();
@@ -2662,15 +2185,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public virtual void DetachFromBackup()
{
-<<<<<<< HEAD
- m_scene.SceneGraph.FireDetachFromBackup(this);
-
- if (m_isBackedUp)
-=======
if (m_isBackedUp && Scene != null)
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
m_scene.EventManager.OnBackup -= ProcessBackup;
-
+
m_isBackedUp = false;
}
@@ -2686,8 +2203,7 @@ namespace OpenSim.Region.Framework.Scenes
axPos *= parentRot;
part.OffsetPosition = axPos;
- Vector3 newPos = oldGroupPosition + part.OffsetPosition;
- part.GroupPosition = newPos;
+ part.GroupPosition = oldGroupPosition + part.OffsetPosition;
part.OffsetPosition = Vector3.Zero;
part.RotationOffset = worldRot;
@@ -2698,7 +2214,7 @@ namespace OpenSim.Region.Framework.Scenes
part.LinkNum = linkNum;
- part.OffsetPosition = newPos - AbsolutePosition;
+ part.OffsetPosition = part.GroupPosition - AbsolutePosition;
Quaternion rootRotation = m_rootPart.RotationOffset;
@@ -2708,7 +2224,7 @@ namespace OpenSim.Region.Framework.Scenes
parentRot = m_rootPart.RotationOffset;
oldRot = part.RotationOffset;
- Quaternion newRot = Quaternion.Inverse(parentRot) * worldRot;
+ Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
part.RotationOffset = newRot;
}
@@ -2806,7 +2322,7 @@ namespace OpenSim.Region.Framework.Scenes
// but it will result in over-shoot or under-shoot of the target orientation.
// For the end user, this means that ctrl+shift+drag can be used for relative,
// but not absolute, adjustments of orientation for physical prims.
-
+
if (m_scene.EventManager.TriggerGroupSpin(UUID, newOrientation))
{
if (m_rootPart.PhysActor != null)
@@ -2821,25 +2337,25 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
- // save and update old orientation
- Quaternion old = m_rootPart.SpinOldOrientation;
- m_rootPart.SpinOldOrientation = newOrientation;
- //m_log.Error("[SCENE OBJECT GROUP]: Old orientation is " + old);
- //m_log.Error("[SCENE OBJECT GROUP]: Incoming new orientation is " + newOrientation);
-
- // compute difference between previous old rotation and new incoming rotation
- Quaternion minimalRotationFromQ1ToQ2 = Quaternion.Inverse(old) * newOrientation;
-
- float rotationAngle;
- Vector3 rotationAxis;
- minimalRotationFromQ1ToQ2.GetAxisAngle(out rotationAxis, out rotationAngle);
- rotationAxis.Normalize();
-
- //m_log.Error("SCENE OBJECT GROUP]: rotation axis is " + rotationAxis);
- Vector3 spinforce = new Vector3(rotationAxis.X, rotationAxis.Y, rotationAxis.Z);
- spinforce = (spinforce/8) * m_rootPart.PhysActor.Mass; // 8 is an arbitrary torque scaling factor
- m_rootPart.PhysActor.AddAngularForce(spinforce,true);
- m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
+ // save and update old orientation
+ Quaternion old = m_rootPart.SpinOldOrientation;
+ m_rootPart.SpinOldOrientation = newOrientation;
+ //m_log.Error("[SCENE OBJECT GROUP]: Old orientation is " + old);
+ //m_log.Error("[SCENE OBJECT GROUP]: Incoming new orientation is " + newOrientation);
+
+ // compute difference between previous old rotation and new incoming rotation
+ Quaternion minimalRotationFromQ1ToQ2 = Quaternion.Inverse(old) * newOrientation;
+
+ float rotationAngle;
+ Vector3 rotationAxis;
+ minimalRotationFromQ1ToQ2.GetAxisAngle(out rotationAxis, out rotationAngle);
+ rotationAxis.Normalize();
+
+ //m_log.Error("SCENE OBJECT GROUP]: rotation axis is " + rotationAxis);
+ Vector3 spinforce = new Vector3(rotationAxis.X, rotationAxis.Y, rotationAxis.Z);
+ spinforce = (spinforce / 8) * m_rootPart.PhysActor.Mass; // 8 is an arbitrary torque scaling factor
+ m_rootPart.PhysActor.AddAngularForce(spinforce, true);
+ m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
}
}
else
@@ -2948,14 +2464,14 @@ namespace OpenSim.Region.Framework.Scenes
if (selectionPart != null)
{
SceneObjectPart[] parts = m_parts.GetArray();
-
+
if (Scene != null)
{
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
- if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax ||
- part.Scale.Y > m_scene.RegionInfo.PhysPrimMax ||
+ if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax ||
+ part.Scale.Y > m_scene.RegionInfo.PhysPrimMax ||
part.Scale.Z > m_scene.RegionInfo.PhysPrimMax)
{
UsePhysics = false; // Reset physics
@@ -2964,16 +2480,8 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- RootPart.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
for (int i = 0; i < parts.Length; i++)
-<<<<<<< HEAD
- {
- if (parts[i] != RootPart)
- parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
- }
-=======
parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
}
}
@@ -2986,17 +2494,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
-
-
- ///
- /// Gets the number of parts
- ///
- ///
- public int GetPartCount()
- {
- return Parts.Count();
- }
-
///
/// Update the texture entry for this part
///
@@ -3051,37 +2548,10 @@ namespace OpenSim.Region.Framework.Scenes
///
public void GroupResize(Vector3 scale)
{
-<<<<<<< HEAD
- if (scale.X > m_scene.m_maxNonphys)
- scale.X = m_scene.m_maxNonphys;
- if (scale.Y > m_scene.m_maxNonphys)
- scale.Y = m_scene.m_maxNonphys;
- if (scale.Z > m_scene.m_maxNonphys)
- scale.Z = m_scene.m_maxNonphys;
- SceneObjectPart part = GetChildPart(localID);
- if (part != null)
- {
- if (part.PhysActor != null)
- {
- if (part.PhysActor.IsPhysical)
- {
- if (scale.X > m_scene.m_maxPhys)
- scale.X = m_scene.m_maxPhys;
- if (scale.Y > m_scene.m_maxPhys)
- scale.Y = m_scene.m_maxPhys;
- if (scale.Z > m_scene.m_maxPhys)
- scale.Z = m_scene.m_maxPhys;
- }
- part.PhysActor.Size = scale;
- m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
- }
- part.Resize(scale);
-=======
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
RootPart.StoreUndoState(true);
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
scale.X = Math.Min(scale.X, Scene.m_maxNonphys);
scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys);
@@ -3094,35 +2564,9 @@ namespace OpenSim.Region.Framework.Scenes
scale.Z = Math.Min(scale.Z, Scene.m_maxPhys);
}
-<<<<<<< HEAD
- public void GroupResize(Vector3 scale, uint localID)
- {
- SceneObjectPart part = GetChildPart(localID);
- if (part != null)
- {
- if (scale.X > m_scene.m_maxNonphys)
- scale.X = m_scene.m_maxNonphys;
- if (scale.Y > m_scene.m_maxNonphys)
- scale.Y = m_scene.m_maxNonphys;
- if (scale.Z > m_scene.m_maxNonphys)
- scale.Z = m_scene.m_maxNonphys;
- if (part.PhysActor != null && part.PhysActor.IsPhysical)
- {
- if (scale.X > m_scene.m_maxPhys)
- scale.X = m_scene.m_maxPhys;
- if (scale.Y > m_scene.m_maxPhys)
- scale.Y = m_scene.m_maxPhys;
- if (scale.Z > m_scene.m_maxPhys)
- scale.Z = m_scene.m_maxPhys;
- }
- float x = (scale.X / part.Scale.X);
- float y = (scale.Y / part.Scale.Y);
- float z = (scale.Z / part.Scale.Z);
-=======
float x = (scale.X / RootPart.Scale.X);
float y = (scale.Y / RootPart.Scale.Y);
float z = (scale.Z / RootPart.Scale.Z);
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
SceneObjectPart[] parts;
if (x > 1.0f || y > 1.0f || z > 1.0f)
@@ -3133,7 +2577,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart obPart = parts[i];
if (obPart.UUID != m_rootPart.UUID)
{
-// obPart.IgnoreUndoUpdate = true;
+ // obPart.IgnoreUndoUpdate = true;
Vector3 oldSize = new Vector3(obPart.Scale);
float f = 1.0f;
@@ -3161,72 +2605,17 @@ namespace OpenSim.Region.Framework.Scenes
if (oldSize.Z * z > m_scene.m_maxPhys)
{
-<<<<<<< HEAD
- if (oldSize.X*x > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.X;
- a = f / x;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Y*y > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.Y;
- a = f / y;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Z*z > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.Z;
- a = f / z;
- x *= a;
- y *= a;
- z *= a;
- }
-=======
f = m_scene.m_maxPhys / oldSize.Z;
a = f / z;
x *= a;
y *= a;
z *= a;
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
}
}
else
{
if (oldSize.X * x > m_scene.m_maxNonphys)
{
-<<<<<<< HEAD
- if (oldSize.X*x > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.X;
- a = f / x;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Y*y > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.Y;
- a = f / y;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Z*z > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.Z;
- a = f / z;
- x *= a;
- y *= a;
- z *= a;
- }
- }
- obPart.IgnoreUndoUpdate = false;
-=======
f = m_scene.m_maxNonphys / oldSize.X;
a = f / x;
x *= a;
@@ -3251,35 +2640,21 @@ namespace OpenSim.Region.Framework.Scenes
y *= a;
z *= a;
}
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
}
-// obPart.IgnoreUndoUpdate = false;
+ // obPart.IgnoreUndoUpdate = false;
}
}
}
-<<<<<<< HEAD
- Vector3 prevScale = part.Scale;
- prevScale.X *= x;
- prevScale.Y *= y;
- prevScale.Z *= z;;
-
- part.IgnoreUndoUpdate = false;
- part.StoreUndoState(UndoType.STATE_GROUP_SCALE);
- part.IgnoreUndoUpdate = true;
- part.Resize(prevScale);
- part.IgnoreUndoUpdate = false;
-=======
Vector3 prevScale = RootPart.Scale;
prevScale.X *= x;
prevScale.Y *= y;
prevScale.Z *= z;
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
-// RootPart.IgnoreUndoUpdate = true;
+ // RootPart.IgnoreUndoUpdate = true;
RootPart.Resize(prevScale);
-// RootPart.IgnoreUndoUpdate = false;
+ // RootPart.IgnoreUndoUpdate = false;
parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
@@ -3289,32 +2664,6 @@ namespace OpenSim.Region.Framework.Scenes
if (obPart.UUID != m_rootPart.UUID)
{
obPart.IgnoreUndoUpdate = true;
-<<<<<<< HEAD
- if (obPart.UUID != m_rootPart.UUID)
- {
- if (obPart.UUID != m_rootPart.UUID)
- {
- obPart.IgnoreUndoUpdate = false;
- obPart.StoreUndoState(UndoType.STATE_GROUP_SCALE);
- obPart.IgnoreUndoUpdate = true;
-
- Vector3 currentpos = new Vector3(obPart.OffsetPosition);
- currentpos.X *= x;
- currentpos.Y *= y;
- currentpos.Z *= z;
- Vector3 newSize = new Vector3(obPart.Scale);
- newSize.X *= x;
- newSize.Y *= y;
- newSize.Z *= z;
- obPart.Resize(newSize);
- obPart.UpdateOffSet(currentpos);
- }
- obPart.IgnoreUndoUpdate = false;
- }
- obPart.IgnoreUndoUpdate = false;
- }
-=======
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
Vector3 currentpos = new Vector3(obPart.OffsetPosition);
currentpos.X *= x;
@@ -3329,22 +2678,15 @@ namespace OpenSim.Region.Framework.Scenes
obPart.Resize(newSize);
obPart.UpdateOffSet(currentpos);
- obPart.IgnoreUndoUpdate = false;
+ obPart.IgnoreUndoUpdate = false;
}
-<<<<<<< HEAD
- part.IgnoreUndoUpdate = false;
- HasGroupChanged = true;
- m_rootPart.TriggerScriptChangedEvent(Changed.SCALE);
- ScheduleGroupForTerseUpdate();
-=======
-// obPart.IgnoreUndoUpdate = false;
-// obPart.StoreUndoState();
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
+ // obPart.IgnoreUndoUpdate = false;
+ // obPart.StoreUndoState();
}
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Finished group resizing {0} {1} to {2}", Name, LocalId, RootPart.Scale);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Finished group resizing {0} {1} to {2}", Name, LocalId, RootPart.Scale);
}
#endregion
@@ -3357,22 +2699,18 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupPosition(Vector3 pos)
{
-<<<<<<< HEAD
-=======
-// m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos);
+ // m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos);
RootPart.StoreUndoState(true);
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
+ // SceneObjectPart[] parts = m_parts.GetArray();
+ // for (int i = 0; i < parts.Length; i++)
+ // parts[i].StoreUndoState();
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
{
if (IsAttachment)
{
- m_rootPart.StoreUndoState(UndoType.STATE_GROUP_POSITION);
m_rootPart.AttachedPos = pos;
}
if (RootPart.GetStatusSandbox())
@@ -3404,20 +2742,14 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = GetChildPart(localID);
-<<<<<<< HEAD
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_PRIM_POSITION);
-=======
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
+ // SceneObjectPart[] parts = m_parts.GetArray();
+ // for (int i = 0; i < parts.Length; i++)
+ // parts[i].StoreUndoState();
if (part != null)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos);
part.StoreUndoState(false);
part.IgnoreUndoUpdate = true;
@@ -3442,18 +2774,12 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateRootPosition(Vector3 pos)
{
-<<<<<<< HEAD
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_PRIM_POSITION);
-=======
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating root position of {0} {1} to {2}", Name, LocalId, pos);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Updating root position of {0} {1} to {2}", Name, LocalId, pos);
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
+ // SceneObjectPart[] parts = m_parts.GetArray();
+ // for (int i = 0; i < parts.Length; i++)
+ // parts[i].StoreUndoState();
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
Vector3 oldPos =
@@ -3474,27 +2800,10 @@ namespace OpenSim.Region.Framework.Scenes
obPart.OffsetPosition = obPart.OffsetPosition + diff;
}
- //We have to set undoing here because otherwise an undo state will be saved
- if (!m_rootPart.Undoing)
- {
- m_rootPart.Undoing = true;
- AbsolutePosition = newPos;
- m_rootPart.Undoing = false;
- }
- else
- {
- AbsolutePosition = newPos;
- }
+ AbsolutePosition = newPos;
HasGroupChanged = true;
- if (m_rootPart.Undoing)
- {
- ScheduleGroupForFullUpdate();
- }
- else
- {
- ScheduleGroupForTerseUpdate();
- }
+ ScheduleGroupForTerseUpdate();
}
public void OffsetForNewRegion(Vector3 offset)
@@ -3512,20 +2821,14 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupRotationR(Quaternion rot)
{
-<<<<<<< HEAD
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_GROUP_ROTATION);
-=======
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating group rotation R of {0} {1} to {2}", Name, LocalId, rot);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Updating group rotation R of {0} {1} to {2}", Name, LocalId, rot);
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
+ // SceneObjectPart[] parts = m_parts.GetArray();
+ // for (int i = 0; i < parts.Length; i++)
+ // parts[i].StoreUndoState();
m_rootPart.StoreUndoState(true);
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
m_rootPart.UpdateRotation(rot);
@@ -3547,21 +2850,15 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot)
{
-<<<<<<< HEAD
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_GROUP_ROTATION);
-=======
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating group rotation PR of {0} {1} to {2}", Name, LocalId, rot);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Updating group rotation PR of {0} {1} to {2}", Name, LocalId, rot);
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
+ // SceneObjectPart[] parts = m_parts.GetArray();
+ // for (int i = 0; i < parts.Length; i++)
+ // parts[i].StoreUndoState();
RootPart.StoreUndoState(true);
RootPart.IgnoreUndoUpdate = true;
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
m_rootPart.UpdateRotation(rot);
@@ -3588,14 +2885,15 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdateSingleRotation(Quaternion rot, uint localID)
{
SceneObjectPart part = GetChildPart(localID);
+
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_PRIM_ROTATION);
+ parts[i].StoreUndoState();
if (part != null)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating single rotation of {0} {1} to {2}", part.Name, part.LocalId, rot);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Updating single rotation of {0} {1} to {2}", part.Name, part.LocalId, rot);
if (part.UUID == m_rootPart.UUID)
{
@@ -3618,9 +2916,9 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}",
-// part.Name, part.LocalId, rot);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}",
+ // part.Name, part.LocalId, rot);
part.StoreUndoState();
part.IgnoreUndoUpdate = true;
@@ -3628,29 +2926,12 @@ namespace OpenSim.Region.Framework.Scenes
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
- if (!m_rootPart.Undoing)
- {
- m_rootPart.Undoing = true;
- AbsolutePosition = pos;
- m_rootPart.Undoing = false;
- }
- else
- {
- AbsolutePosition = pos;
- }
+ AbsolutePosition = pos;
}
else
{
-<<<<<<< HEAD
- part.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
- part.IgnoreUndoUpdate = true;
- part.UpdateRotation(rot);
- part.OffsetPosition = pos;
- part.IgnoreUndoUpdate = false;
-=======
part.UpdateRotation(rot);
part.OffsetPosition = pos;
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
}
part.IgnoreUndoUpdate = false;
@@ -3663,23 +2944,15 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateRootRotation(Quaternion rot)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}",
-// Name, LocalId, rot);
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}",
+ // Name, LocalId, rot);
Quaternion axRot = rot;
Quaternion oldParentRot = m_rootPart.RotationOffset;
- m_rootPart.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
- bool cancelUndo = false;
- if (!m_rootPart.Undoing)
- {
- m_rootPart.Undoing = true;
- cancelUndo = true;
- }
-
- //Don't use UpdateRotation because it schedules an update prematurely
- m_rootPart.RotationOffset = rot;
+ m_rootPart.StoreUndoState();
+ m_rootPart.UpdateRotation(rot);
if (m_rootPart.PhysActor != null)
{
m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset;
@@ -3694,24 +2967,9 @@ namespace OpenSim.Region.Framework.Scenes
{
prim.IgnoreUndoUpdate = true;
Vector3 axPos = prim.OffsetPosition;
-
axPos *= oldParentRot;
axPos *= Quaternion.Inverse(axRot);
prim.OffsetPosition = axPos;
-<<<<<<< HEAD
-
- prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset);
-
- prim.IgnoreUndoUpdate = false;
- }
- }
- if (cancelUndo == true)
- {
- m_rootPart.Undoing = false;
- }
- HasGroupChanged = true;
- ScheduleGroupForFullUpdate();
-=======
Quaternion primsRot = prim.RotationOffset;
Quaternion newRot = primsRot * oldParentRot;
newRot *= Quaternion.Inverse(axRot);
@@ -3721,22 +2979,21 @@ namespace OpenSim.Region.Framework.Scenes
}
}
-// for (int i = 0; i < parts.Length; i++)
-// {
-// SceneObjectPart childpart = parts[i];
-// if (childpart != m_rootPart)
-// {
-//// childpart.IgnoreUndoUpdate = false;
-//// childpart.StoreUndoState();
-// }
-// }
+ // for (int i = 0; i < parts.Length; i++)
+ // {
+ // SceneObjectPart childpart = parts[i];
+ // if (childpart != m_rootPart)
+ // {
+ //// childpart.IgnoreUndoUpdate = false;
+ //// childpart.StoreUndoState();
+ // }
+ // }
m_rootPart.ScheduleTerseUpdate();
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updated root rotation of {0} {1} to {2}",
-// Name, LocalId, rot);
->>>>>>> 9f75eaf50e42ef6409fc272ba33a817241907ed8
+ // m_log.DebugFormat(
+ // "[SCENE OBJECT GROUP]: Updated root rotation of {0} {1} to {2}",
+ // Name, LocalId, rot);
}
#endregion
@@ -3807,7 +3064,7 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.AddGroupTarget(this);
return (int)handle;
}
-
+
public void unregisterTargetWaypoint(int handle)
{
lock (m_targets)
@@ -3848,14 +3105,14 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+
if (atTargets.Count > 0)
{
SceneObjectPart[] parts = m_parts.GetArray();
uint[] localids = new uint[parts.Length];
for (int i = 0; i < parts.Length; i++)
localids[i] = parts[i].LocalId;
-
+
for (int ctr = 0; ctr < localids.Length; ctr++)
{
foreach (uint target in atTargets.Keys)
@@ -3865,10 +3122,10 @@ namespace OpenSim.Region.Framework.Scenes
localids[ctr], att.handle, att.targetPos, m_rootPart.GroupPosition);
}
}
-
+
return;
}
-
+
if (m_scriptListens_notAtTarget && !at_target)
{
//trigger not_at_target
@@ -3876,7 +3133,7 @@ namespace OpenSim.Region.Framework.Scenes
uint[] localids = new uint[parts.Length];
for (int i = 0; i < parts.Length; i++)
localids[i] = parts[i].LocalId;
-
+
for (int ctr = 0; ctr < localids.Length; ctr++)
{
m_scene.EventManager.TriggerNotAtTargetEvent(localids[ctr]);
@@ -3956,10 +3213,11 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+
public float GetMass()
{
float retmass = 0f;
+
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
retmass += parts[i].GetMass();
@@ -3982,7 +3240,7 @@ namespace OpenSim.Region.Framework.Scenes
if ((RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0)
return;
-// m_log.Debug("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
+ // m_log.Debug("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
SceneObjectPart[] parts = m_parts.GetArray();
@@ -4016,14 +3274,14 @@ namespace OpenSim.Region.Framework.Scenes
for (int i = 0; i < parts.Length; i++)
parts[i].TriggerScriptChangedEvent(val);
}
-
+
public override string ToString()
{
return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition);
}
#region ISceneObject
-
+
public virtual ISceneObject CloneForNewScene()
{
SceneObjectGroup sog = Copy(false);
@@ -4053,14 +3311,6 @@ namespace OpenSim.Region.Framework.Scenes
SetFromItemID(uuid);
}
- public void ResetOwnerChangeFlag()
- {
- ForEachPart(delegate(SceneObjectPart part)
- {
- part.ResetOwnerChangeFlag();
- });
- }
-
#endregion
}
-}
+}
\ No newline at end of file
--
cgit v1.1
From af59352c4c6b1b49151c009058d867f5ccca3010 Mon Sep 17 00:00:00 2001
From: Tom
Date: Sun, 4 Sep 2011 07:54:17 -0700
Subject: Change of tactic. Reverting this to the careminster version, then
i'll selectively merge the changes made to core.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 1752 +++++++++++++-------
1 file changed, 1117 insertions(+), 635 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5762717..6c47645 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -24,11 +24,12 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
+using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Xml;
@@ -105,8 +106,29 @@ namespace OpenSim.Region.Framework.Scenes
/// since the group's last persistent backup
///
private bool m_hasGroupChanged = false;
- private long timeFirstChanged;
- private long timeLastChanged;
+ private long timeFirstChanged = 0;
+ private long timeLastChanged = 0;
+ private long m_maxPersistTime = 0;
+ private long m_minPersistTime = 0;
+ private Random m_rand;
+ private bool m_suspendUpdates;
+ private List m_linkedAvatars = new List();
+
+ public bool areUpdatesSuspended
+ {
+ get
+ {
+ return m_suspendUpdates;
+ }
+ set
+ {
+ m_suspendUpdates = value;
+ if (!value)
+ {
+ QueueForUpdateCheck();
+ }
+ }
+ }
public bool HasGroupChanged
{
@@ -114,24 +136,54 @@ namespace OpenSim.Region.Framework.Scenes
{
if (value)
{
+ if (m_isBackedUp)
+ {
+ m_scene.SceneGraph.FireChangeBackup(this);
+ }
timeLastChanged = DateTime.Now.Ticks;
if (!m_hasGroupChanged)
timeFirstChanged = DateTime.Now.Ticks;
+ if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null)
+ {
+ if (m_rand == null)
+ {
+ byte[] val = new byte[16];
+ m_rootPart.UUID.ToBytes(val, 0);
+ m_rand = new Random(BitConverter.ToInt32(val, 0));
+ }
+
+ if (m_scene.GetRootAgentCount() == 0)
+ {
+ //If the region is empty, this change has been made by an automated process
+ //and thus we delay the persist time by a random amount between 1.5 and 2.5.
+
+ float factor = 1.5f + (float)(m_rand.NextDouble());
+ m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor);
+ m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor);
+ }
+ else
+ {
+ //If the region is not empty, we want to obey the minimum and maximum persist times
+ //but add a random factor so we stagger the object persistance a little
+ m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
+ m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
+ }
+ }
}
m_hasGroupChanged = value;
-
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: HasGroupChanged set to {0} for {1} {2}", m_hasGroupChanged, Name, LocalId);
+
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: HasGroupChanged set to {0} for {1} {2}", m_hasGroupChanged, Name, LocalId);
}
get { return m_hasGroupChanged; }
}
-
+
///
/// Has the group changed due to an unlink operation? We record this in order to optimize deletion, since
/// an unlinked group currently has to be persisted to the database before we can perform an unlink operation.
///
- public bool HasGroupChangedDueToDelink { get; private set; }
+ public bool HasGroupChangedDueToDelink { get; set; }
private bool isTimeToPersist()
{
@@ -141,94 +193,43 @@ namespace OpenSim.Region.Framework.Scenes
return false;
if (m_scene.ShuttingDown)
return true;
+
+ if (m_minPersistTime == 0 || m_maxPersistTime == 0)
+ {
+ m_maxPersistTime = m_scene.m_persistAfter;
+ m_minPersistTime = m_scene.m_dontPersistBefore;
+ }
+
long currentTime = DateTime.Now.Ticks;
- if (currentTime - timeLastChanged > m_scene.m_dontPersistBefore || currentTime - timeFirstChanged > m_scene.m_persistAfter)
+
+ if (timeLastChanged == 0) timeLastChanged = currentTime;
+ if (timeFirstChanged == 0) timeFirstChanged = currentTime;
+
+ if (currentTime - timeLastChanged > m_minPersistTime || currentTime - timeFirstChanged > m_maxPersistTime)
return true;
return false;
}
-
- ///
+
+ ///
/// Is this scene object acting as an attachment?
- ///
- public bool IsAttachment { get; set; }
-
- ///
- /// The avatar to which this scene object is attached.
- ///
- ///
- /// If we're not attached to an avatar then this is UUID.Zero
- ///
- public UUID AttachedAvatar { get; set; }
-
- ///
- /// Attachment point of this scene object to an avatar.
- ///
- ///
- /// 0 if we're not attached to anything
- ///
- public uint AttachmentPoint
+ ///
+ /// 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).
+ ///
+ public bool IsAttachment
{
get
{
- return m_rootPart.Shape.State;
- }
-
- set
- {
- IsAttachment = value != 0;
- m_rootPart.Shape.State = (byte)value;
+ if (!IsDeleted)
+ return m_rootPart.IsAttachment;
+
+ return false;
}
}
- public void ClearPartAttachmentData()
- {
- AttachmentPoint = 0;
-
- // Even though we don't use child part state parameters for attachments any more, we still need to set
- // these to zero since having them non-zero in rezzed scene objects will crash some clients. Even if
- // we store them correctly, scene objects that we receive from elsewhere might not.
- foreach (SceneObjectPart part in Parts)
- part.Shape.State = 0;
- }
-
- ///
- /// Is this scene object phantom?
- ///
- ///
- /// Updating must currently take place through UpdatePrimFlags()
- ///
- public bool IsPhantom
- {
- get { return (RootPart.Flags & PrimFlags.Phantom) != 0; }
- }
-
- ///
- /// Does this scene object use physics?
- ///
- ///
- /// Updating must currently take place through UpdatePrimFlags()
- ///
- public bool UsesPhysics
- {
- get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
- }
-
- ///
- /// Is this scene object temporary?
- ///
- ///
- /// Updating must currently take place through UpdatePrimFlags()
- ///
- public bool IsTemporary
- {
- get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
- }
-
- public bool IsVolumeDetect
- {
- get { return RootPart.VolumeDetectActive; }
- }
-
public float scriptScore;
private Vector3 lastPhysGroupPos;
@@ -247,10 +248,10 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_scriptListens_atTarget;
private bool m_scriptListens_notAtTarget;
-
private bool m_scriptListens_atRotTarget;
private bool m_scriptListens_notAtRotTarget;
+ public bool m_dupeInProgress = false;
internal Dictionary m_savedScriptState;
#region Properties
@@ -260,7 +261,11 @@ namespace OpenSim.Region.Framework.Scenes
///
public override string Name
{
- get { return RootPart.Name; }
+ get {
+ if (RootPart == null)
+ return String.Empty;
+ return RootPart.Name;
+ }
set { RootPart.Name = value; }
}
@@ -286,7 +291,13 @@ namespace OpenSim.Region.Framework.Scenes
public virtual Quaternion Rotation
{
get { return m_rotation; }
- set { m_rotation = value; }
+ set {
+ foreach(SceneObjectPart p in m_parts.GetArray())
+ {
+ p.StoreUndoState(UndoType.STATE_GROUP_ROTATION);
+ }
+ m_rotation = value;
+ }
}
public Quaternion GroupRotation
@@ -294,38 +305,6 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_rootPart.RotationOffset; }
}
- public Vector3 GroupScale
- {
- get
- {
- Vector3 minScale = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionSize);
- Vector3 maxScale = Vector3.Zero;
- Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
-
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- {
- SceneObjectPart part = parts[i];
- Vector3 partscale = part.Scale;
- Vector3 partoffset = part.OffsetPosition;
-
- minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X;
- minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.Y + partoffset.Y : minScale.Y;
- minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z;
-
- maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X;
- maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y;
- maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z;
- }
-
- finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
- finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
- finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
-
- return finalScale;
- }
- }
-
public UUID GroupID
{
get { return m_rootPart.GroupID; }
@@ -365,19 +344,17 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Check both the attachment property and the relevant properties of the underlying root part.
///
- ///
/// 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.
- ///
///
public bool IsAttachmentCheckFull()
{
return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0));
}
-
+
///
/// The absolute position of this scene object in the scene
///
@@ -391,30 +368,55 @@ namespace OpenSim.Region.Framework.Scenes
if (Scene != null)
{
if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
- || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
+ || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
}
}
+ foreach (SceneObjectPart part in m_parts.GetArray())
+ {
+ part.IgnoreUndoUpdate = true;
+ }
if (RootPart.GetStatusSandbox())
{
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
{
RootPart.ScriptSetPhysicsStatus(false);
-
+
if (Scene != null)
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
-
+
return;
}
}
-
SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].GroupPosition = val;
+ foreach (SceneObjectPart part in parts)
+ {
+ part.IgnoreUndoUpdate = false;
+ part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
+ part.GroupPosition = val;
+ if (!m_dupeInProgress)
+ {
+ part.TriggerScriptChangedEvent(Changed.POSITION);
+ }
+ }
+ if (!m_dupeInProgress)
+ {
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ SceneObjectPart p;
+ if (m_parts.TryGetValue(av.LinkedPrim, out p))
+ {
+ Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
+ av.AbsolutePosition += offset;
+ av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
+ av.SendAvatarDataToAllAgents();
+ }
+ }
+ }
//if (m_rootPart.PhysActor != null)
//{
@@ -423,7 +425,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_rootPart.GroupPosition.Z);
//m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
//}
-
+
if (Scene != null)
Scene.EventManager.TriggerParcelPrimCountTainted();
}
@@ -438,7 +440,7 @@ namespace OpenSim.Region.Framework.Scenes
public override UUID UUID
{
get { return m_rootPart.UUID; }
- set
+ set
{
lock (m_parts.SyncRoot)
{
@@ -469,10 +471,9 @@ namespace OpenSim.Region.Framework.Scenes
public string Text
{
- get
- {
+ get {
string returnstr = m_rootPart.Text;
- if (returnstr.Length > 255)
+ if (returnstr.Length > 255)
{
returnstr = returnstr.Substring(0, 255);
}
@@ -485,7 +486,7 @@ namespace OpenSim.Region.Framework.Scenes
{
get { return true; }
}
-
+
private bool m_passCollision;
public bool PassCollision
{
@@ -562,10 +563,10 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
- // ~SceneObjectGroup()
- // {
- // m_log.DebugFormat("[SCENE OBJECT GROUP]: Destructor called for {0}, local id {1}", Name, LocalId);
- // }
+// ~SceneObjectGroup()
+// {
+// m_log.DebugFormat("[SCENE OBJECT GROUP]: Destructor called for {0}, local id {1}", Name, LocalId);
+// }
#region Constructors
@@ -574,6 +575,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectGroup()
{
+
}
///
@@ -617,7 +619,7 @@ namespace OpenSim.Region.Framework.Scenes
if (itemid != UUID.Zero)
m_savedScriptState[itemid] = node.InnerXml;
}
- }
+ }
}
}
@@ -638,6 +640,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public virtual void AttachToBackup()
{
+ if (IsAttachment) return;
+ m_scene.SceneGraph.FireAttachToBackup(this);
+
if (InSceneBackup)
{
//m_log.DebugFormat(
@@ -645,11 +650,11 @@ namespace OpenSim.Region.Framework.Scenes
if (!m_isBackedUp)
m_scene.EventManager.OnBackup += ProcessBackup;
-
+
m_isBackedUp = true;
}
}
-
+
///
/// Attach this object to a scene. It will also now appear to agents.
///
@@ -677,14 +682,45 @@ namespace OpenSim.Region.Framework.Scenes
part.ParentID = m_rootPart.LocalId;
//m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
}
-
+
ApplyPhysics(m_scene.m_physicalPrim);
+ if (RootPart.PhysActor != null)
+ RootPart.Buoyancy = RootPart.Buoyancy;
+
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
// for the same object with very different properties. The caller must schedule the update.
//ScheduleGroupForFullUpdate();
}
+ public Vector3 GroupScale()
+ {
+ Vector3 minScale = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionSize);
+ Vector3 maxScale = Vector3.Zero;
+ Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
+
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ {
+ SceneObjectPart part = parts[i];
+ Vector3 partscale = part.Scale;
+ Vector3 partoffset = part.OffsetPosition;
+
+ minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X;
+ minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.Y + partoffset.Y : minScale.Y;
+ minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z;
+
+ maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X;
+ maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y;
+ maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z;
+ }
+
+ finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
+ finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
+ finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
+ return finalScale;
+
+ }
public EntityIntersection TestIntersection(Ray hRay, bool frontFacesOnly, bool faceCenters)
{
// We got a request from the inner_scene to raytrace along the Ray hRay
@@ -725,9 +761,9 @@ namespace OpenSim.Region.Framework.Scenes
result.normal = inter.normal;
result.distance = inter.distance;
}
+
}
}
-
return result;
}
@@ -747,17 +783,19 @@ namespace OpenSim.Region.Framework.Scenes
minZ = 8192f;
SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
+ foreach (SceneObjectPart part in parts)
{
- SceneObjectPart part = parts[i];
-
Vector3 worldPos = part.GetWorldPosition();
Vector3 offset = worldPos - AbsolutePosition;
Quaternion worldRot;
if (part.ParentID == 0)
+ {
worldRot = part.RotationOffset;
+ }
else
+ {
worldRot = part.GetWorldRotation();
+ }
Vector3 frontTopLeft;
Vector3 frontTopRight;
@@ -769,6 +807,8 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 backBottomLeft;
Vector3 backBottomRight;
+ // Vector3[] corners = new Vector3[8];
+
Vector3 orig = Vector3.Zero;
frontTopLeft.X = orig.X - (part.Scale.X / 2);
@@ -803,6 +843,38 @@ namespace OpenSim.Region.Framework.Scenes
backBottomRight.Y = orig.Y + (part.Scale.Y / 2);
backBottomRight.Z = orig.Z - (part.Scale.Z / 2);
+
+
+ //m_log.InfoFormat("pre corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z);
+ //m_log.InfoFormat("pre corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z);
+ //m_log.InfoFormat("pre corner 3 is {0} {1} {2}", frontBottomRight.X, frontBottomRight.Y, frontBottomRight.Z);
+ //m_log.InfoFormat("pre corner 4 is {0} {1} {2}", frontBottomLeft.X, frontBottomLeft.Y, frontBottomLeft.Z);
+ //m_log.InfoFormat("pre corner 5 is {0} {1} {2}", backTopLeft.X, backTopLeft.Y, backTopLeft.Z);
+ //m_log.InfoFormat("pre corner 6 is {0} {1} {2}", backTopRight.X, backTopRight.Y, backTopRight.Z);
+ //m_log.InfoFormat("pre corner 7 is {0} {1} {2}", backBottomRight.X, backBottomRight.Y, backBottomRight.Z);
+ //m_log.InfoFormat("pre corner 8 is {0} {1} {2}", backBottomLeft.X, backBottomLeft.Y, backBottomLeft.Z);
+
+ //for (int i = 0; i < 8; i++)
+ //{
+ // corners[i] = corners[i] * worldRot;
+ // corners[i] += offset;
+
+ // if (corners[i].X > maxX)
+ // maxX = corners[i].X;
+ // if (corners[i].X < minX)
+ // minX = corners[i].X;
+
+ // if (corners[i].Y > maxY)
+ // maxY = corners[i].Y;
+ // if (corners[i].Y < minY)
+ // minY = corners[i].Y;
+
+ // if (corners[i].Z > maxZ)
+ // maxZ = corners[i].Y;
+ // if (corners[i].Z < minZ)
+ // minZ = corners[i].Z;
+ //}
+
frontTopLeft = frontTopLeft * worldRot;
frontTopRight = frontTopRight * worldRot;
frontBottomLeft = frontBottomLeft * worldRot;
@@ -824,6 +896,15 @@ namespace OpenSim.Region.Framework.Scenes
backTopLeft += offset;
backTopRight += offset;
+ //m_log.InfoFormat("corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z);
+ //m_log.InfoFormat("corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z);
+ //m_log.InfoFormat("corner 3 is {0} {1} {2}", frontBottomRight.X, frontBottomRight.Y, frontBottomRight.Z);
+ //m_log.InfoFormat("corner 4 is {0} {1} {2}", frontBottomLeft.X, frontBottomLeft.Y, frontBottomLeft.Z);
+ //m_log.InfoFormat("corner 5 is {0} {1} {2}", backTopLeft.X, backTopLeft.Y, backTopLeft.Z);
+ //m_log.InfoFormat("corner 6 is {0} {1} {2}", backTopRight.X, backTopRight.Y, backTopRight.Z);
+ //m_log.InfoFormat("corner 7 is {0} {1} {2}", backBottomRight.X, backBottomRight.Y, backBottomRight.Z);
+ //m_log.InfoFormat("corner 8 is {0} {1} {2}", backBottomLeft.X, backBottomLeft.Y, backBottomLeft.Z);
+
if (frontTopRight.X > maxX)
maxX = frontTopRight.X;
if (frontTopLeft.X > maxX)
@@ -961,7 +1042,7 @@ namespace OpenSim.Region.Framework.Scenes
offsetHeight *= -1;
}
- // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z);
+ // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z);
return boundingBox;
}
@@ -969,15 +1050,20 @@ namespace OpenSim.Region.Framework.Scenes
public void SaveScriptedState(XmlTextWriter writer)
{
+ SaveScriptedState(writer, false);
+ }
+
+ public void SaveScriptedState(XmlTextWriter writer, bool oldIDs)
+ {
XmlDocument doc = new XmlDocument();
- Dictionary states = new Dictionary();
+ Dictionary states = new Dictionary();
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
- Dictionary pstates = parts[i].Inventory.GetScriptStates();
+ Dictionary pstates = parts[i].Inventory.GetScriptStates(oldIDs);
foreach (KeyValuePair kvp in pstates)
- states.Add(kvp.Key, kvp.Value);
+ states[kvp.Key] = kvp.Value;
}
if (states.Count > 0)
@@ -997,6 +1083,187 @@ namespace OpenSim.Region.Framework.Scenes
}
///
+ /// Add the avatar to this linkset (avatar is sat).
+ ///
+ ///
+ public void AddAvatar(UUID agentID)
+ {
+ ScenePresence presence;
+ if (m_scene.TryGetScenePresence(agentID, out presence))
+ {
+ if (!m_linkedAvatars.Contains(presence))
+ {
+ m_linkedAvatars.Add(presence);
+ }
+ }
+ }
+
+ ///
+ /// Delete the avatar from this linkset (avatar is unsat).
+ ///
+ ///
+ public void DeleteAvatar(UUID agentID)
+ {
+ ScenePresence presence;
+ if (m_scene.TryGetScenePresence(agentID, out presence))
+ {
+ if (m_linkedAvatars.Contains(presence))
+ {
+ m_linkedAvatars.Remove(presence);
+ }
+ }
+ }
+
+ ///
+ /// Returns the list of linked presences (avatars sat on this group)
+ ///
+ ///
+ public List GetLinkedAvatars()
+ {
+ return m_linkedAvatars;
+ }
+
+ ///
+ /// Attach this scene object to the given avatar.
+ ///
+ ///
+ ///
+ ///
+ public void AttachToAgent(UUID agentID, uint attachmentpoint, Vector3 AttachOffset, bool silent)
+ {
+ ScenePresence avatar = m_scene.GetScenePresence(agentID);
+ if (avatar != null)
+ {
+ // don't attach attachments to child agents
+ if (avatar.IsChildAgent) return;
+
+// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
+
+ DetachFromBackup();
+
+ // Remove from database and parcel prim count
+ m_scene.DeleteFromStorage(UUID);
+ m_scene.EventManager.TriggerParcelPrimCountTainted();
+
+ m_rootPart.AttachedAvatar = agentID;
+
+ //Anakin Lohner bug #3839
+ lock (m_parts)
+ {
+ foreach (SceneObjectPart p in m_parts.GetArray())
+ {
+ p.AttachedAvatar = agentID;
+ }
+ }
+
+ if (m_rootPart.PhysActor != null)
+ {
+ m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor);
+ m_rootPart.PhysActor = null;
+ }
+
+ AbsolutePosition = AttachOffset;
+ m_rootPart.AttachedPos = AttachOffset;
+ m_rootPart.IsAttachment = true;
+
+ m_rootPart.SetParentLocalId(avatar.LocalId);
+ SetAttachmentPoint(Convert.ToByte(attachmentpoint));
+
+ avatar.AddAttachment(this);
+
+ if (!silent)
+ {
+ // Killing it here will cause the client to deselect it
+ // It then reappears on the avatar, deselected
+ // through the full update below
+ //
+ if (IsSelected)
+ {
+ m_scene.SendKillObject(new List { m_rootPart.LocalId });
+ }
+
+ IsSelected = false; // fudge....
+ ScheduleGroupForFullUpdate();
+ }
+ }
+ else
+ {
+ m_log.WarnFormat(
+ "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present",
+ UUID, agentID, Scene.RegionInfo.RegionName);
+ }
+ }
+
+ public byte GetAttachmentPoint()
+ {
+ return m_rootPart.Shape.State;
+ }
+
+ public void ClearPartAttachmentData()
+ {
+ SetAttachmentPoint((Byte)0);
+ }
+
+ public void DetachToGround()
+ {
+ ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar);
+ if (avatar == null)
+ return;
+
+ avatar.RemoveAttachment(this);
+
+ Vector3 detachedpos = new Vector3(127f,127f,127f);
+ if (avatar == null)
+ return;
+
+ detachedpos = avatar.AbsolutePosition;
+ RootPart.FromItemID = UUID.Zero;
+
+ AbsolutePosition = detachedpos;
+ m_rootPart.AttachedAvatar = UUID.Zero;
+
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].AttachedAvatar = UUID.Zero;
+
+ m_rootPart.SetParentLocalId(0);
+ SetAttachmentPoint((byte)0);
+ m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_scene.m_physicalPrim);
+ HasGroupChanged = true;
+ RootPart.Rezzed = DateTime.Now;
+ RootPart.RemFlag(PrimFlags.TemporaryOnRez);
+ AttachToBackup();
+ m_scene.EventManager.TriggerParcelPrimCountTainted();
+ m_rootPart.ScheduleFullUpdate();
+ m_rootPart.ClearUndoState();
+ }
+
+ public void DetachToInventoryPrep()
+ {
+ ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar);
+ //Vector3 detachedpos = new Vector3(127f, 127f, 127f);
+ if (avatar != null)
+ {
+ //detachedpos = avatar.AbsolutePosition;
+ avatar.RemoveAttachment(this);
+ }
+
+ m_rootPart.AttachedAvatar = UUID.Zero;
+
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].AttachedAvatar = UUID.Zero;
+
+ m_rootPart.SetParentLocalId(0);
+ //m_rootPart.SetAttachmentPoint((byte)0);
+ m_rootPart.IsAttachment = false;
+ AbsolutePosition = m_rootPart.AttachedPos;
+ //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
+ //AttachToBackup();
+ //m_rootPart.ScheduleFullUpdate();
+ }
+
+ ///
///
///
///
@@ -1027,7 +1294,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_scene = scene;
}
-
+
///
/// Set a part to act as the root part for this scene object
///
@@ -1042,7 +1309,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!IsAttachment)
part.ParentID = 0;
part.LinkNum = 0;
-
+
m_parts.Add(m_rootPart.UUID, m_rootPart);
}
@@ -1053,8 +1320,11 @@ namespace OpenSim.Region.Framework.Scenes
public void AddPart(SceneObjectPart part)
{
part.SetParent(this);
- part.LinkNum = m_parts.Add(part.UUID, part);
- if (part.LinkNum == 2)
+ m_parts.Add(part.UUID, part);
+
+ part.LinkNum = m_parts.Count;
+
+ if (part.LinkNum == 2 && RootPart != null)
RootPart.LinkNum = 1;
}
@@ -1090,19 +1360,19 @@ namespace OpenSim.Region.Framework.Scenes
// justincc: I don't believe this hack is needed any longer, especially since the physics
// parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false
// this method was preventing proper reload of scene objects.
-
+
// dahlia: I had to uncomment it, without it meshing was failing on some prims and objects
// at region startup
-
+
// teravus: After this was removed from the linking algorithm, Linked prims no longer collided
// properly when non-physical if they havn't been moved. This breaks ALL builds.
// see: http://opensimulator.org/mantis/view.php?id=3108
-
+
// Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the
// position of linkset prims. IF YOU CHANGE THIS, YOU MUST TEST colliding with just linked and
// unmoved prims! As soon as you move a Prim/group, it will collide properly because Absolute
// Position has been set!
-
+
public void ResetChildPrimPhysicsPositions()
{
AbsolutePosition = AbsolutePosition; // could someone in the know please explain how this works?
@@ -1137,11 +1407,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void OnGrabPart(SceneObjectPart part, Vector3 offsetPos, IClientAPI remoteClient)
{
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Processing OnGrabPart for {0} on {1} {2}, offsetPos {3}",
- // remoteClient.Name, part.Name, part.LocalId, offsetPos);
-
- part.StoreUndoState();
+ part.StoreUndoState(UndoType.STATE_PRIM_ALL);
part.OnGrab(offsetPos, remoteClient);
}
@@ -1161,6 +1427,11 @@ namespace OpenSim.Region.Framework.Scenes
/// If true then deletion is not broadcast to clients
public void DeleteGroupFromScene(bool silent)
{
+ // We need to keep track of this state in case this group is still queued for backup.
+ m_isDeleted = true;
+
+ DetachFromBackup();
+
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
@@ -1172,13 +1443,11 @@ namespace OpenSim.Region.Framework.Scenes
avatar.StandUp();
if (!silent)
- {
part.UpdateFlag = 0;
- if (part == m_rootPart)
- avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
- }
});
}
+
+
}
public void AddScriptLPS(int count)
@@ -1238,10 +1507,10 @@ namespace OpenSim.Region.Framework.Scenes
public void SetText(string text, Vector3 color, double alpha)
{
- Color = Color.FromArgb(0xff - (int)(alpha * 0xff),
- (int)(color.X * 0xff),
- (int)(color.Y * 0xff),
- (int)(color.Z * 0xff));
+ Color = Color.FromArgb(0xff - (int) (alpha * 0xff),
+ (int) (color.X * 0xff),
+ (int) (color.Y * 0xff),
+ (int) (color.Z * 0xff));
Text = text;
HasGroupChanged = true;
@@ -1256,7 +1525,7 @@ namespace OpenSim.Region.Framework.Scenes
{
// Apply physics to the root prim
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim);
-
+
// Apply physics to child prims
SceneObjectPart[] parts = m_parts.GetArray();
if (parts.Length > 1)
@@ -1275,7 +1544,12 @@ namespace OpenSim.Region.Framework.Scenes
public void SetOwnerId(UUID userId)
{
- ForEachPart(delegate(SceneObjectPart part) { part.OwnerID = userId; });
+ ForEachPart(delegate(SceneObjectPart part)
+ {
+
+ part.OwnerID = userId;
+
+ });
}
public void ForEachPart(Action whatToDo)
@@ -1295,23 +1569,29 @@ namespace OpenSim.Region.Framework.Scenes
{
if (!m_isBackedUp)
{
- // m_log.DebugFormat(
- // "[WATER WARS]: Ignoring backup of {0} {1} since object is not marked to be backed up", Name, UUID);
+// m_log.DebugFormat(
+// "[WATER WARS]: Ignoring backup of {0} {1} since object is not marked to be backed up", Name, UUID);
return;
}
if (IsDeleted || UUID == UUID.Zero)
{
- // m_log.DebugFormat(
- // "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID);
+// m_log.DebugFormat(
+// "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID);
return;
}
+ if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)
+ return;
+
// Since this is the top of the section of call stack for backing up a particular scene object, don't let
// any exception propogate upwards.
try
{
- if (!m_scene.ShuttingDown) // if shutting down then there will be nothing to handle the return so leave till next restart
+ if (!m_scene.ShuttingDown || // if shutting down then there will be nothing to handle the return so leave till next restart
+ m_scene.LoginsDisabled || // We're starting up or doing maintenance, don't mess with things
+ m_scene.LoadingPrims) // Land may not be valid yet
+
{
ILandObject parcel = m_scene.LandChannel.GetLandObject(
m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
@@ -1328,7 +1608,7 @@ namespace OpenSim.Region.Framework.Scenes
{
DetachFromBackup();
m_log.DebugFormat(
- "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
+ "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
RootPart.UUID);
m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn");
m_scene.DeRezObjects(null, new List() { RootPart.LocalId }, UUID.Zero,
@@ -1338,6 +1618,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
+
}
if (m_scene.UseBackup && HasGroupChanged)
@@ -1345,9 +1626,23 @@ namespace OpenSim.Region.Framework.Scenes
// don't backup while it's selected or you're asking for changes mid stream.
if (isTimeToPersist() || forcedBackup)
{
- // m_log.DebugFormat(
- // "[SCENE]: Storing {0}, {1} in {2}",
- // Name, UUID, m_scene.RegionInfo.RegionName);
+ if (m_rootPart.PhysActor != null &&
+ (!m_rootPart.PhysActor.IsPhysical))
+ {
+ // Possible ghost prim
+ if (m_rootPart.PhysActor.Position != m_rootPart.GroupPosition)
+ {
+ foreach (SceneObjectPart part in m_parts.GetArray())
+ {
+ // Re-set physics actor positions and
+ // orientations
+ part.GroupPosition = m_rootPart.GroupPosition;
+ }
+ }
+ }
+// m_log.DebugFormat(
+// "[SCENE]: Storing {0}, {1} in {2}",
+// Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(false);
backup_group.RootPart.Velocity = RootPart.Velocity;
@@ -1360,25 +1655,25 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
- backup_group.ForEachPart(delegate(SceneObjectPart part)
- {
- part.Inventory.ProcessInventoryBackup(datastore);
+ backup_group.ForEachPart(delegate(SceneObjectPart part)
+ {
+ part.Inventory.ProcessInventoryBackup(datastore);
});
backup_group = null;
}
- // else
- // {
- // m_log.DebugFormat(
- // "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
- // Name, UUID, IsSelected);
- // }
+// else
+// {
+// m_log.DebugFormat(
+// "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}",
+// Name, UUID, IsSelected);
+// }
}
}
catch (Exception e)
{
m_log.ErrorFormat(
- "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}",
+ "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}",
Name, UUID, m_scene.RegionInfo.RegionName, e.Message, e.StackTrace);
}
}
@@ -1408,86 +1703,91 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectGroup Copy(bool userExposed)
{
- SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
- dupe.m_isBackedUp = false;
- dupe.m_parts = new MapAndArray();
+ SceneObjectGroup dupe;
+ try
+ {
+ m_dupeInProgress = true;
+ dupe = (SceneObjectGroup)MemberwiseClone();
+ dupe.m_isBackedUp = false;
+ dupe.m_parts = new MapAndArray();
- // Warning, The following code related to previousAttachmentStatus is needed so that clones of
- // attachments do not bordercross while they're being duplicated. This is hacktastic!
- // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
- // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
- // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
- // then restore it's attachment state
+ // Warning, The following code related to previousAttachmentStatus is needed so that clones of
+ // attachments do not bordercross while they're being duplicated. This is hacktastic!
+ // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
+ // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
+ // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
+ // then restore it's attachment state
- // This is only necessary when userExposed is false!
+ // This is only necessary when userExposed is false!
- bool previousAttachmentStatus = dupe.IsAttachment;
+ bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
- if (!userExposed)
- dupe.IsAttachment = true;
+ if (!userExposed)
+ dupe.RootPart.IsAttachment = true;
- dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
+ dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
- if (!userExposed)
- {
- dupe.IsAttachment = previousAttachmentStatus;
- }
+ if (!userExposed)
+ {
+ dupe.RootPart.IsAttachment = previousAttachmentStatus;
+ }
- dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
- dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
+ dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
+ dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
- if (userExposed)
- dupe.m_rootPart.TrimPermissions();
+ if (userExposed)
+ dupe.m_rootPart.TrimPermissions();
- List partList = new List(m_parts.GetArray());
+ List partList = new List(m_parts.GetArray());
- partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
- {
- return p1.LinkNum.CompareTo(p2.LinkNum);
- }
- );
+ partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
+ {
+ return p1.LinkNum.CompareTo(p2.LinkNum);
+ }
+ );
- foreach (SceneObjectPart part in partList)
- {
- SceneObjectPart newPart;
- if (part.UUID != m_rootPart.UUID)
+ foreach (SceneObjectPart part in partList)
{
- newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
- newPart.LinkNum = part.LinkNum;
- }
- else
- {
- newPart = dupe.m_rootPart;
- }
+ if (part.UUID != m_rootPart.UUID)
+ {
+ SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
- // Need to duplicate the physics actor as well
- if (part.PhysActor != null && userExposed)
- {
- PrimitiveBaseShape pbs = newPart.Shape;
+ newPart.LinkNum = part.LinkNum;
+ }
- newPart.PhysActor
- = m_scene.PhysicsScene.AddPrimShape(
- string.Format("{0}/{1}", newPart.Name, newPart.UUID),
- pbs,
- newPart.AbsolutePosition,
- newPart.Scale,
- newPart.RotationOffset,
- part.PhysActor.IsPhysical,
- newPart.LocalId);
+ // Need to duplicate the physics actor as well
+ if (part.PhysActor != null && userExposed)
+ {
+ PrimitiveBaseShape pbs = part.Shape;
+
+ part.PhysActor
+ = m_scene.PhysicsScene.AddPrimShape(
+ string.Format("{0}/{1}", part.Name, part.UUID),
+ pbs,
+ part.AbsolutePosition,
+ part.Scale,
+ part.RotationOffset,
+ part.PhysActor.IsPhysical,
+ m_localId);
+ part.PhysActor.SetMaterial((int)part.Material);
+
+ part.PhysActor.LocalID = part.LocalId;
+ part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
+ }
+ }
+ if (userExposed)
+ {
+ dupe.UpdateParentIDs();
+ dupe.HasGroupChanged = true;
+ dupe.AttachToBackup();
- newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
+ ScheduleGroupForFullUpdate();
}
}
-
- if (userExposed)
+ finally
{
- dupe.UpdateParentIDs();
- dupe.HasGroupChanged = true;
- dupe.AttachToBackup();
-
- ScheduleGroupForFullUpdate();
+ m_dupeInProgress = false;
}
-
return dupe;
}
@@ -1502,24 +1802,36 @@ namespace OpenSim.Region.Framework.Scenes
SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed));
}
- public void ScriptSetPhysicsStatus(bool usePhysics)
+ public void ScriptSetPhysicsStatus(bool UsePhysics)
{
- UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
+ bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
+ bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
+ bool IsVolumeDetect = RootPart.VolumeDetectActive;
+ UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
}
- public void ScriptSetTemporaryStatus(bool makeTemporary)
+ public void ScriptSetTemporaryStatus(bool TemporaryStatus)
{
- UpdatePrimFlags(RootPart.LocalId, UsesPhysics, makeTemporary, IsPhantom, IsVolumeDetect);
+ bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
+ bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
+ bool IsVolumeDetect = RootPart.VolumeDetectActive;
+ UpdatePrimFlags(RootPart.LocalId, UsePhysics, TemporaryStatus, IsPhantom, IsVolumeDetect);
}
- public void ScriptSetPhantomStatus(bool makePhantom)
+ public void ScriptSetPhantomStatus(bool PhantomStatus)
{
- UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, makePhantom, IsVolumeDetect);
+ bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
+ bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
+ bool IsVolumeDetect = RootPart.VolumeDetectActive;
+ UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, PhantomStatus, IsVolumeDetect);
}
- public void ScriptSetVolumeDetect(bool makeVolumeDetect)
+ public void ScriptSetVolumeDetect(bool VDStatus)
{
- UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, IsPhantom, makeVolumeDetect);
+ bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
+ bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
+ bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
+ UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, IsPhantom, VDStatus);
/*
ScriptSetPhantomStatus(false); // What ever it was before, now it's not phantom anymore
@@ -1537,93 +1849,182 @@ namespace OpenSim.Region.Framework.Scenes
public void applyImpulse(Vector3 impulse)
{
- if (IsAttachment)
+ // We check if rootpart is null here because scripts don't delete if you delete the host.
+ // This means that unfortunately, we can pass a null physics actor to Simulate!
+ // Make sure we don't do that!
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
{
- ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
- if (avatar != null)
+ if (IsAttachment)
{
- avatar.PushForce(impulse);
+ ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
+ if (avatar != null)
+ {
+ avatar.PushForce(impulse);
+ }
}
- }
- else
- {
- if (RootPart.PhysActor != null)
+ else
{
- RootPart.PhysActor.AddForce(impulse, true);
- m_scene.PhysicsScene.AddPhysicsActorTaint(RootPart.PhysActor);
+ if (rootpart.PhysActor != null)
+ {
+ rootpart.PhysActor.AddForce(impulse, true);
+ m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
+ }
}
}
}
public void applyAngularImpulse(Vector3 impulse)
{
- if (RootPart.PhysActor != null)
+ // We check if rootpart is null here because scripts don't delete if you delete the host.
+ // This means that unfortunately, we can pass a null physics actor to Simulate!
+ // Make sure we don't do that!
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
{
- if (!IsAttachment)
+ if (rootpart.PhysActor != null)
{
- RootPart.PhysActor.AddAngularForce(impulse, true);
- m_scene.PhysicsScene.AddPhysicsActorTaint(RootPart.PhysActor);
+ if (!IsAttachment)
+ {
+ rootpart.PhysActor.AddAngularForce(impulse, true);
+ m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
+ }
}
}
}
public void setAngularImpulse(Vector3 impulse)
{
- if (RootPart.PhysActor != null)
+ // We check if rootpart is null here because scripts don't delete if you delete the host.
+ // This means that unfortunately, we can pass a null physics actor to Simulate!
+ // Make sure we don't do that!
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
{
- if (!IsAttachment)
+ if (rootpart.PhysActor != null)
{
- RootPart.PhysActor.Torque = impulse;
- m_scene.PhysicsScene.AddPhysicsActorTaint(RootPart.PhysActor);
+ if (!IsAttachment)
+ {
+ rootpart.PhysActor.Torque = impulse;
+ m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
+ }
}
}
}
public Vector3 GetTorque()
{
- if (RootPart.PhysActor != null)
+ // We check if rootpart is null here because scripts don't delete if you delete the host.
+ // This means that unfortunately, we can pass a null physics actor to Simulate!
+ // Make sure we don't do that!
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
{
- if (!IsAttachment)
+ if (rootpart.PhysActor != null)
{
- Vector3 torque = RootPart.PhysActor.Torque;
- return torque;
+ if (!IsAttachment)
+ {
+ Vector3 torque = rootpart.PhysActor.Torque;
+ return torque;
+ }
}
}
-
return Vector3.Zero;
}
+ // This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object
public void moveToTarget(Vector3 target, float tau)
{
- if (IsAttachment)
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
{
- ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
- if (avatar != null)
+ if (IsAttachment)
{
- avatar.MoveToTarget(target, false);
+ ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
+ if (avatar != null)
+ {
+ List coords = new List();
+ uint regionX = 0;
+ uint regionY = 0;
+ Utils.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY);
+ target.X += regionX;
+ target.Y += regionY;
+ coords.Add(target.X.ToString());
+ coords.Add(target.Y.ToString());
+ coords.Add(target.Z.ToString());
+ avatar.DoMoveToPosition(avatar, "", coords);
+ }
}
- }
- else
- {
- if (RootPart.PhysActor != null)
+ else
{
- RootPart.PhysActor.PIDTarget = target;
- RootPart.PhysActor.PIDTau = tau;
- RootPart.PhysActor.PIDActive = true;
+ if (rootpart.PhysActor != null)
+ {
+ rootpart.PhysActor.PIDTarget = target;
+ rootpart.PhysActor.PIDTau = tau;
+ rootpart.PhysActor.PIDActive = true;
+ }
}
}
}
public void stopMoveToTarget()
{
- if (RootPart.PhysActor != null)
- RootPart.PhysActor.PIDActive = false;
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
+ {
+ if (IsAttachment)
+ {
+ ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
+ if (avatar != null) avatar.StopMoveToPosition();
+ }
+ else
+ {
+ if (rootpart.PhysActor != null)
+ {
+ rootpart.PhysActor.PIDActive = false;
+ }
+ }
+ }
+ }
+
+ public void rotLookAt(Quaternion target, float strength, float damping)
+ {
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
+ {
+ if (IsAttachment)
+ {
+ /*
+ ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
+ if (avatar != null)
+ {
+ Rotate the Av?
+ } */
+ }
+ else
+ {
+ if (rootpart.PhysActor != null)
+ { // APID must be implemented in your physics system for this to function.
+ rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W);
+ rootpart.PhysActor.APIDStrength = strength;
+ rootpart.PhysActor.APIDDamping = damping;
+ rootpart.PhysActor.APIDActive = true;
+ }
+ }
+ }
}
public void stopLookAt()
{
- if (RootPart.PhysActor != null)
- RootPart.PhysActor.APIDActive = false;
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
+ {
+ if (rootpart.PhysActor != null)
+ { // APID must be implemented in your physics system for this to function.
+ rootpart.PhysActor.APIDActive = false;
+ }
+ }
+
}
///
@@ -1634,18 +2035,22 @@ namespace OpenSim.Region.Framework.Scenes
/// Number of seconds over which to reach target
public void SetHoverHeight(float height, PIDHoverType hoverType, float tau)
{
- if (RootPart.PhysActor != null)
+ SceneObjectPart rootpart = m_rootPart;
+ if (rootpart != null)
{
- if (height != 0f)
- {
- RootPart.PhysActor.PIDHoverHeight = height;
- RootPart.PhysActor.PIDHoverType = hoverType;
- RootPart.PhysActor.PIDTau = tau;
- RootPart.PhysActor.PIDHoverActive = true;
- }
- else
+ if (rootpart.PhysActor != null)
{
- RootPart.PhysActor.PIDHoverActive = false;
+ if (height != 0f)
+ {
+ rootpart.PhysActor.PIDHoverHeight = height;
+ rootpart.PhysActor.PIDHoverType = hoverType;
+ rootpart.PhysActor.PIDTau = tau;
+ rootpart.PhysActor.PIDHoverActive = true;
+ }
+ else
+ {
+ rootpart.PhysActor.PIDHoverActive = false;
+ }
}
}
}
@@ -1681,6 +2086,8 @@ namespace OpenSim.Region.Framework.Scenes
public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{
SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
+ newPart.SetParent(this);
+
AddPart(newPart);
SetPartAsNonRoot(newPart);
@@ -1714,11 +2121,11 @@ namespace OpenSim.Region.Framework.Scenes
public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, UUID AgentID, uint RequestFlags)
{
remoteClient.SendObjectPropertiesFamilyData(RootPart, RequestFlags);
-
- // remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.OwnerID, RootPart.GroupID, RootPart.BaseMask,
- // RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask,
- // RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category,
- // RootPart.CreatorID, RootPart.Name, RootPart.Description);
+
+// remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.OwnerID, RootPart.GroupID, RootPart.BaseMask,
+// RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask,
+// RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category,
+// RootPart.CreatorID, RootPart.Name, RootPart.Description);
}
public void SetPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID)
@@ -1738,7 +2145,7 @@ namespace OpenSim.Region.Framework.Scenes
// an object has been deleted from a scene before update was processed.
// A more fundamental overhaul of the update mechanism is required to eliminate all
// the race conditions.
- if (IsDeleted)
+ if (m_isDeleted)
return;
// Even temporary objects take part in physics (e.g. temp-on-rez bullets)
@@ -1771,8 +2178,8 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleFullUpdateToAvatar(ScenePresence presence)
{
- // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
-
+// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
+
RootPart.AddFullUpdateToAvatar(presence);
SceneObjectPart[] parts = m_parts.GetArray();
@@ -1786,7 +2193,7 @@ namespace OpenSim.Region.Framework.Scenes
public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
{
- // m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
+// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
@@ -1798,9 +2205,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ScheduleGroupForFullUpdate()
{
- // if (IsAttachment)
- // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
-
+// if (IsAttachment)
+// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
+
checkAtTargets();
RootPart.ScheduleFullUpdate();
@@ -1818,7 +2225,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ScheduleGroupForTerseUpdate()
{
- // m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
+// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
@@ -1829,12 +2236,12 @@ namespace OpenSim.Region.Framework.Scenes
/// Immediately send a full update for this scene object.
///
public void SendGroupFullUpdate()
- {
+ {
if (IsDeleted)
return;
- // m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
-
+// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
+
RootPart.SendFullUpdateToAllClients();
SceneObjectPart[] parts = m_parts.GetArray();
@@ -1864,7 +2271,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_scene == null) // Need to check here as it's null during object creation
return;
-
+
m_scene.SceneGraph.AddToUpdateList(this);
}
@@ -1980,9 +2387,9 @@ namespace OpenSim.Region.Framework.Scenes
// objectGroup.RootPart.SendScheduledUpdates();
//}
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
- // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
+// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
SceneObjectPart linkPart = objectGroup.m_rootPart;
@@ -2022,12 +2429,15 @@ namespace OpenSim.Region.Framework.Scenes
part.LinkNum += objectGroup.PrimCount;
}
}
+ }
- linkPart.LinkNum = 2;
+ linkPart.LinkNum = 2;
- linkPart.SetParent(this);
- linkPart.CreateSelected = true;
+ linkPart.SetParent(this);
+ linkPart.CreateSelected = true;
+ lock (m_parts.SyncRoot)
+ {
//if (linkPart.PhysActor != null)
//{
// m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
@@ -2048,12 +2458,12 @@ namespace OpenSim.Region.Framework.Scenes
}
m_scene.UnlinkSceneObject(objectGroup, true);
- objectGroup.IsDeleted = true;
+ objectGroup.m_isDeleted = true;
objectGroup.m_parts.Clear();
-
+
// Can't do this yet since backup still makes use of the root part without any synchronization
- // objectGroup.m_rootPart = null;
+// objectGroup.m_rootPart = null;
AttachToBackup();
@@ -2111,10 +2521,10 @@ namespace OpenSim.Region.Framework.Scenes
/// The object group of the newly delinked prim.
public SceneObjectGroup DelinkFromGroup(SceneObjectPart linkPart, bool sendEvents)
{
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
- // linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
-
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
+// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
+
linkPart.ClearUndoState();
Quaternion worldRot = linkPart.GetWorldRotation();
@@ -2185,9 +2595,11 @@ namespace OpenSim.Region.Framework.Scenes
///
public virtual void DetachFromBackup()
{
- if (m_isBackedUp && Scene != null)
- m_scene.EventManager.OnBackup -= ProcessBackup;
+ m_scene.SceneGraph.FireDetachFromBackup(this);
+ if (m_isBackedUp)
+ m_scene.EventManager.OnBackup -= ProcessBackup;
+
m_isBackedUp = false;
}
@@ -2203,7 +2615,8 @@ namespace OpenSim.Region.Framework.Scenes
axPos *= parentRot;
part.OffsetPosition = axPos;
- part.GroupPosition = oldGroupPosition + part.OffsetPosition;
+ Vector3 newPos = oldGroupPosition + part.OffsetPosition;
+ part.GroupPosition = newPos;
part.OffsetPosition = Vector3.Zero;
part.RotationOffset = worldRot;
@@ -2214,7 +2627,7 @@ namespace OpenSim.Region.Framework.Scenes
part.LinkNum = linkNum;
- part.OffsetPosition = part.GroupPosition - AbsolutePosition;
+ part.OffsetPosition = newPos - AbsolutePosition;
Quaternion rootRotation = m_rootPart.RotationOffset;
@@ -2224,7 +2637,7 @@ namespace OpenSim.Region.Framework.Scenes
parentRot = m_rootPart.RotationOffset;
oldRot = part.RotationOffset;
- Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
+ Quaternion newRot = Quaternion.Inverse(parentRot) * worldRot;
part.RotationOffset = newRot;
}
@@ -2322,7 +2735,7 @@ namespace OpenSim.Region.Framework.Scenes
// but it will result in over-shoot or under-shoot of the target orientation.
// For the end user, this means that ctrl+shift+drag can be used for relative,
// but not absolute, adjustments of orientation for physical prims.
-
+
if (m_scene.EventManager.TriggerGroupSpin(UUID, newOrientation))
{
if (m_rootPart.PhysActor != null)
@@ -2337,25 +2750,25 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
- // save and update old orientation
- Quaternion old = m_rootPart.SpinOldOrientation;
- m_rootPart.SpinOldOrientation = newOrientation;
- //m_log.Error("[SCENE OBJECT GROUP]: Old orientation is " + old);
- //m_log.Error("[SCENE OBJECT GROUP]: Incoming new orientation is " + newOrientation);
-
- // compute difference between previous old rotation and new incoming rotation
- Quaternion minimalRotationFromQ1ToQ2 = Quaternion.Inverse(old) * newOrientation;
-
- float rotationAngle;
- Vector3 rotationAxis;
- minimalRotationFromQ1ToQ2.GetAxisAngle(out rotationAxis, out rotationAngle);
- rotationAxis.Normalize();
-
- //m_log.Error("SCENE OBJECT GROUP]: rotation axis is " + rotationAxis);
- Vector3 spinforce = new Vector3(rotationAxis.X, rotationAxis.Y, rotationAxis.Z);
- spinforce = (spinforce / 8) * m_rootPart.PhysActor.Mass; // 8 is an arbitrary torque scaling factor
- m_rootPart.PhysActor.AddAngularForce(spinforce, true);
- m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
+ // save and update old orientation
+ Quaternion old = m_rootPart.SpinOldOrientation;
+ m_rootPart.SpinOldOrientation = newOrientation;
+ //m_log.Error("[SCENE OBJECT GROUP]: Old orientation is " + old);
+ //m_log.Error("[SCENE OBJECT GROUP]: Incoming new orientation is " + newOrientation);
+
+ // compute difference between previous old rotation and new incoming rotation
+ Quaternion minimalRotationFromQ1ToQ2 = Quaternion.Inverse(old) * newOrientation;
+
+ float rotationAngle;
+ Vector3 rotationAxis;
+ minimalRotationFromQ1ToQ2.GetAxisAngle(out rotationAxis, out rotationAngle);
+ rotationAxis.Normalize();
+
+ //m_log.Error("SCENE OBJECT GROUP]: rotation axis is " + rotationAxis);
+ Vector3 spinforce = new Vector3(rotationAxis.X, rotationAxis.Y, rotationAxis.Z);
+ spinforce = (spinforce/8) * m_rootPart.PhysActor.Mass; // 8 is an arbitrary torque scaling factor
+ m_rootPart.PhysActor.AddAngularForce(spinforce,true);
+ m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
}
}
else
@@ -2444,15 +2857,14 @@ namespace OpenSim.Region.Framework.Scenes
/// Update prim flags for this group.
///
///
- ///
- ///
- ///
- ///
- public void UpdatePrimFlags(uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect)
+ ///
+ ///
+ ///
+ public void UpdatePrimFlags(uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVolumeDetect)
{
SceneObjectPart selectionPart = GetChildPart(localID);
- if (SetTemporary && Scene != null)
+ if (IsTemporary)
{
DetachFromBackup();
// Remove from database and parcel prim count
@@ -2464,24 +2876,24 @@ namespace OpenSim.Region.Framework.Scenes
if (selectionPart != null)
{
SceneObjectPart[] parts = m_parts.GetArray();
-
- if (Scene != null)
+ for (int i = 0; i < parts.Length; i++)
{
- for (int i = 0; i < parts.Length; i++)
+ SceneObjectPart part = parts[i];
+ if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax ||
+ part.Scale.Y > m_scene.RegionInfo.PhysPrimMax ||
+ part.Scale.Z > m_scene.RegionInfo.PhysPrimMax)
{
- SceneObjectPart part = parts[i];
- if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax ||
- part.Scale.Y > m_scene.RegionInfo.PhysPrimMax ||
- part.Scale.Z > m_scene.RegionInfo.PhysPrimMax)
- {
- UsePhysics = false; // Reset physics
- break;
- }
+ UsePhysics = false; // Reset physics
+ break;
}
}
+ RootPart.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
for (int i = 0; i < parts.Length; i++)
- parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
+ {
+ if (parts[i] != RootPart)
+ parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
+ }
}
}
@@ -2494,6 +2906,17 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+
+
+ ///
+ /// Gets the number of parts
+ ///
+ ///
+ public int GetPartCount()
+ {
+ return Parts.Count();
+ }
+
///
/// Update the texture entry for this part
///
@@ -2543,150 +2966,202 @@ namespace OpenSim.Region.Framework.Scenes
#region Resize
///
- /// Resize the entire group of prims.
+ /// Resize the given part
///
///
- public void GroupResize(Vector3 scale)
- {
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
-
- RootPart.StoreUndoState(true);
+ ///
+ public void Resize(Vector3 scale, uint localID)
+ {
+ if (scale.X > m_scene.m_maxNonphys)
+ scale.X = m_scene.m_maxNonphys;
+ if (scale.Y > m_scene.m_maxNonphys)
+ scale.Y = m_scene.m_maxNonphys;
+ if (scale.Z > m_scene.m_maxNonphys)
+ scale.Z = m_scene.m_maxNonphys;
+ SceneObjectPart part = GetChildPart(localID);
+ if (part != null)
+ {
+ if (part.PhysActor != null)
+ {
+ if (part.PhysActor.IsPhysical)
+ {
+ if (scale.X > m_scene.m_maxPhys)
+ scale.X = m_scene.m_maxPhys;
+ if (scale.Y > m_scene.m_maxPhys)
+ scale.Y = m_scene.m_maxPhys;
+ if (scale.Z > m_scene.m_maxPhys)
+ scale.Z = m_scene.m_maxPhys;
+ }
+ part.PhysActor.Size = scale;
+ m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
+ }
+ part.Resize(scale);
- scale.X = Math.Min(scale.X, Scene.m_maxNonphys);
- scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys);
- scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys);
+ HasGroupChanged = true;
+ part.TriggerScriptChangedEvent(Changed.SCALE);
+ ScheduleGroupForFullUpdate();
- if (RootPart.PhysActor != null && RootPart.PhysActor.IsPhysical)
- {
- scale.X = Math.Min(scale.X, Scene.m_maxPhys);
- scale.Y = Math.Min(scale.Y, Scene.m_maxPhys);
- scale.Z = Math.Min(scale.Z, Scene.m_maxPhys);
+ //if (part.UUID == m_rootPart.UUID)
+ //{
+ //if (m_rootPart.PhysActor != null)
+ //{
+ //m_rootPart.PhysActor.Size =
+ //new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z);
+ //m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
+ //}
+ //}
}
+ }
- float x = (scale.X / RootPart.Scale.X);
- float y = (scale.Y / RootPart.Scale.Y);
- float z = (scale.Z / RootPart.Scale.Z);
-
- SceneObjectPart[] parts;
- if (x > 1.0f || y > 1.0f || z > 1.0f)
+ public void GroupResize(Vector3 scale, uint localID)
+ {
+ SceneObjectPart part = GetChildPart(localID);
+ if (part != null)
{
- parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
+ if (scale.X > m_scene.m_maxNonphys)
+ scale.X = m_scene.m_maxNonphys;
+ if (scale.Y > m_scene.m_maxNonphys)
+ scale.Y = m_scene.m_maxNonphys;
+ if (scale.Z > m_scene.m_maxNonphys)
+ scale.Z = m_scene.m_maxNonphys;
+ if (part.PhysActor != null && part.PhysActor.IsPhysical)
{
- SceneObjectPart obPart = parts[i];
- if (obPart.UUID != m_rootPart.UUID)
- {
- // obPart.IgnoreUndoUpdate = true;
- Vector3 oldSize = new Vector3(obPart.Scale);
-
- float f = 1.0f;
- float a = 1.0f;
+ if (scale.X > m_scene.m_maxPhys)
+ scale.X = m_scene.m_maxPhys;
+ if (scale.Y > m_scene.m_maxPhys)
+ scale.Y = m_scene.m_maxPhys;
+ if (scale.Z > m_scene.m_maxPhys)
+ scale.Z = m_scene.m_maxPhys;
+ }
+ float x = (scale.X / part.Scale.X);
+ float y = (scale.Y / part.Scale.Y);
+ float z = (scale.Z / part.Scale.Z);
- if (RootPart.PhysActor != null && RootPart.PhysActor.IsPhysical)
+ SceneObjectPart[] parts;
+ if (x > 1.0f || y > 1.0f || z > 1.0f)
+ {
+ parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ {
+ SceneObjectPart obPart = parts[i];
+ if (obPart.UUID != m_rootPart.UUID)
{
- if (oldSize.X * x > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.X;
- a = f / x;
- x *= a;
- y *= a;
- z *= a;
- }
-
- if (oldSize.Y * y > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.Y;
- a = f / y;
- x *= a;
- y *= a;
- z *= a;
- }
+ obPart.IgnoreUndoUpdate = true;
+ Vector3 oldSize = new Vector3(obPart.Scale);
- if (oldSize.Z * z > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.Z;
- a = f / z;
- x *= a;
- y *= a;
- z *= a;
- }
- }
- else
- {
- if (oldSize.X * x > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.X;
- a = f / x;
- x *= a;
- y *= a;
- z *= a;
- }
+ float f = 1.0f;
+ float a = 1.0f;
- if (oldSize.Y * y > m_scene.m_maxNonphys)
+ if (part.PhysActor != null && part.PhysActor.IsPhysical)
{
- f = m_scene.m_maxNonphys / oldSize.Y;
- a = f / y;
- x *= a;
- y *= a;
- z *= a;
+ if (oldSize.X*x > m_scene.m_maxPhys)
+ {
+ f = m_scene.m_maxPhys / oldSize.X;
+ a = f / x;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+ if (oldSize.Y*y > m_scene.m_maxPhys)
+ {
+ f = m_scene.m_maxPhys / oldSize.Y;
+ a = f / y;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+ if (oldSize.Z*z > m_scene.m_maxPhys)
+ {
+ f = m_scene.m_maxPhys / oldSize.Z;
+ a = f / z;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
}
-
- if (oldSize.Z * z > m_scene.m_maxNonphys)
+ else
{
- f = m_scene.m_maxNonphys / oldSize.Z;
- a = f / z;
- x *= a;
- y *= a;
- z *= a;
+ if (oldSize.X*x > m_scene.m_maxNonphys)
+ {
+ f = m_scene.m_maxNonphys / oldSize.X;
+ a = f / x;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+ if (oldSize.Y*y > m_scene.m_maxNonphys)
+ {
+ f = m_scene.m_maxNonphys / oldSize.Y;
+ a = f / y;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+ if (oldSize.Z*z > m_scene.m_maxNonphys)
+ {
+ f = m_scene.m_maxNonphys / oldSize.Z;
+ a = f / z;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
}
+ obPart.IgnoreUndoUpdate = false;
}
-
- // obPart.IgnoreUndoUpdate = false;
}
}
- }
- Vector3 prevScale = RootPart.Scale;
- prevScale.X *= x;
- prevScale.Y *= y;
- prevScale.Z *= z;
+ Vector3 prevScale = part.Scale;
+ prevScale.X *= x;
+ prevScale.Y *= y;
+ prevScale.Z *= z;;
- // RootPart.IgnoreUndoUpdate = true;
- RootPart.Resize(prevScale);
- // RootPart.IgnoreUndoUpdate = false;
-
- parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- {
- SceneObjectPart obPart = parts[i];
+ part.IgnoreUndoUpdate = false;
+ part.StoreUndoState(UndoType.STATE_GROUP_SCALE);
+ part.IgnoreUndoUpdate = true;
+ part.Resize(prevScale);
+ part.IgnoreUndoUpdate = false;
- if (obPart.UUID != m_rootPart.UUID)
+ parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
{
+ SceneObjectPart obPart = parts[i];
obPart.IgnoreUndoUpdate = true;
-
- Vector3 currentpos = new Vector3(obPart.OffsetPosition);
- currentpos.X *= x;
- currentpos.Y *= y;
- currentpos.Z *= z;
-
- Vector3 newSize = new Vector3(obPart.Scale);
- newSize.X *= x;
- newSize.Y *= y;
- newSize.Z *= z;
-
- obPart.Resize(newSize);
- obPart.UpdateOffSet(currentpos);
-
+ if (obPart.UUID != m_rootPart.UUID)
+ {
+ if (obPart.UUID != m_rootPart.UUID)
+ {
+ obPart.IgnoreUndoUpdate = false;
+ obPart.StoreUndoState(UndoType.STATE_GROUP_SCALE);
+ obPart.IgnoreUndoUpdate = true;
+
+ Vector3 currentpos = new Vector3(obPart.OffsetPosition);
+ currentpos.X *= x;
+ currentpos.Y *= y;
+ currentpos.Z *= z;
+ Vector3 newSize = new Vector3(obPart.Scale);
+ newSize.X *= x;
+ newSize.Y *= y;
+ newSize.Z *= z;
+ obPart.Resize(newSize);
+ obPart.UpdateOffSet(currentpos);
+ }
+ obPart.IgnoreUndoUpdate = false;
+ }
obPart.IgnoreUndoUpdate = false;
}
- // obPart.IgnoreUndoUpdate = false;
- // obPart.StoreUndoState();
- }
+ if (part.PhysActor != null)
+ {
+ part.PhysActor.Size = prevScale;
+ m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
+ }
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Finished group resizing {0} {1} to {2}", Name, LocalId, RootPart.Scale);
+ part.IgnoreUndoUpdate = false;
+ HasGroupChanged = true;
+ m_rootPart.TriggerScriptChangedEvent(Changed.SCALE);
+ ScheduleGroupForTerseUpdate();
+ }
}
#endregion
@@ -2699,18 +3174,11 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupPosition(Vector3 pos)
{
- // m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos);
-
- RootPart.StoreUndoState(true);
-
- // SceneObjectPart[] parts = m_parts.GetArray();
- // for (int i = 0; i < parts.Length; i++)
- // parts[i].StoreUndoState();
-
if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
{
if (IsAttachment)
{
+ m_rootPart.StoreUndoState(UndoType.STATE_GROUP_POSITION);
m_rootPart.AttachedPos = pos;
}
if (RootPart.GetStatusSandbox())
@@ -2742,18 +3210,12 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = GetChildPart(localID);
- // SceneObjectPart[] parts = m_parts.GetArray();
- // for (int i = 0; i < parts.Length; i++)
- // parts[i].StoreUndoState();
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].StoreUndoState(UndoType.STATE_PRIM_POSITION);
if (part != null)
{
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos);
-
- part.StoreUndoState(false);
- part.IgnoreUndoUpdate = true;
-
if (part.UUID == m_rootPart.UUID)
{
UpdateRootPosition(pos);
@@ -2764,22 +3226,18 @@ namespace OpenSim.Region.Framework.Scenes
}
HasGroupChanged = true;
- part.IgnoreUndoUpdate = false;
}
}
///
- /// Update just the root prim position in a linkset
+ ///
///
///
- public void UpdateRootPosition(Vector3 pos)
+ private void UpdateRootPosition(Vector3 pos)
{
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Updating root position of {0} {1} to {2}", Name, LocalId, pos);
-
- // SceneObjectPart[] parts = m_parts.GetArray();
- // for (int i = 0; i < parts.Length; i++)
- // parts[i].StoreUndoState();
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].StoreUndoState(UndoType.STATE_PRIM_POSITION);
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
Vector3 oldPos =
@@ -2792,7 +3250,7 @@ namespace OpenSim.Region.Framework.Scenes
axDiff *= Quaternion.Inverse(partRotation);
diff = axDiff;
- SceneObjectPart[] parts = m_parts.GetArray();
+ parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart obPart = parts[i];
@@ -2800,10 +3258,27 @@ namespace OpenSim.Region.Framework.Scenes
obPart.OffsetPosition = obPart.OffsetPosition + diff;
}
- AbsolutePosition = newPos;
+ //We have to set undoing here because otherwise an undo state will be saved
+ if (!m_rootPart.Undoing)
+ {
+ m_rootPart.Undoing = true;
+ AbsolutePosition = newPos;
+ m_rootPart.Undoing = false;
+ }
+ else
+ {
+ AbsolutePosition = newPos;
+ }
HasGroupChanged = true;
- ScheduleGroupForTerseUpdate();
+ if (m_rootPart.Undoing)
+ {
+ ScheduleGroupForFullUpdate();
+ }
+ else
+ {
+ ScheduleGroupForTerseUpdate();
+ }
}
public void OffsetForNewRegion(Vector3 offset)
@@ -2821,14 +3296,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupRotationR(Quaternion rot)
{
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Updating group rotation R of {0} {1} to {2}", Name, LocalId, rot);
-
- // SceneObjectPart[] parts = m_parts.GetArray();
- // for (int i = 0; i < parts.Length; i++)
- // parts[i].StoreUndoState();
-
- m_rootPart.StoreUndoState(true);
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].StoreUndoState(UndoType.STATE_GROUP_ROTATION);
m_rootPart.UpdateRotation(rot);
@@ -2850,15 +3320,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot)
{
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Updating group rotation PR of {0} {1} to {2}", Name, LocalId, rot);
-
- // SceneObjectPart[] parts = m_parts.GetArray();
- // for (int i = 0; i < parts.Length; i++)
- // parts[i].StoreUndoState();
-
- RootPart.StoreUndoState(true);
- RootPart.IgnoreUndoUpdate = true;
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].StoreUndoState(UndoType.STATE_GROUP_ROTATION);
m_rootPart.UpdateRotation(rot);
@@ -2873,8 +3337,6 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
ScheduleGroupForTerseUpdate();
-
- RootPart.IgnoreUndoUpdate = false;
}
///
@@ -2885,16 +3347,12 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdateSingleRotation(Quaternion rot, uint localID)
{
SceneObjectPart part = GetChildPart(localID);
-
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState();
+ parts[i].StoreUndoState(UndoType.STATE_PRIM_ROTATION);
if (part != null)
{
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Updating single rotation of {0} {1} to {2}", part.Name, part.LocalId, rot);
-
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
@@ -2916,25 +3374,28 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}",
- // part.Name, part.LocalId, rot);
-
- part.StoreUndoState();
- part.IgnoreUndoUpdate = true;
-
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
- AbsolutePosition = pos;
+ if (!m_rootPart.Undoing)
+ {
+ m_rootPart.Undoing = true;
+ AbsolutePosition = pos;
+ m_rootPart.Undoing = false;
+ }
+ else
+ {
+ AbsolutePosition = pos;
+ }
}
else
{
+ part.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
+ part.IgnoreUndoUpdate = true;
part.UpdateRotation(rot);
part.OffsetPosition = pos;
+ part.IgnoreUndoUpdate = false;
}
-
- part.IgnoreUndoUpdate = false;
}
}
@@ -2942,17 +3403,21 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- public void UpdateRootRotation(Quaternion rot)
+ private void UpdateRootRotation(Quaternion rot)
{
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}",
- // Name, LocalId, rot);
-
Quaternion axRot = rot;
Quaternion oldParentRot = m_rootPart.RotationOffset;
- m_rootPart.StoreUndoState();
- m_rootPart.UpdateRotation(rot);
+ m_rootPart.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
+ bool cancelUndo = false;
+ if (!m_rootPart.Undoing)
+ {
+ m_rootPart.Undoing = true;
+ cancelUndo = true;
+ }
+
+ //Don't use UpdateRotation because it schedules an update prematurely
+ m_rootPart.RotationOffset = rot;
if (m_rootPart.PhysActor != null)
{
m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset;
@@ -2967,33 +3432,22 @@ namespace OpenSim.Region.Framework.Scenes
{
prim.IgnoreUndoUpdate = true;
Vector3 axPos = prim.OffsetPosition;
+
axPos *= oldParentRot;
axPos *= Quaternion.Inverse(axRot);
prim.OffsetPosition = axPos;
- Quaternion primsRot = prim.RotationOffset;
- Quaternion newRot = primsRot * oldParentRot;
- newRot *= Quaternion.Inverse(axRot);
- prim.RotationOffset = newRot;
- prim.ScheduleTerseUpdate();
+
+ prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset);
+
prim.IgnoreUndoUpdate = false;
}
}
-
- // for (int i = 0; i < parts.Length; i++)
- // {
- // SceneObjectPart childpart = parts[i];
- // if (childpart != m_rootPart)
- // {
- //// childpart.IgnoreUndoUpdate = false;
- //// childpart.StoreUndoState();
- // }
- // }
-
- m_rootPart.ScheduleTerseUpdate();
-
- // m_log.DebugFormat(
- // "[SCENE OBJECT GROUP]: Updated root rotation of {0} {1} to {2}",
- // Name, LocalId, rot);
+ if (cancelUndo == true)
+ {
+ m_rootPart.Undoing = false;
+ }
+ HasGroupChanged = true;
+ ScheduleGroupForFullUpdate();
}
#endregion
@@ -3008,23 +3462,28 @@ namespace OpenSim.Region.Framework.Scenes
int yaxis = 4;
int zaxis = 8;
- setX = ((axis & xaxis) != 0) ? true : false;
- setY = ((axis & yaxis) != 0) ? true : false;
- setZ = ((axis & zaxis) != 0) ? true : false;
+ if (m_rootPart != null)
+ {
+ setX = ((axis & xaxis) != 0) ? true : false;
+ setY = ((axis & yaxis) != 0) ? true : false;
+ setZ = ((axis & zaxis) != 0) ? true : false;
- float setval = (rotate10 > 0) ? 1f : 0f;
+ float setval = (rotate10 > 0) ? 1f : 0f;
- if (setX)
- RootPart.RotationAxis.X = setval;
- if (setY)
- RootPart.RotationAxis.Y = setval;
- if (setZ)
- RootPart.RotationAxis.Z = setval;
+ if (setX)
+ m_rootPart.RotationAxis.X = setval;
+ if (setY)
+ m_rootPart.RotationAxis.Y = setval;
+ if (setZ)
+ m_rootPart.RotationAxis.Z = setval;
- if (setX || setY || setZ)
- RootPart.SetPhysicsAxisRotation();
- }
+ if (setX || setY || setZ)
+ {
+ m_rootPart.SetPhysicsAxisRotation();
+ }
+ }
+ }
public int registerRotTargetWaypoint(Quaternion target, float tolerance)
{
scriptRotTarget waypoint = new scriptRotTarget();
@@ -3064,7 +3523,7 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.AddGroupTarget(this);
return (int)handle;
}
-
+
public void unregisterTargetWaypoint(int handle)
{
lock (m_targets)
@@ -3105,14 +3564,14 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+
if (atTargets.Count > 0)
{
SceneObjectPart[] parts = m_parts.GetArray();
uint[] localids = new uint[parts.Length];
for (int i = 0; i < parts.Length; i++)
localids[i] = parts[i].LocalId;
-
+
for (int ctr = 0; ctr < localids.Length; ctr++)
{
foreach (uint target in atTargets.Keys)
@@ -3122,10 +3581,10 @@ namespace OpenSim.Region.Framework.Scenes
localids[ctr], att.handle, att.targetPos, m_rootPart.GroupPosition);
}
}
-
+
return;
}
-
+
if (m_scriptListens_notAtTarget && !at_target)
{
//trigger not_at_target
@@ -3133,7 +3592,7 @@ namespace OpenSim.Region.Framework.Scenes
uint[] localids = new uint[parts.Length];
for (int i = 0; i < parts.Length; i++)
localids[i] = parts[i].LocalId;
-
+
for (int ctr = 0; ctr < localids.Length; ctr++)
{
m_scene.EventManager.TriggerNotAtTargetEvent(localids[ctr]);
@@ -3152,13 +3611,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (uint idx in m_rotTargets.Keys)
{
scriptRotTarget target = m_rotTargets[idx];
- double angle
- = Math.Acos(
- target.targetRot.X * m_rootPart.RotationOffset.X
- + target.targetRot.Y * m_rootPart.RotationOffset.Y
- + target.targetRot.Z * m_rootPart.RotationOffset.Z
- + target.targetRot.W * m_rootPart.RotationOffset.W)
- * 2;
+ double angle = Math.Acos(target.targetRot.X * m_rootPart.RotationOffset.X + target.targetRot.Y * m_rootPart.RotationOffset.Y + target.targetRot.Z * m_rootPart.RotationOffset.Z + target.targetRot.W * m_rootPart.RotationOffset.W) * 2;
if (angle < 0) angle = -angle;
if (angle > Math.PI) angle = (Math.PI * 2 - angle);
if (angle <= target.tolerance)
@@ -3213,39 +3666,53 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+
public float GetMass()
{
float retmass = 0f;
-
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
retmass += parts[i].GetMass();
return retmass;
}
-
- ///
- /// If the object is a sculpt/mesh, retrieve the mesh data for each part and reinsert it into each shape so that
- /// the physics engine can use it.
- ///
- ///
- /// When the physics engine has finished with it, the sculpt data is discarded to save memory.
- ///
+
public void CheckSculptAndLoad()
{
if (IsDeleted)
return;
-
if ((RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0)
return;
- // m_log.Debug("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
-
SceneObjectPart[] parts = m_parts.GetArray();
-
for (int i = 0; i < parts.Length; i++)
- parts[i].CheckSculptAndLoad();
+ {
+ SceneObjectPart part = parts[i];
+ if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero)
+ {
+ // check if a previously decoded sculpt map has been cached
+ if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + part.Shape.SculptTexture.ToString())))
+ {
+ part.SculptTextureCallback(part.Shape.SculptTexture, null);
+ }
+ else
+ {
+ m_scene.AssetService.Get(
+ part.Shape.SculptTexture.ToString(), part, AssetReceived);
+ }
+ }
+ }
+ }
+
+ protected void AssetReceived(string id, Object sender, AssetBase asset)
+ {
+ SceneObjectPart sop = (SceneObjectPart)sender;
+
+ if (sop != null)
+ {
+ if (asset != null)
+ sop.SculptTextureCallback(asset.FullID, asset);
+ }
}
///
@@ -3274,18 +3741,25 @@ namespace OpenSim.Region.Framework.Scenes
for (int i = 0; i < parts.Length; i++)
parts[i].TriggerScriptChangedEvent(val);
}
-
+
public override string ToString()
{
return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition);
}
- #region ISceneObject
+ public void SetAttachmentPoint(byte point)
+ {
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].SetAttachmentPoint(point);
+ }
+ #region ISceneObject
+
public virtual ISceneObject CloneForNewScene()
{
SceneObjectGroup sog = Copy(false);
- sog.IsDeleted = false;
+ sog.m_isDeleted = false;
return sog;
}
@@ -3311,6 +3785,14 @@ namespace OpenSim.Region.Framework.Scenes
SetFromItemID(uuid);
}
+ public void ResetOwnerChangeFlag()
+ {
+ ForEachPart(delegate(SceneObjectPart part)
+ {
+ part.ResetOwnerChangeFlag();
+ });
+ }
+
#endregion
}
-}
\ No newline at end of file
+}
--
cgit v1.1
From 9cc2d0b60ae3398cf0a2f2ea144c331fa73d3e76 Mon Sep 17 00:00:00 2001
From: Tom
Date: Sun, 4 Sep 2011 08:30:23 -0700
Subject: Now merging the core changes.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 865 +++++++++++----------
1 file changed, 444 insertions(+), 421 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6c47645..88a6232 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -209,27 +209,89 @@ namespace OpenSim.Region.Framework.Scenes
return true;
return false;
}
-
- ///
+
+ ///
/// Is this scene object acting as an attachment?
- ///
- /// 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).
- ///
- public bool IsAttachment
+ ///
+ public bool IsAttachment { get; set; }
+
+ ///
+ /// The avatar to which this scene object is attached.
+ ///
+ ///
+ /// If we're not attached to an avatar then this is UUID.Zero
+ ///
+ public UUID AttachedAvatar { get; set; }
+
+ ///
+ /// Attachment point of this scene object to an avatar.
+ ///
+ ///
+ /// 0 if we're not attached to anything
+ ///
+ public uint AttachmentPoint
{
get
{
- if (!IsDeleted)
- return m_rootPart.IsAttachment;
-
- return false;
+ return m_rootPart.Shape.State;
+ }
+
+ set
+ {
+ IsAttachment = value != 0;
+ m_rootPart.Shape.State = (byte)value;
}
}
+ public void ClearPartAttachmentData()
+ {
+ AttachmentPoint = 0;
+
+ // Even though we don't use child part state parameters for attachments any more, we still need to set
+ // these to zero since having them non-zero in rezzed scene objects will crash some clients. Even if
+ // we store them correctly, scene objects that we receive from elsewhere might not.
+ foreach (SceneObjectPart part in Parts)
+ part.Shape.State = 0;
+ }
+
+ ///
+ /// Is this scene object phantom?
+ ///
+ ///
+ /// Updating must currently take place through UpdatePrimFlags()
+ ///
+ public bool IsPhantom
+ {
+ get { return (RootPart.Flags & PrimFlags.Phantom) != 0; }
+ }
+
+ ///
+ /// Does this scene object use physics?
+ ///
+ ///
+ /// Updating must currently take place through UpdatePrimFlags()
+ ///
+ public bool UsesPhysics
+ {
+ get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
+ }
+
+ ///
+ /// Is this scene object temporary?
+ ///
+ ///
+ /// Updating must currently take place through UpdatePrimFlags()
+ ///
+ public bool IsTemporary
+ {
+ get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
+ }
+
+ public bool IsVolumeDetect
+ {
+ get { return RootPart.VolumeDetectActive; }
+ }
+
public float scriptScore;
private Vector3 lastPhysGroupPos;
@@ -261,11 +323,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public override string Name
{
- get {
- if (RootPart == null)
- return String.Empty;
- return RootPart.Name;
- }
+ get { return RootPart.Name; }
set { RootPart.Name = value; }
}
@@ -305,6 +363,38 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_rootPart.RotationOffset; }
}
+ public Vector3 GroupScale
+ {
+ get
+ {
+ Vector3 minScale = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionSize);
+ Vector3 maxScale = Vector3.Zero;
+ Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
+
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ {
+ SceneObjectPart part = parts[i];
+ Vector3 partscale = part.Scale;
+ Vector3 partoffset = part.OffsetPosition;
+
+ minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X;
+ minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.Y + partoffset.Y : minScale.Y;
+ minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z;
+
+ maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X;
+ maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y;
+ maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z;
+ }
+
+ finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
+ finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
+ finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
+
+ return finalScale;
+ }
+ }
+
public UUID GroupID
{
get { return m_rootPart.GroupID; }
@@ -344,11 +434,13 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Check both the attachment property and the relevant properties of the underlying root part.
///
+ ///
/// 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.
+ ///
///
public bool IsAttachmentCheckFull()
{
@@ -682,7 +774,7 @@ namespace OpenSim.Region.Framework.Scenes
part.ParentID = m_rootPart.LocalId;
//m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
}
-
+
ApplyPhysics(m_scene.m_physicalPrim);
if (RootPart.PhysActor != null)
@@ -693,34 +785,6 @@ namespace OpenSim.Region.Framework.Scenes
//ScheduleGroupForFullUpdate();
}
- public Vector3 GroupScale()
- {
- Vector3 minScale = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionSize);
- Vector3 maxScale = Vector3.Zero;
- Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
-
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- {
- SceneObjectPart part = parts[i];
- Vector3 partscale = part.Scale;
- Vector3 partoffset = part.OffsetPosition;
-
- minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X;
- minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.Y + partoffset.Y : minScale.Y;
- minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z;
-
- maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X;
- maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y;
- maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z;
- }
-
- finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
- finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
- finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
- return finalScale;
-
- }
public EntityIntersection TestIntersection(Ray hRay, bool frontFacesOnly, bool faceCenters)
{
// We got a request from the inner_scene to raytrace along the Ray hRay
@@ -1324,7 +1388,7 @@ namespace OpenSim.Region.Framework.Scenes
part.LinkNum = m_parts.Count;
- if (part.LinkNum == 2 && RootPart != null)
+ if (part.LinkNum == 2)
RootPart.LinkNum = 1;
}
@@ -1407,7 +1471,11 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void OnGrabPart(SceneObjectPart part, Vector3 offsetPos, IClientAPI remoteClient)
{
- part.StoreUndoState(UndoType.STATE_PRIM_ALL);
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Processing OnGrabPart for {0} on {1} {2}, offsetPos {3}",
+// remoteClient.Name, part.Name, part.LocalId, offsetPos);
+
+ part.StoreUndoState();
part.OnGrab(offsetPos, remoteClient);
}
@@ -1720,12 +1788,19 @@ 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.IsAttachment = true;
if (!userExposed)
dupe.RootPart.IsAttachment = true;
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
+ if (!userExposed)
+ {
+ dupe.IsAttachment = previousAttachmentStatus;
+ }
if (!userExposed)
{
@@ -1782,6 +1857,22 @@ namespace OpenSim.Region.Framework.Scenes
dupe.AttachToBackup();
ScheduleGroupForFullUpdate();
+ // Need to duplicate the physics actor as well
+ if (part.PhysActor != null && userExposed)
+ {
+ PrimitiveBaseShape pbs = newPart.Shape;
+
+ newPart.PhysActor
+ = m_scene.PhysicsScene.AddPrimShape(
+ string.Format("{0}/{1}", newPart.Name, newPart.UUID),
+ pbs,
+ newPart.AbsolutePosition,
+ newPart.Scale,
+ newPart.RotationOffset,
+ part.PhysActor.IsPhysical,
+ newPart.LocalId);
+
+ newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
}
}
finally
@@ -1802,36 +1893,24 @@ namespace OpenSim.Region.Framework.Scenes
SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed));
}
- public void ScriptSetPhysicsStatus(bool UsePhysics)
+ public void ScriptSetPhysicsStatus(bool usePhysics)
{
- bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
- bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
- bool IsVolumeDetect = RootPart.VolumeDetectActive;
- UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
+ UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
}
- public void ScriptSetTemporaryStatus(bool TemporaryStatus)
+ public void ScriptSetTemporaryStatus(bool makeTemporary)
{
- bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
- bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
- bool IsVolumeDetect = RootPart.VolumeDetectActive;
- UpdatePrimFlags(RootPart.LocalId, UsePhysics, TemporaryStatus, IsPhantom, IsVolumeDetect);
+ UpdatePrimFlags(RootPart.LocalId, UsesPhysics, makeTemporary, IsPhantom, IsVolumeDetect);
}
- public void ScriptSetPhantomStatus(bool PhantomStatus)
+ public void ScriptSetPhantomStatus(bool makePhantom)
{
- bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
- bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
- bool IsVolumeDetect = RootPart.VolumeDetectActive;
- UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, PhantomStatus, IsVolumeDetect);
+ UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, makePhantom, IsVolumeDetect);
}
- public void ScriptSetVolumeDetect(bool VDStatus)
+ public void ScriptSetVolumeDetect(bool makeVolumeDetect)
{
- bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
- bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
- bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
- UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, IsPhantom, VDStatus);
+ UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, IsPhantom, makeVolumeDetect);
/*
ScriptSetPhantomStatus(false); // What ever it was before, now it's not phantom anymore
@@ -1849,120 +1928,80 @@ namespace OpenSim.Region.Framework.Scenes
public void applyImpulse(Vector3 impulse)
{
- // We check if rootpart is null here because scripts don't delete if you delete the host.
- // This means that unfortunately, we can pass a null physics actor to Simulate!
- // Make sure we don't do that!
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
+ if (IsAttachment)
{
- if (IsAttachment)
+ ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
+ if (avatar != null)
{
- ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
- if (avatar != null)
- {
- avatar.PushForce(impulse);
- }
+ avatar.PushForce(impulse);
}
- else
+ }
+ else
+ {
+ if (RootPart.PhysActor != null)
{
- if (rootpart.PhysActor != null)
- {
- rootpart.PhysActor.AddForce(impulse, true);
- m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
- }
+ RootPart.PhysActor.AddForce(impulse, true);
+ m_scene.PhysicsScene.AddPhysicsActorTaint(RootPart.PhysActor);
}
}
}
public void applyAngularImpulse(Vector3 impulse)
{
- // We check if rootpart is null here because scripts don't delete if you delete the host.
- // This means that unfortunately, we can pass a null physics actor to Simulate!
- // Make sure we don't do that!
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
+ if (RootPart.PhysActor != null)
{
- if (rootpart.PhysActor != null)
+ if (!IsAttachment)
{
- if (!IsAttachment)
- {
- rootpart.PhysActor.AddAngularForce(impulse, true);
- m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
- }
+ RootPart.PhysActor.AddAngularForce(impulse, true);
+ m_scene.PhysicsScene.AddPhysicsActorTaint(RootPart.PhysActor);
}
}
}
public void setAngularImpulse(Vector3 impulse)
{
- // We check if rootpart is null here because scripts don't delete if you delete the host.
- // This means that unfortunately, we can pass a null physics actor to Simulate!
- // Make sure we don't do that!
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
+ if (RootPart.PhysActor != null)
{
- if (rootpart.PhysActor != null)
+ if (!IsAttachment)
{
- if (!IsAttachment)
- {
- rootpart.PhysActor.Torque = impulse;
- m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
- }
+ RootPart.PhysActor.Torque = impulse;
+ m_scene.PhysicsScene.AddPhysicsActorTaint(RootPart.PhysActor);
}
}
}
public Vector3 GetTorque()
{
- // We check if rootpart is null here because scripts don't delete if you delete the host.
- // This means that unfortunately, we can pass a null physics actor to Simulate!
- // Make sure we don't do that!
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
+ if (RootPart.PhysActor != null)
{
- if (rootpart.PhysActor != null)
+ if (!IsAttachment)
{
- if (!IsAttachment)
- {
- Vector3 torque = rootpart.PhysActor.Torque;
- return torque;
- }
+ Vector3 torque = RootPart.PhysActor.Torque;
+ return torque;
}
}
+
return Vector3.Zero;
}
// This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object
public void moveToTarget(Vector3 target, float tau)
{
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
+ if (IsAttachment)
{
- if (IsAttachment)
+ ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
+ if (avatar != null)
{
- ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
- if (avatar != null)
- {
- List coords = new List();
- uint regionX = 0;
- uint regionY = 0;
- Utils.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY);
- target.X += regionX;
- target.Y += regionY;
- coords.Add(target.X.ToString());
- coords.Add(target.Y.ToString());
- coords.Add(target.Z.ToString());
- avatar.DoMoveToPosition(avatar, "", coords);
- }
+ avatar.MoveToTarget(target, false);
}
- else
+ }
+ else
+ {
+ if (RootPart.PhysActor != null)
{
- if (rootpart.PhysActor != null)
- {
- rootpart.PhysActor.PIDTarget = target;
- rootpart.PhysActor.PIDTau = tau;
- rootpart.PhysActor.PIDActive = true;
- }
+ RootPart.PhysActor.PIDTarget = target;
+ RootPart.PhysActor.PIDTau = tau;
+ RootPart.PhysActor.PIDActive = true;
}
}
}
@@ -2035,22 +2074,18 @@ namespace OpenSim.Region.Framework.Scenes
/// Number of seconds over which to reach target
public void SetHoverHeight(float height, PIDHoverType hoverType, float tau)
{
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
+ if (RootPart.PhysActor != null)
{
- if (rootpart.PhysActor != null)
+ if (height != 0f)
{
- if (height != 0f)
- {
- rootpart.PhysActor.PIDHoverHeight = height;
- rootpart.PhysActor.PIDHoverType = hoverType;
- rootpart.PhysActor.PIDTau = tau;
- rootpart.PhysActor.PIDHoverActive = true;
- }
- else
- {
- rootpart.PhysActor.PIDHoverActive = false;
- }
+ RootPart.PhysActor.PIDHoverHeight = height;
+ RootPart.PhysActor.PIDHoverType = hoverType;
+ RootPart.PhysActor.PIDTau = tau;
+ RootPart.PhysActor.PIDHoverActive = true;
+ }
+ else
+ {
+ RootPart.PhysActor.PIDHoverActive = false;
}
}
}
@@ -2145,7 +2180,7 @@ namespace OpenSim.Region.Framework.Scenes
// an object has been deleted from a scene before update was processed.
// A more fundamental overhaul of the update mechanism is required to eliminate all
// the race conditions.
- if (m_isDeleted)
+ if (IsDeleted)
return;
// Even temporary objects take part in physics (e.g. temp-on-rez bullets)
@@ -2458,7 +2493,7 @@ namespace OpenSim.Region.Framework.Scenes
}
m_scene.UnlinkSceneObject(objectGroup, true);
- objectGroup.m_isDeleted = true;
+ objectGroup.IsDeleted = true;
objectGroup.m_parts.Clear();
@@ -2596,8 +2631,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual void DetachFromBackup()
{
m_scene.SceneGraph.FireDetachFromBackup(this);
-
- if (m_isBackedUp)
+ if (m_isBackedUp && Scene != null)
m_scene.EventManager.OnBackup -= ProcessBackup;
m_isBackedUp = false;
@@ -2857,14 +2891,15 @@ namespace OpenSim.Region.Framework.Scenes
/// Update prim flags for this group.
///
///
- ///
- ///
- ///
- public void UpdatePrimFlags(uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVolumeDetect)
+ ///
+ ///
+ ///
+ ///
+ public void UpdatePrimFlags(uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect)
{
SceneObjectPart selectionPart = GetChildPart(localID);
- if (IsTemporary)
+ if (SetTemporary && Scene != null)
{
DetachFromBackup();
// Remove from database and parcel prim count
@@ -2876,23 +2911,27 @@ namespace OpenSim.Region.Framework.Scenes
if (selectionPart != null)
{
SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
+
+ if (Scene != null)
{
- SceneObjectPart part = parts[i];
- if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax ||
- part.Scale.Y > m_scene.RegionInfo.PhysPrimMax ||
- part.Scale.Z > m_scene.RegionInfo.PhysPrimMax)
+ for (int i = 0; i < parts.Length; i++)
{
- UsePhysics = false; // Reset physics
- break;
+ SceneObjectPart part = parts[i];
+ if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax ||
+ part.Scale.Y > m_scene.RegionInfo.PhysPrimMax ||
+ part.Scale.Z > m_scene.RegionInfo.PhysPrimMax)
+ {
+ UsePhysics = false; // Reset physics
+ break;
+ }
}
}
- RootPart.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
+ RootPart.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, SetVolumeDetect);
for (int i = 0; i < parts.Length; i++)
{
if (parts[i] != RootPart)
- parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
+ parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, SetVolumeDetect);
}
}
}
@@ -2966,202 +3005,152 @@ namespace OpenSim.Region.Framework.Scenes
#region Resize
///
- /// Resize the given part
+ /// Resize the entire group of prims.
///
///
- ///
- public void Resize(Vector3 scale, uint localID)
- {
- if (scale.X > m_scene.m_maxNonphys)
- scale.X = m_scene.m_maxNonphys;
- if (scale.Y > m_scene.m_maxNonphys)
- scale.Y = m_scene.m_maxNonphys;
- if (scale.Z > m_scene.m_maxNonphys)
- scale.Z = m_scene.m_maxNonphys;
- SceneObjectPart part = GetChildPart(localID);
- if (part != null)
- {
- if (part.PhysActor != null)
- {
- if (part.PhysActor.IsPhysical)
- {
- if (scale.X > m_scene.m_maxPhys)
- scale.X = m_scene.m_maxPhys;
- if (scale.Y > m_scene.m_maxPhys)
- scale.Y = m_scene.m_maxPhys;
- if (scale.Z > m_scene.m_maxPhys)
- scale.Z = m_scene.m_maxPhys;
- }
- part.PhysActor.Size = scale;
- m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
- }
- part.Resize(scale);
+ public void GroupResize(Vector3 scale)
+ {
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
+ RootPart.StoreUndoState(true);
- HasGroupChanged = true;
- part.TriggerScriptChangedEvent(Changed.SCALE);
- ScheduleGroupForFullUpdate();
+ scale.X = Math.Min(scale.X, Scene.m_maxNonphys);
+ scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys);
+ scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys);
- //if (part.UUID == m_rootPart.UUID)
- //{
- //if (m_rootPart.PhysActor != null)
- //{
- //m_rootPart.PhysActor.Size =
- //new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z);
- //m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
- //}
- //}
+ if (RootPart.PhysActor != null && RootPart.PhysActor.IsPhysical)
+ {
+ scale.X = Math.Min(scale.X, Scene.m_maxPhys);
+ scale.Y = Math.Min(scale.Y, Scene.m_maxPhys);
+ scale.Z = Math.Min(scale.Z, Scene.m_maxPhys);
}
- }
- public void GroupResize(Vector3 scale, uint localID)
- {
- SceneObjectPart part = GetChildPart(localID);
- if (part != null)
+ float x = (scale.X / RootPart.Scale.X);
+ float y = (scale.Y / RootPart.Scale.Y);
+ float z = (scale.Z / RootPart.Scale.Z);
+
+ SceneObjectPart[] parts;
+ if (x > 1.0f || y > 1.0f || z > 1.0f)
{
- if (scale.X > m_scene.m_maxNonphys)
- scale.X = m_scene.m_maxNonphys;
- if (scale.Y > m_scene.m_maxNonphys)
- scale.Y = m_scene.m_maxNonphys;
- if (scale.Z > m_scene.m_maxNonphys)
- scale.Z = m_scene.m_maxNonphys;
- if (part.PhysActor != null && part.PhysActor.IsPhysical)
- {
- if (scale.X > m_scene.m_maxPhys)
- scale.X = m_scene.m_maxPhys;
- if (scale.Y > m_scene.m_maxPhys)
- scale.Y = m_scene.m_maxPhys;
- if (scale.Z > m_scene.m_maxPhys)
- scale.Z = m_scene.m_maxPhys;
- }
- float x = (scale.X / part.Scale.X);
- float y = (scale.Y / part.Scale.Y);
- float z = (scale.Z / part.Scale.Z);
-
- SceneObjectPart[] parts;
- if (x > 1.0f || y > 1.0f || z > 1.0f)
- {
- parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
+ parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ {
+ SceneObjectPart obPart = parts[i];
+ if (obPart.UUID != m_rootPart.UUID)
{
- SceneObjectPart obPart = parts[i];
- if (obPart.UUID != m_rootPart.UUID)
+// obPart.IgnoreUndoUpdate = true;
+ Vector3 oldSize = new Vector3(obPart.Scale);
+
+ float f = 1.0f;
+ float a = 1.0f;
+
+ if (RootPart.PhysActor != null && RootPart.PhysActor.IsPhysical)
{
- obPart.IgnoreUndoUpdate = true;
- Vector3 oldSize = new Vector3(obPart.Scale);
+ if (oldSize.X * x > m_scene.m_maxPhys)
+ {
+ f = m_scene.m_maxPhys / oldSize.X;
+ a = f / x;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
- float f = 1.0f;
- float a = 1.0f;
+ if (oldSize.Y * y > m_scene.m_maxPhys)
+ {
+ f = m_scene.m_maxPhys / oldSize.Y;
+ a = f / y;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
- if (part.PhysActor != null && part.PhysActor.IsPhysical)
+ if (oldSize.Z * z > m_scene.m_maxPhys)
{
- if (oldSize.X*x > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.X;
- a = f / x;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Y*y > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.Y;
- a = f / y;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Z*z > m_scene.m_maxPhys)
- {
- f = m_scene.m_maxPhys / oldSize.Z;
- a = f / z;
- x *= a;
- y *= a;
- z *= a;
- }
+ f = m_scene.m_maxPhys / oldSize.Z;
+ a = f / z;
+ x *= a;
+ y *= a;
+ z *= a;
}
- else
+ }
+ else
+ {
+ if (oldSize.X * x > m_scene.m_maxNonphys)
{
- if (oldSize.X*x > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.X;
- a = f / x;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Y*y > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.Y;
- a = f / y;
- x *= a;
- y *= a;
- z *= a;
- }
- if (oldSize.Z*z > m_scene.m_maxNonphys)
- {
- f = m_scene.m_maxNonphys / oldSize.Z;
- a = f / z;
- x *= a;
- y *= a;
- z *= a;
- }
+ f = m_scene.m_maxNonphys / oldSize.X;
+ a = f / x;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+
+ if (oldSize.Y * y > m_scene.m_maxNonphys)
+ {
+ f = m_scene.m_maxNonphys / oldSize.Y;
+ a = f / y;
+ x *= a;
+ y *= a;
+ z *= a;
+ }
+
+ if (oldSize.Z * z > m_scene.m_maxNonphys)
+ {
+ f = m_scene.m_maxNonphys / oldSize.Z;
+ a = f / z;
+ x *= a;
+ y *= a;
+ z *= a;
}
- obPart.IgnoreUndoUpdate = false;
}
+
+// obPart.IgnoreUndoUpdate = false;
}
}
+ }
- Vector3 prevScale = part.Scale;
- prevScale.X *= x;
- prevScale.Y *= y;
- prevScale.Z *= z;;
-
- part.IgnoreUndoUpdate = false;
- part.StoreUndoState(UndoType.STATE_GROUP_SCALE);
- part.IgnoreUndoUpdate = true;
- part.Resize(prevScale);
+ Vector3 prevScale = RootPart.Scale;
+ prevScale.X *= x;
+ prevScale.Y *= y;
+ prevScale.Z *= z;
part.IgnoreUndoUpdate = false;
- parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
+// RootPart.IgnoreUndoUpdate = true;
+ RootPart.Resize(prevScale);
+// RootPart.IgnoreUndoUpdate = false;
+
+ parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ {
+ SceneObjectPart obPart = parts[i];
+
+ if (obPart.UUID != m_rootPart.UUID)
{
- SceneObjectPart obPart = parts[i];
obPart.IgnoreUndoUpdate = true;
- if (obPart.UUID != m_rootPart.UUID)
- {
- if (obPart.UUID != m_rootPart.UUID)
- {
- obPart.IgnoreUndoUpdate = false;
- obPart.StoreUndoState(UndoType.STATE_GROUP_SCALE);
- obPart.IgnoreUndoUpdate = true;
-
- Vector3 currentpos = new Vector3(obPart.OffsetPosition);
- currentpos.X *= x;
- currentpos.Y *= y;
- currentpos.Z *= z;
- Vector3 newSize = new Vector3(obPart.Scale);
- newSize.X *= x;
- newSize.Y *= y;
- newSize.Z *= z;
- obPart.Resize(newSize);
- obPart.UpdateOffSet(currentpos);
- }
- obPart.IgnoreUndoUpdate = false;
- }
- obPart.IgnoreUndoUpdate = false;
- }
- if (part.PhysActor != null)
- {
- part.PhysActor.Size = prevScale;
- m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
+ Vector3 currentpos = new Vector3(obPart.OffsetPosition);
+ currentpos.X *= x;
+ currentpos.Y *= y;
+ currentpos.Z *= z;
+
+ Vector3 newSize = new Vector3(obPart.Scale);
+ newSize.X *= x;
+ newSize.Y *= y;
+ newSize.Z *= z;
+
+ obPart.Resize(newSize);
+ obPart.UpdateOffSet(currentpos);
+
+ obPart.IgnoreUndoUpdate = false;
}
- part.IgnoreUndoUpdate = false;
+// obPart.IgnoreUndoUpdate = false;
HasGroupChanged = true;
m_rootPart.TriggerScriptChangedEvent(Changed.SCALE);
ScheduleGroupForTerseUpdate();
}
+
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Finished group resizing {0} {1} to {2}", Name, LocalId, RootPart.Scale);
}
#endregion
@@ -3174,6 +3163,14 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupPosition(Vector3 pos)
{
+// m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos);
+
+ RootPart.StoreUndoState(true);
+
+// SceneObjectPart[] parts = m_parts.GetArray();
+// for (int i = 0; i < parts.Length; i++)
+// parts[i].StoreUndoState();
+
if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
{
if (IsAttachment)
@@ -3210,12 +3207,18 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = GetChildPart(localID);
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_PRIM_POSITION);
+// SceneObjectPart[] parts = m_parts.GetArray();
+// for (int i = 0; i < parts.Length; i++)
+// parts[i].StoreUndoState();
if (part != null)
{
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos);
+
+ part.StoreUndoState(false);
+ part.IgnoreUndoUpdate = true;
+
if (part.UUID == m_rootPart.UUID)
{
UpdateRootPosition(pos);
@@ -3226,18 +3229,22 @@ namespace OpenSim.Region.Framework.Scenes
}
HasGroupChanged = true;
+ part.IgnoreUndoUpdate = false;
}
}
///
- ///
+ /// Update just the root prim position in a linkset
///
///
- private void UpdateRootPosition(Vector3 pos)
+ public void UpdateRootPosition(Vector3 pos)
{
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_PRIM_POSITION);
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Updating root position of {0} {1} to {2}", Name, LocalId, pos);
+
+// SceneObjectPart[] parts = m_parts.GetArray();
+// for (int i = 0; i < parts.Length; i++)
+// parts[i].StoreUndoState();
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
Vector3 oldPos =
@@ -3250,7 +3257,7 @@ namespace OpenSim.Region.Framework.Scenes
axDiff *= Quaternion.Inverse(partRotation);
diff = axDiff;
- parts = m_parts.GetArray();
+ SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart obPart = parts[i];
@@ -3296,9 +3303,14 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupRotationR(Quaternion rot)
{
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_GROUP_ROTATION);
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Updating group rotation R of {0} {1} to {2}", Name, LocalId, rot);
+
+// SceneObjectPart[] parts = m_parts.GetArray();
+// for (int i = 0; i < parts.Length; i++)
+// parts[i].StoreUndoState();
+
+ m_rootPart.StoreUndoState(true);
m_rootPart.UpdateRotation(rot);
@@ -3320,9 +3332,15 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot)
{
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_GROUP_ROTATION);
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Updating group rotation PR of {0} {1} to {2}", Name, LocalId, rot);
+
+// SceneObjectPart[] parts = m_parts.GetArray();
+// for (int i = 0; i < parts.Length; i++)
+// parts[i].StoreUndoState();
+
+ RootPart.StoreUndoState(true);
+ RootPart.IgnoreUndoUpdate = true;
m_rootPart.UpdateRotation(rot);
@@ -3337,6 +3355,8 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
ScheduleGroupForTerseUpdate();
+
+ RootPart.IgnoreUndoUpdate = false;
}
///
@@ -3353,6 +3373,9 @@ namespace OpenSim.Region.Framework.Scenes
if (part != null)
{
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Updating single rotation of {0} {1} to {2}", part.Name, part.LocalId, rot);
+
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
@@ -3374,6 +3397,13 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}",
+// part.Name, part.LocalId, rot);
+
+ part.StoreUndoState();
+ part.IgnoreUndoUpdate = true;
+
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
@@ -3390,12 +3420,11 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
- part.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
- part.IgnoreUndoUpdate = true;
part.UpdateRotation(rot);
part.OffsetPosition = pos;
- part.IgnoreUndoUpdate = false;
}
+
+ part.IgnoreUndoUpdate = false;
}
}
@@ -3403,8 +3432,12 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- private void UpdateRootRotation(Quaternion rot)
+ public void UpdateRootRotation(Quaternion rot)
{
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}",
+// Name, LocalId, rot);
+
Quaternion axRot = rot;
Quaternion oldParentRot = m_rootPart.RotationOffset;
@@ -3440,14 +3473,25 @@ namespace OpenSim.Region.Framework.Scenes
prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset);
prim.IgnoreUndoUpdate = false;
+ prim.IgnoreUndoUpdate = false;
}
}
- if (cancelUndo == true)
- {
- m_rootPart.Undoing = false;
- }
+
+// for (int i = 0; i < parts.Length; i++)
+// {
+// SceneObjectPart childpart = parts[i];
+// if (childpart != m_rootPart)
+// {
+//// childpart.IgnoreUndoUpdate = false;
+//// childpart.StoreUndoState();
+// }
+// }
HasGroupChanged = true;
ScheduleGroupForFullUpdate();
+
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Updated root rotation of {0} {1} to {2}",
+// Name, LocalId, rot);
}
#endregion
@@ -3462,28 +3506,23 @@ namespace OpenSim.Region.Framework.Scenes
int yaxis = 4;
int zaxis = 8;
- if (m_rootPart != null)
- {
- setX = ((axis & xaxis) != 0) ? true : false;
- setY = ((axis & yaxis) != 0) ? true : false;
- setZ = ((axis & zaxis) != 0) ? true : false;
+ setX = ((axis & xaxis) != 0) ? true : false;
+ setY = ((axis & yaxis) != 0) ? true : false;
+ setZ = ((axis & zaxis) != 0) ? true : false;
- float setval = (rotate10 > 0) ? 1f : 0f;
+ float setval = (rotate10 > 0) ? 1f : 0f;
- if (setX)
- m_rootPart.RotationAxis.X = setval;
- if (setY)
- m_rootPart.RotationAxis.Y = setval;
- if (setZ)
- m_rootPart.RotationAxis.Z = setval;
+ if (setX)
+ RootPart.RotationAxis.X = setval;
+ if (setY)
+ RootPart.RotationAxis.Y = setval;
+ if (setZ)
+ RootPart.RotationAxis.Z = setval;
- if (setX || setY || setZ)
- {
- m_rootPart.SetPhysicsAxisRotation();
- }
-
- }
+ if (setX || setY || setZ)
+ RootPart.SetPhysicsAxisRotation();
}
+
public int registerRotTargetWaypoint(Quaternion target, float tolerance)
{
scriptRotTarget waypoint = new scriptRotTarget();
@@ -3611,7 +3650,13 @@ namespace OpenSim.Region.Framework.Scenes
foreach (uint idx in m_rotTargets.Keys)
{
scriptRotTarget target = m_rotTargets[idx];
- double angle = Math.Acos(target.targetRot.X * m_rootPart.RotationOffset.X + target.targetRot.Y * m_rootPart.RotationOffset.Y + target.targetRot.Z * m_rootPart.RotationOffset.Z + target.targetRot.W * m_rootPart.RotationOffset.W) * 2;
+ double angle
+ = Math.Acos(
+ target.targetRot.X * m_rootPart.RotationOffset.X
+ + target.targetRot.Y * m_rootPart.RotationOffset.Y
+ + target.targetRot.Z * m_rootPart.RotationOffset.Z
+ + target.targetRot.W * m_rootPart.RotationOffset.W)
+ * 2;
if (angle < 0) angle = -angle;
if (angle > Math.PI) angle = (Math.PI * 2 - angle);
if (angle <= target.tolerance)
@@ -3676,43 +3721,28 @@ namespace OpenSim.Region.Framework.Scenes
return retmass;
}
-
+
+ ///
+ /// If the object is a sculpt/mesh, retrieve the mesh data for each part and reinsert it into each shape so that
+ /// the physics engine can use it.
+ ///
+ ///
+ /// When the physics engine has finished with it, the sculpt data is discarded to save memory.
+ ///
public void CheckSculptAndLoad()
{
if (IsDeleted)
return;
+
if ((RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0)
return;
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- {
- SceneObjectPart part = parts[i];
- if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero)
- {
- // check if a previously decoded sculpt map has been cached
- if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + part.Shape.SculptTexture.ToString())))
- {
- part.SculptTextureCallback(part.Shape.SculptTexture, null);
- }
- else
- {
- m_scene.AssetService.Get(
- part.Shape.SculptTexture.ToString(), part, AssetReceived);
- }
- }
- }
- }
+// m_log.Debug("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
- protected void AssetReceived(string id, Object sender, AssetBase asset)
- {
- SceneObjectPart sop = (SceneObjectPart)sender;
+ SceneObjectPart[] parts = m_parts.GetArray();
- if (sop != null)
- {
- if (asset != null)
- sop.SculptTextureCallback(asset.FullID, asset);
- }
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].CheckSculptAndLoad();
}
///
@@ -3747,19 +3777,12 @@ namespace OpenSim.Region.Framework.Scenes
return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition);
}
- public void SetAttachmentPoint(byte point)
- {
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].SetAttachmentPoint(point);
- }
-
#region ISceneObject
public virtual ISceneObject CloneForNewScene()
{
SceneObjectGroup sog = Copy(false);
- sog.m_isDeleted = false;
+ sog.IsDeleted = false;
return sog;
}
--
cgit v1.1
From 03f6734f4367b08e2b181ed68bc80b885e76148f Mon Sep 17 00:00:00 2001
From: Tom
Date: Wed, 7 Sep 2011 09:42:18 -0700
Subject: First set of merge fixes
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 87 +++++++---------------
1 file changed, 26 insertions(+), 61 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 88a6232..35684e0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -350,10 +350,6 @@ namespace OpenSim.Region.Framework.Scenes
{
get { return m_rotation; }
set {
- foreach(SceneObjectPart p in m_parts.GetArray())
- {
- p.StoreUndoState(UndoType.STATE_GROUP_ROTATION);
- }
m_rotation = value;
}
}
@@ -487,8 +483,6 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart[] parts = m_parts.GetArray();
foreach (SceneObjectPart part in parts)
{
- part.IgnoreUndoUpdate = false;
- part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
part.GroupPosition = val;
if (!m_dupeInProgress)
{
@@ -1193,45 +1187,31 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
- public void AttachToAgent(UUID agentID, uint attachmentpoint, Vector3 AttachOffset, bool silent)
+ private void AttachToAgent(
+ ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent)
{
- ScenePresence avatar = m_scene.GetScenePresence(agentID);
if (avatar != null)
{
// don't attach attachments to child agents
if (avatar.IsChildAgent) return;
-// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
-
- DetachFromBackup();
-
// Remove from database and parcel prim count
- m_scene.DeleteFromStorage(UUID);
+ m_scene.DeleteFromStorage(so.UUID);
m_scene.EventManager.TriggerParcelPrimCountTainted();
- m_rootPart.AttachedAvatar = agentID;
+ so.AttachedAvatar = avatar.UUID;
- //Anakin Lohner bug #3839
- lock (m_parts)
+ if (so.RootPart.PhysActor != null)
{
- foreach (SceneObjectPart p in m_parts.GetArray())
- {
- p.AttachedAvatar = agentID;
- }
+ m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor);
+ so.RootPart.PhysActor = null;
}
- if (m_rootPart.PhysActor != null)
- {
- m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor);
- m_rootPart.PhysActor = null;
- }
-
- AbsolutePosition = AttachOffset;
- m_rootPart.AttachedPos = AttachOffset;
- m_rootPart.IsAttachment = true;
-
- m_rootPart.SetParentLocalId(avatar.LocalId);
- SetAttachmentPoint(Convert.ToByte(attachmentpoint));
+ so.AbsolutePosition = attachOffset;
+ so.RootPart.AttachedPos = attachOffset;
+ so.IsAttachment = true;
+ so.RootPart.SetParentLocalId(avatar.LocalId);
+ so.AttachmentPoint = attachmentpoint;
avatar.AddAttachment(this);
@@ -1254,7 +1234,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_log.WarnFormat(
"[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present",
- UUID, agentID, Scene.RegionInfo.RegionName);
+ UUID, avatar.ControllingClient.AgentId, Scene.RegionInfo.RegionName);
}
}
@@ -1263,11 +1243,6 @@ namespace OpenSim.Region.Framework.Scenes
return m_rootPart.Shape.State;
}
- public void ClearPartAttachmentData()
- {
- SetAttachmentPoint((Byte)0);
- }
-
public void DetachToGround()
{
ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar);
@@ -1788,19 +1763,19 @@ namespace OpenSim.Region.Framework.Scenes
// This is only necessary when userExposed is false!
- bool previousAttachmentStatus = dupe.IsAttachment;
+ bool previousAttachmentStatus = dupe.IsAttachment;
- if (!userExposed)
- dupe.IsAttachment = true;
+ if (!userExposed)
+ dupe.IsAttachment = true;
if (!userExposed)
dupe.RootPart.IsAttachment = true;
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
- if (!userExposed)
- {
- dupe.IsAttachment = previousAttachmentStatus;
- }
+ if (!userExposed)
+ {
+ dupe.IsAttachment = previousAttachmentStatus;
+ }
if (!userExposed)
{
@@ -1855,8 +1830,8 @@ namespace OpenSim.Region.Framework.Scenes
dupe.UpdateParentIDs();
dupe.HasGroupChanged = true;
dupe.AttachToBackup();
-
- ScheduleGroupForFullUpdate();
+ }
+ ScheduleGroupForFullUpdate();
// Need to duplicate the physics actor as well
if (part.PhysActor != null && userExposed)
{
@@ -3175,7 +3150,6 @@ namespace OpenSim.Region.Framework.Scenes
{
if (IsAttachment)
{
- m_rootPart.StoreUndoState(UndoType.STATE_GROUP_POSITION);
m_rootPart.AttachedPos = pos;
}
if (RootPart.GetStatusSandbox())
@@ -3207,9 +3181,9 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = GetChildPart(localID);
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].StoreUndoState();
if (part != null)
{
@@ -3368,8 +3342,6 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = GetChildPart(localID);
SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState(UndoType.STATE_PRIM_ROTATION);
if (part != null)
{
@@ -3440,14 +3412,7 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion axRot = rot;
Quaternion oldParentRot = m_rootPart.RotationOffset;
-
- m_rootPart.StoreUndoState(UndoType.STATE_PRIM_ROTATION);
- bool cancelUndo = false;
- if (!m_rootPart.Undoing)
- {
- m_rootPart.Undoing = true;
- cancelUndo = true;
- }
+ m_rootPart.StoreUndoState();
//Don't use UpdateRotation because it schedules an update prematurely
m_rootPart.RotationOffset = rot;
--
cgit v1.1
From cda4cd6b551156ed503a5f284ad6c5a9a0e1c5a5 Mon Sep 17 00:00:00 2001
From: Tom
Date: Wed, 14 Sep 2011 18:46:42 -0700
Subject: Merge fixes, and fix the build
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 166 ++++++++-------------
1 file changed, 61 insertions(+), 105 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 35684e0..ea6aab0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1245,7 +1245,7 @@ namespace OpenSim.Region.Framework.Scenes
public void DetachToGround()
{
- ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar);
+ ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
if (avatar == null)
return;
@@ -1259,14 +1259,14 @@ namespace OpenSim.Region.Framework.Scenes
RootPart.FromItemID = UUID.Zero;
AbsolutePosition = detachedpos;
- m_rootPart.AttachedAvatar = UUID.Zero;
+ AttachedAvatar = UUID.Zero;
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].AttachedAvatar = UUID.Zero;
+ //SceneObjectPart[] parts = m_parts.GetArray();
+ //for (int i = 0; i < parts.Length; i++)
+ // parts[i].AttachedAvatar = UUID.Zero;
m_rootPart.SetParentLocalId(0);
- SetAttachmentPoint((byte)0);
+ AttachmentPoint = (byte)0;
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_scene.m_physicalPrim);
HasGroupChanged = true;
RootPart.Rezzed = DateTime.Now;
@@ -1279,7 +1279,7 @@ namespace OpenSim.Region.Framework.Scenes
public void DetachToInventoryPrep()
{
- ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.AttachedAvatar);
+ ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
//Vector3 detachedpos = new Vector3(127f, 127f, 127f);
if (avatar != null)
{
@@ -1287,15 +1287,15 @@ namespace OpenSim.Region.Framework.Scenes
avatar.RemoveAttachment(this);
}
- m_rootPart.AttachedAvatar = UUID.Zero;
+ AttachedAvatar = UUID.Zero;
- SceneObjectPart[] parts = m_parts.GetArray();
+ /*SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
- parts[i].AttachedAvatar = UUID.Zero;
+ parts[i].AttachedAvatar = UUID.Zero;*/
m_rootPart.SetParentLocalId(0);
//m_rootPart.SetAttachmentPoint((byte)0);
- m_rootPart.IsAttachment = false;
+ IsAttachment = false;
AbsolutePosition = m_rootPart.AttachedPos;
//m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
//AttachToBackup();
@@ -1471,7 +1471,7 @@ namespace OpenSim.Region.Framework.Scenes
public void DeleteGroupFromScene(bool silent)
{
// We need to keep track of this state in case this group is still queued for backup.
- m_isDeleted = true;
+ IsDeleted = true;
DetachFromBackup();
@@ -1746,97 +1746,63 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectGroup Copy(bool userExposed)
{
- SceneObjectGroup dupe;
- try
- {
- m_dupeInProgress = true;
- dupe = (SceneObjectGroup)MemberwiseClone();
- dupe.m_isBackedUp = false;
- dupe.m_parts = new MapAndArray();
+ SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
+ dupe.m_isBackedUp = false;
+ dupe.m_parts = new MapAndArray();
- // Warning, The following code related to previousAttachmentStatus is needed so that clones of
- // attachments do not bordercross while they're being duplicated. This is hacktastic!
- // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
- // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
- // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
- // then restore it's attachment state
+ // Warning, The following code related to previousAttachmentStatus is needed so that clones of
+ // attachments do not bordercross while they're being duplicated. This is hacktastic!
+ // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
+ // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
+ // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
+ // then restore it's attachment state
- // This is only necessary when userExposed is false!
+ // This is only necessary when userExposed is false!
- bool previousAttachmentStatus = dupe.IsAttachment;
-
- if (!userExposed)
- dupe.IsAttachment = true;
+ bool previousAttachmentStatus = dupe.IsAttachment;
- if (!userExposed)
- dupe.RootPart.IsAttachment = true;
+ if (!userExposed)
+ dupe.IsAttachment = true;
- dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
- if (!userExposed)
- {
- dupe.IsAttachment = previousAttachmentStatus;
- }
+ dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
- if (!userExposed)
- {
- dupe.RootPart.IsAttachment = previousAttachmentStatus;
- }
+ if (!userExposed)
+ {
+ dupe.IsAttachment = previousAttachmentStatus;
+ }
- dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
- dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
+ dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
+ dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
- if (userExposed)
- dupe.m_rootPart.TrimPermissions();
+ if (userExposed)
+ dupe.m_rootPart.TrimPermissions();
- List partList = new List(m_parts.GetArray());
+ List partList = new List(m_parts.GetArray());
- partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
- {
- return p1.LinkNum.CompareTo(p2.LinkNum);
- }
- );
+ partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2)
+ {
+ return p1.LinkNum.CompareTo(p2.LinkNum);
+ }
+ );
- foreach (SceneObjectPart part in partList)
+ foreach (SceneObjectPart part in partList)
+ {
+ SceneObjectPart newPart;
+ if (part.UUID != m_rootPart.UUID)
{
- if (part.UUID != m_rootPart.UUID)
- {
- SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
-
- newPart.LinkNum = part.LinkNum;
- }
-
- // Need to duplicate the physics actor as well
- if (part.PhysActor != null && userExposed)
- {
- PrimitiveBaseShape pbs = part.Shape;
-
- part.PhysActor
- = m_scene.PhysicsScene.AddPrimShape(
- string.Format("{0}/{1}", part.Name, part.UUID),
- pbs,
- part.AbsolutePosition,
- part.Scale,
- part.RotationOffset,
- part.PhysActor.IsPhysical,
- m_localId);
- part.PhysActor.SetMaterial((int)part.Material);
-
- part.PhysActor.LocalID = part.LocalId;
- part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
- }
+ newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
+ newPart.LinkNum = part.LinkNum;
}
- if (userExposed)
+ else
{
- dupe.UpdateParentIDs();
- dupe.HasGroupChanged = true;
- dupe.AttachToBackup();
+ newPart = dupe.m_rootPart;
}
- ScheduleGroupForFullUpdate();
+
// Need to duplicate the physics actor as well
if (part.PhysActor != null && userExposed)
{
PrimitiveBaseShape pbs = newPart.Shape;
-
+
newPart.PhysActor
= m_scene.PhysicsScene.AddPrimShape(
string.Format("{0}/{1}", newPart.Name, newPart.UUID),
@@ -1846,14 +1812,20 @@ namespace OpenSim.Region.Framework.Scenes
newPart.RotationOffset,
part.PhysActor.IsPhysical,
newPart.LocalId);
-
+
newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
}
}
- finally
+
+ if (userExposed)
{
- m_dupeInProgress = false;
+ dupe.UpdateParentIDs();
+ dupe.HasGroupChanged = true;
+ dupe.AttachToBackup();
+
+ ScheduleGroupForFullUpdate();
}
+
return dupe;
}
@@ -1983,22 +1955,8 @@ namespace OpenSim.Region.Framework.Scenes
public void stopMoveToTarget()
{
- SceneObjectPart rootpart = m_rootPart;
- if (rootpart != null)
- {
- if (IsAttachment)
- {
- ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
- if (avatar != null) avatar.StopMoveToPosition();
- }
- else
- {
- if (rootpart.PhysActor != null)
- {
- rootpart.PhysActor.PIDActive = false;
- }
- }
- }
+ if (RootPart.PhysActor != null)
+ RootPart.PhysActor.PIDActive = false;
}
public void rotLookAt(Quaternion target, float strength, float damping)
@@ -3087,8 +3045,6 @@ namespace OpenSim.Region.Framework.Scenes
prevScale.X *= x;
prevScale.Y *= y;
prevScale.Z *= z;
- part.IgnoreUndoUpdate = false;
-
// RootPart.IgnoreUndoUpdate = true;
RootPart.Resize(prevScale);
// RootPart.IgnoreUndoUpdate = false;
--
cgit v1.1
From 300d357573a272ef0042ebbe0912ab88de958f65 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 6 Oct 2011 17:55:20 +0200
Subject: Fix physics proxy position when linking and rotating the root prim
only
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6c47645..58f2586 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2397,6 +2397,7 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion oldRootRotation = linkPart.RotationOffset;
linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
+ linkPart.ParentID = m_rootPart.LocalId;
linkPart.GroupPosition = AbsolutePosition;
Vector3 axPos = linkPart.OffsetPosition;
@@ -3431,14 +3432,17 @@ namespace OpenSim.Region.Framework.Scenes
if (prim.UUID != m_rootPart.UUID)
{
prim.IgnoreUndoUpdate = true;
+
+ Quaternion NewRot = oldParentRot * prim.RotationOffset;
+ NewRot = Quaternion.Inverse(axRot) * NewRot;
+ prim.RotationOffset = NewRot;
+
Vector3 axPos = prim.OffsetPosition;
axPos *= oldParentRot;
axPos *= Quaternion.Inverse(axRot);
prim.OffsetPosition = axPos;
- prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset);
-
prim.IgnoreUndoUpdate = false;
}
}
--
cgit v1.1
From 585f1b189fa6248c0620963d9c39d50a6a33e11e Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 25 Oct 2011 02:08:43 +0100
Subject: Merge
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 2507c67..fae1618 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1267,7 +1267,7 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.SetParentLocalId(0);
AttachmentPoint = (byte)0;
- m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_scene.m_physicalPrim);
+ m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
HasGroupChanged = true;
RootPart.Rezzed = DateTime.Now;
RootPart.RemFlag(PrimFlags.TemporaryOnRez);
--
cgit v1.1
From ce8419fdd0d3384a9df037d9df1b5d7d8960d1d8 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 2 Nov 2011 23:42:09 +0100
Subject: Fix link order when linking sets to sets
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 50 +++++-----------------
1 file changed, 11 insertions(+), 39 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8b71f5b..3a863e7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2351,16 +2351,6 @@ namespace OpenSim.Region.Framework.Scenes
/// The group of prims which should be linked to this group
public void LinkToGroup(SceneObjectGroup objectGroup)
{
- // Make sure we have sent any pending unlinks or stuff.
- //if (objectGroup.RootPart.UpdateFlag > 0)
- //{
- // m_log.WarnFormat(
- // "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.",
- // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
-
- // objectGroup.RootPart.SendScheduledUpdates();
- //}
-
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
@@ -2384,45 +2374,27 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.RotationOffset = newRot;
linkPart.ParentID = m_rootPart.LocalId;
+
if (m_rootPart.LinkNum == 0)
m_rootPart.LinkNum = 1;
lock (m_parts.SyncRoot)
{
- m_parts.Add(linkPart.UUID, linkPart);
-
- // Insert in terms of link numbers, the new links
- // before the current ones (with the exception of
- // the root prim. Shuffle the old ones up
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- {
- SceneObjectPart part = parts[i];
- if (part.LinkNum != 1)
- {
- // Don't update root prim link number
- part.LinkNum += objectGroup.PrimCount;
- }
- }
- }
+ int linkNum = PrimCount + 1;
- linkPart.LinkNum = 2;
+ m_parts.Add(linkPart.UUID, linkPart);
- linkPart.SetParent(this);
- linkPart.CreateSelected = true;
+ linkPart.SetParent(this);
+ linkPart.CreateSelected = true;
- lock (m_parts.SyncRoot)
- {
- //if (linkPart.PhysActor != null)
- //{
- // m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor);
+ linkPart.LinkNum = linkNum++;
- //linkPart.PhysActor = null;
- //}
-
- //TODO: rest of parts
- int linkNum = 3;
SceneObjectPart[] ogParts = objectGroup.Parts;
+ Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b)
+ {
+ return a.LinkNum - b.LinkNum;
+ });
+
for (int i = 0; i < ogParts.Length; i++)
{
SceneObjectPart part = ogParts[i];
--
cgit v1.1
From 5490a3e549c2c1753bf562cef53ad70250731081 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 6 Dec 2011 19:44:45 +0100
Subject: Fix phantom and temp flags not taking
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index dd5e986..cf2161a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2811,11 +2811,11 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- RootPart.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, SetVolumeDetect);
+ RootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
for (int i = 0; i < parts.Length; i++)
{
if (parts[i] != RootPart)
- parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, SetVolumeDetect);
+ parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
}
}
}
--
cgit v1.1
From 8a9a8ed5c903f3f685dfff2fd81a2c9594a12584 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sat, 17 Dec 2011 12:31:25 +0100
Subject: Fix hit testing link sets properly. Fix raycasting for LSL.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 67eafd5..09cbbfe 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -789,6 +789,10 @@ namespace OpenSim.Region.Framework.Scenes
EntityIntersection result = new EntityIntersection();
SceneObjectPart[] parts = m_parts.GetArray();
+
+ // Find closest hit here
+ float idist = float.MaxValue;
+
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
@@ -803,11 +807,6 @@ namespace OpenSim.Region.Framework.Scenes
EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation, frontFacesOnly, faceCenters);
- // This may need to be updated to the maximum draw distance possible..
- // We might (and probably will) be checking for prim creation from other sims
- // when the camera crosses the border.
- float idist = Constants.RegionSize;
-
if (inter.HitTF)
{
// We need to find the closest prim to return to the testcaller along the ray
@@ -818,8 +817,9 @@ namespace OpenSim.Region.Framework.Scenes
result.obj = part;
result.normal = inter.normal;
result.distance = inter.distance;
+
+ idist = inter.distance;
}
-
}
}
return result;
--
cgit v1.1
From 32b8fa4a77fb7837b8f583243babca225eac6277 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 5 Jan 2012 07:37:09 +0100
Subject: Prevent spurious "CHANGED_POSITION" during region backup
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 48a870e..3b0d1cd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -481,13 +481,14 @@ namespace OpenSim.Region.Framework.Scenes
}
}
SceneObjectPart[] parts = m_parts.GetArray();
+ bool triggerScriptEvent = m_rootPart.GroupPosition != val;
+ if (m_dupeInProgress)
+ triggerScriptEvent = false;
foreach (SceneObjectPart part in parts)
{
part.GroupPosition = val;
- if (!m_dupeInProgress)
- {
+ if (triggerScriptEvent)
part.TriggerScriptChangedEvent(Changed.POSITION);
- }
}
if (!m_dupeInProgress)
{
--
cgit v1.1
From 6fe4b6fbe807672ec64700ff8c6307a2a3e4f084 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 2 Feb 2012 02:51:59 +0100
Subject: Fix remembering attachment point and position when an item is rezzed
in world. Also fix PRIM_LOCAL_POS returning 0 when used on child prims from a
script in the root.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c31cbab..6485710 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2351,6 +2351,11 @@ namespace OpenSim.Region.Framework.Scenes
/// The group of prims which should be linked to this group
public void LinkToGroup(SceneObjectGroup objectGroup)
{
+ LinkToGroup(objectGroup, false);
+ }
+
+ public void LinkToGroup(SceneObjectGroup objectGroup, bool insert)
+ {
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
@@ -2380,7 +2385,20 @@ namespace OpenSim.Region.Framework.Scenes
lock (m_parts.SyncRoot)
{
- int linkNum = PrimCount + 1;
+ int linkNum;
+ if (insert)
+ {
+ linkNum = 2;
+ foreach (SceneObjectPart part in Parts)
+ {
+ if (part.LinkNum > 1)
+ part.LinkNum++;
+ }
+ }
+ else
+ {
+ linkNum = PrimCount + 1;
+ }
m_parts.Add(linkPart.UUID, linkPart);
--
cgit v1.1
From 6af01f6767838235091b9e34cdaea05951d68f68 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 8 Feb 2012 23:14:53 +0000
Subject: initial introdution of physics actor building control.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 47 +++++++++++++++++++---
1 file changed, 41 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 46c4d7b..2a3d735 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1281,7 +1281,8 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.SetParentLocalId(0);
AttachmentPoint = (byte)0;
- m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
+ // must check if buildind should be true or false here
+ m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive,false);
HasGroupChanged = true;
RootPart.Rezzed = DateTime.Now;
RootPart.RemFlag(PrimFlags.TemporaryOnRez);
@@ -1581,21 +1582,33 @@ namespace OpenSim.Region.Framework.Scenes
public void ApplyPhysics()
{
// Apply physics to the root prim
- m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
+ // m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
// Apply physics to child prims
SceneObjectPart[] parts = m_parts.GetArray();
if (parts.Length > 1)
{
+ ResetChildPrimPhysicsPositions();
+
+ // Apply physics to the root prim
+ m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, true);
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (part.LocalId != m_rootPart.LocalId)
- part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive);
- }
+// part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive);
+ part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, true);
+ }
// Hack to get the physics scene geometries in the right spot
- ResetChildPrimPhysicsPositions();
+// ResetChildPrimPhysicsPositions();
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = false;
+ }
+ else
+ {
+ // Apply physics to the root prim
+ m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, false);
}
}
@@ -1829,13 +1842,16 @@ namespace OpenSim.Region.Framework.Scenes
pbs,
newPart.AbsolutePosition,
newPart.Scale,
- newPart.RotationOffset,
+ //newPart.RotationOffset,
+ newPart.GetWorldRotation(),
part.PhysActor.IsPhysical,
newPart.LocalId);
newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
}
}
+ if (dupe.m_rootPart.PhysActor != null && userExposed)
+ dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building
if (userExposed)
{
@@ -2849,12 +2865,31 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+/*
RootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
for (int i = 0; i < parts.Length; i++)
{
if (parts[i] != RootPart)
parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
}
+*/
+ if (parts.Length > 1)
+ {
+ m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
+
+ for (int i = 0; i < parts.Length; i++)
+ {
+
+ if (parts[i].UUID != m_rootPart.UUID)
+ parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
+ }
+
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = false;
+ }
+ else
+ m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, false);
+
}
}
--
cgit v1.1
From e3213065173e1408a138eb0bce0c9e936073b19b Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 14 Feb 2012 00:02:53 +0100
Subject: Prevent object loss and positioning outside the region with failed
object sim crossings
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 683aafc..877fe96 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -466,6 +466,10 @@ namespace OpenSim.Region.Framework.Scenes
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
+
+ if (IsDeleted)
+ return;
+ val = AbsolutePosition;
}
}
--
cgit v1.1
From 2d3381b795611a8857077d1effb41323c2cb8658 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 14 Feb 2012 23:16:20 +0100
Subject: Implement region crossing of sitting avatars. Edit mode and llSetPos
work but unscripted default sit anim is lost. Still some Gfx glitching.
Physical crossing doesn't work yet.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 89 +++++++++++++++++++++-
1 file changed, 86 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 877fe96..a4ca0fb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -465,10 +465,76 @@ namespace OpenSim.Region.Framework.Scenes
|| Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{
- m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
+ IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface();
+ uint x = 0;
+ uint y = 0;
+ string version = String.Empty;
+ Vector3 newpos = Vector3.Zero;
+ OpenSim.Services.Interfaces.GridRegion destination = null;
+
+ bool canCross = true;
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ // We need to cross these agents. First, let's find
+ // out if any of them can't cross for some reason.
+ // We have to deny the crossing entirely if any
+ // of them are banned. Alternatively, we could
+ // unsit banned agents....
+
+
+ // We set the avatar position as being the object
+ // position to get the region to send to
+ if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out x, out y, out version, out newpos)) == null)
+ {
+ canCross = false;
+ break;
+ }
+
+ m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
+ }
+
+ if (canCross)
+ {
+ // We unparent the SP quietly so that it won't
+ // be made to stand up
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID);
+ if (parentPart != null)
+ av.ParentUUID = parentPart.UUID;
+
+ av.ParentID = 0;
+ }
+
+ m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
+
+ // Normalize
+ if (val.X >= Constants.RegionSize)
+ val.X -= Constants.RegionSize;
+ if (val.Y >= Constants.RegionSize)
+ val.Y -= Constants.RegionSize;
+ if (val.X < 0)
+ val.X += Constants.RegionSize;
+ if (val.Y < 0)
+ val.Y += Constants.RegionSize;
+
+ // If it's deleted, crossing was successful
+ if (IsDeleted)
+ {
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
+
+ av.IsInTransit = true;
+
+ CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
+ d.BeginInvoke(av, val, x, y, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
+ }
+
+ return;
+ }
+ }
- if (IsDeleted)
- return;
val = AbsolutePosition;
}
}
@@ -528,6 +594,23 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ private void CrossAgentToNewRegionCompleted(IAsyncResult iar)
+ {
+ CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState;
+ ScenePresence agent = icon.EndInvoke(iar);
+
+ //// If the cross was successful, this agent is a child agent
+ //if (agent.IsChildAgent)
+ // agent.Reset();
+ //else // Not successful
+ // agent.RestoreInCurrentScene();
+
+ // In any case
+ agent.IsInTransit = false;
+
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
+ }
+
public override uint LocalId
{
get { return m_rootPart.LocalId; }
--
cgit v1.1
From f6f0d884bda8b5179d04a9cfe15efa3908552bcc Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 15 Feb 2012 17:08:33 +0000
Subject: try to make crossings work better. chode no longer prevents
crossings i hope
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a4ca0fb..d964a6f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -461,8 +461,11 @@ namespace OpenSim.Region.Framework.Scenes
if (Scene != null)
{
- if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
- || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
+ // if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
+ // || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
+ // && !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
+ if ((Scene.TestBorderCross(val, Cardinals.E) || Scene.TestBorderCross(val, Cardinals.W)
+ || Scene.TestBorderCross(val, Cardinals.N) || Scene.TestBorderCross(val, Cardinals.S))
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{
IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface();
@@ -489,7 +492,7 @@ namespace OpenSim.Region.Framework.Scenes
canCross = false;
break;
}
-
+
m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
}
--
cgit v1.1
From a758abaa9fa7250d1b61bcd906ca12539307851d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 15 Feb 2012 17:08:33 +0000
Subject: try to make crossings work better. chode no longer prevents
crossings i hope
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 644b78a..77e67ba 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -461,8 +461,11 @@ namespace OpenSim.Region.Framework.Scenes
if (Scene != null)
{
- if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
- || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
+ // if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
+ // || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
+ // && !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
+ if ((Scene.TestBorderCross(val, Cardinals.E) || Scene.TestBorderCross(val, Cardinals.W)
+ || Scene.TestBorderCross(val, Cardinals.N) || Scene.TestBorderCross(val, Cardinals.S))
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{
IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface();
@@ -489,7 +492,7 @@ namespace OpenSim.Region.Framework.Scenes
canCross = false;
break;
}
-
+
m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
}
--
cgit v1.1
From b59275355e9dd8fbc126faf5bded8e61e84df4e8 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 15 Feb 2012 19:44:54 +0000
Subject: don't freeze with a sitted avatar in a border without other sim.
Still messy :(
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 77e67ba..53edcd6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -537,8 +537,15 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
}
+ else if (RootPart.PhysActor != null)
+ {
+ RootPart.PhysActor.CrossingFailure();
+ }
- val = AbsolutePosition;
+ Vector3 oldp = AbsolutePosition;
+ val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f);
+ val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
+ val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f);
}
}
--
cgit v1.1
From 3bffdddc9d0f0f62d7cf4bc6c271a865052ee119 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 15 Feb 2012 19:44:54 +0000
Subject: don't freeze with a sitted avatar in a border without other sim.
Still messy :(
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d964a6f..e7c6ee8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -537,8 +537,15 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
}
+ else if (RootPart.PhysActor != null)
+ {
+ RootPart.PhysActor.CrossingFailure();
+ }
- val = AbsolutePosition;
+ Vector3 oldp = AbsolutePosition;
+ val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f);
+ val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
+ val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f);
}
}
--
cgit v1.1
From 5351ff925c20c0fd189ee7de85c31521aca8cdf3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 18 Feb 2012 14:08:42 +0000
Subject: let SOG know about vehicles. Still needs serialization and
applyphyscis on deserialize, etc
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 98 ++++++++++++++++++++--
1 file changed, 91 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 53edcd6..1bac4d8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -43,6 +43,7 @@ using OpenSim.Region.Framework.Scenes.Serialization;
namespace OpenSim.Region.Framework.Scenes
{
+
[Flags]
public enum scriptEvents
{
@@ -114,6 +115,90 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_suspendUpdates;
private List m_linkedAvatars = new List();
+ private SOGVehicle m_vehicle = null;
+
+ public int VehicleType
+ {
+ get
+ {
+ if (m_vehicle == null)
+ return (int)Vehicle.TYPE_NONE;
+ else
+ return (int)m_vehicle.Type;
+ }
+ set
+ {
+ m_vehicle = null;
+ if (value == (int)Vehicle.TYPE_NONE)
+ {
+ if (RootPart.PhysActor != null)
+ RootPart.PhysActor.VehicleType = (int)Vehicle.TYPE_NONE;
+ return;
+ }
+ m_vehicle = new SOGVehicle();
+ m_vehicle.ProcessTypeChange((Vehicle)value);
+ {
+ if (RootPart.PhysActor != null)
+ RootPart.PhysActor.VehicleType = value;
+ return;
+ }
+
+ }
+ }
+
+ public void SetVehicleFlags(int param, bool remove)
+ {
+ if (m_vehicle == null)
+ return;
+
+ m_vehicle.ProcessVehicleFlags(param, remove);
+
+ if (RootPart.PhysActor != null)
+ {
+ RootPart.PhysActor.VehicleFlags(param, remove);
+ }
+ }
+
+ public void SetVehicleFloatParam(int param, float value)
+ {
+ if (m_vehicle == null)
+ return;
+
+ m_vehicle.ProcessFloatVehicleParam((Vehicle)param, value);
+
+ if (RootPart.PhysActor != null)
+ {
+ RootPart.PhysActor.VehicleFloatParam(param, value);
+ }
+ }
+
+ public void SetVehicleVectorParam(int param, Vector3 value)
+ {
+ if (m_vehicle == null)
+ return;
+
+ m_vehicle.ProcessVectorVehicleParam((Vehicle)param, value);
+
+ if (RootPart.PhysActor != null)
+ {
+ RootPart.PhysActor.VehicleVectorParam(param, value);
+ }
+ }
+
+ public void SetVehicleRotationParam(int param, Quaternion rotation)
+ {
+ if (m_vehicle == null)
+ return;
+
+ m_vehicle.ProcessRotationVehicleParam((Vehicle)param, rotation);
+
+ if (RootPart.PhysActor != null)
+ {
+ RootPart.PhysActor.VehicleRotationParam(param, rotation);
+ }
+ }
+
+
public bool areUpdatesSuspended
{
get
@@ -1678,10 +1763,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ApplyPhysics()
{
- // Apply physics to the root prim
- // m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
-
- // Apply physics to child prims
SceneObjectPart[] parts = m_parts.GetArray();
if (parts.Length > 1)
{
@@ -1689,18 +1770,21 @@ namespace OpenSim.Region.Framework.Scenes
// Apply physics to the root prim
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, true);
+
+
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (part.LocalId != m_rootPart.LocalId)
-// part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive);
part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, true);
-
}
// Hack to get the physics scene geometries in the right spot
// ResetChildPrimPhysicsPositions();
- if (m_rootPart.PhysActor != null)
+ if (m_rootPart.PhysActor != null)
+ {
m_rootPart.PhysActor.Building = false;
+
+ }
}
else
{
--
cgit v1.1
From 91a326331fedc702cc3f04a628841447b90d009a Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 18 Feb 2012 16:16:48 +0000
Subject: vehicle parameters do cross (i hope) on regions in same instance (
others need xml)
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1bac4d8..324fdb8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1782,14 +1782,19 @@ namespace OpenSim.Region.Framework.Scenes
// ResetChildPrimPhysicsPositions();
if (m_rootPart.PhysActor != null)
{
+ if (m_vehicle != null)
+ m_vehicle.SetVehicle(m_rootPart.PhysActor);
m_rootPart.PhysActor.Building = false;
-
}
}
else
{
// Apply physics to the root prim
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, false);
+ if (m_rootPart.PhysActor != null && m_vehicle != null)
+ {
+ m_vehicle.SetVehicle(m_rootPart.PhysActor);
+ }
}
}
--
cgit v1.1
From 3aee642190add7045f78e522ae7b2221b3566f1e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 18 Feb 2012 17:42:14 +0000
Subject: changed how vehicle data is stored and passed to physics. use unsafe
in serializer, tried to control m_dupeInProgress
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 324fdb8..1cce4c0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1965,6 +1965,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectGroup Copy(bool userExposed)
{
+ m_dupeInProgress = true;
SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
dupe.m_isBackedUp = false;
dupe.m_parts = new MapAndArray();
@@ -2048,6 +2049,7 @@ namespace OpenSim.Region.Framework.Scenes
ScheduleGroupForFullUpdate();
}
+ m_dupeInProgress = false;
return dupe;
}
--
cgit v1.1
From b77d354e6dcf1eb31486f0db3236780f63f23844 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 19 Feb 2012 13:21:01 +0000
Subject: moved vehicle from SOG to SOP
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 90 ----------------------
1 file changed, 90 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1cce4c0..3427199 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -115,90 +115,6 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_suspendUpdates;
private List m_linkedAvatars = new List();
- private SOGVehicle m_vehicle = null;
-
- public int VehicleType
- {
- get
- {
- if (m_vehicle == null)
- return (int)Vehicle.TYPE_NONE;
- else
- return (int)m_vehicle.Type;
- }
- set
- {
- m_vehicle = null;
- if (value == (int)Vehicle.TYPE_NONE)
- {
- if (RootPart.PhysActor != null)
- RootPart.PhysActor.VehicleType = (int)Vehicle.TYPE_NONE;
- return;
- }
- m_vehicle = new SOGVehicle();
- m_vehicle.ProcessTypeChange((Vehicle)value);
- {
- if (RootPart.PhysActor != null)
- RootPart.PhysActor.VehicleType = value;
- return;
- }
-
- }
- }
-
- public void SetVehicleFlags(int param, bool remove)
- {
- if (m_vehicle == null)
- return;
-
- m_vehicle.ProcessVehicleFlags(param, remove);
-
- if (RootPart.PhysActor != null)
- {
- RootPart.PhysActor.VehicleFlags(param, remove);
- }
- }
-
- public void SetVehicleFloatParam(int param, float value)
- {
- if (m_vehicle == null)
- return;
-
- m_vehicle.ProcessFloatVehicleParam((Vehicle)param, value);
-
- if (RootPart.PhysActor != null)
- {
- RootPart.PhysActor.VehicleFloatParam(param, value);
- }
- }
-
- public void SetVehicleVectorParam(int param, Vector3 value)
- {
- if (m_vehicle == null)
- return;
-
- m_vehicle.ProcessVectorVehicleParam((Vehicle)param, value);
-
- if (RootPart.PhysActor != null)
- {
- RootPart.PhysActor.VehicleVectorParam(param, value);
- }
- }
-
- public void SetVehicleRotationParam(int param, Quaternion rotation)
- {
- if (m_vehicle == null)
- return;
-
- m_vehicle.ProcessRotationVehicleParam((Vehicle)param, rotation);
-
- if (RootPart.PhysActor != null)
- {
- RootPart.PhysActor.VehicleRotationParam(param, rotation);
- }
- }
-
-
public bool areUpdatesSuspended
{
get
@@ -1782,8 +1698,6 @@ namespace OpenSim.Region.Framework.Scenes
// ResetChildPrimPhysicsPositions();
if (m_rootPart.PhysActor != null)
{
- if (m_vehicle != null)
- m_vehicle.SetVehicle(m_rootPart.PhysActor);
m_rootPart.PhysActor.Building = false;
}
}
@@ -1791,10 +1705,6 @@ namespace OpenSim.Region.Framework.Scenes
{
// Apply physics to the root prim
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, false);
- if (m_rootPart.PhysActor != null && m_vehicle != null)
- {
- m_vehicle.SetVehicle(m_rootPart.PhysActor);
- }
}
}
--
cgit v1.1
From 8f8206f47841cb0dd9db4e28377e32dd21f0dec0 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 20 Feb 2012 16:55:12 +0100
Subject: Add an override to make SOG.Velocity work as expected
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 2481dd2..cf8637f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -605,6 +605,12 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ public override Vector3 Velocity
+ {
+ get { return RootPart.Velocity; }
+ set { RootPart.Velocity = value; }
+ }
+
private void CrossAgentToNewRegionCompleted(IAsyncResult iar)
{
CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState;
--
cgit v1.1
From e74bf4600759c3fee6aa62ee808bbf214c019b6d Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 23 Feb 2012 23:18:01 +0100
Subject: Prevent a nullref when nonphysical motion objects cross sim
boundaries
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index cf8637f..248d4c6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -582,7 +582,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (ScenePresence av in m_linkedAvatars)
{
SceneObjectPart p = m_scene.GetSceneObjectPart(av.ParentID);
- if (m_parts.TryGetValue(p.UUID, out p))
+ if (p != null && m_parts.TryGetValue(p.UUID, out p))
{
Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
av.AbsolutePosition += offset;
--
cgit v1.1
From e07440d0c53fdc8e90f4887242e3b21049a729c0 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 25 Feb 2012 22:20:25 +0000
Subject: changed SOP Force and Torque, adding XML (de/)serialization, also
changed Buoyance. PLEASE trap deserialization from inventory etc, making
force and torque vector3.Zero, unless we want then to rez moving. (needs
checking/testing as usual)
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 23 +---------------------
1 file changed, 1 insertion(+), 22 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 248d4c6..e9021f1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2045,30 +2045,9 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- public void setAngularImpulse(Vector3 impulse)
- {
- if (RootPart.PhysActor != null)
- {
- if (!IsAttachment)
- {
- RootPart.PhysActor.Torque = impulse;
- m_scene.PhysicsScene.AddPhysicsActorTaint(RootPart.PhysActor);
- }
- }
- }
-
public Vector3 GetTorque()
{
- if (RootPart.PhysActor != null)
- {
- if (!IsAttachment)
- {
- Vector3 torque = RootPart.PhysActor.Torque;
- return torque;
- }
- }
-
- return Vector3.Zero;
+ return RootPart.Torque;
}
// This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object
--
cgit v1.1
From c82709c0d6c72852d8614651f9cb31df09fff883 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 26 Feb 2012 02:36:34 +0100
Subject: Implement llSetKeyframedMotion. No persistence, no region crossing.
Yet.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 ++++++++++++
1 file changed, 12 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 248d4c6..5ccea13 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -114,6 +114,12 @@ namespace OpenSim.Region.Framework.Scenes
private Random m_rand;
private bool m_suspendUpdates;
private List m_linkedAvatars = new List();
+ private KeyframeMotion m_keyframeMotion = null;
+
+ public KeyframeMotion KeyframeMotion
+ {
+ get; set;
+ }
public bool areUpdatesSuspended
{
@@ -1982,6 +1988,12 @@ namespace OpenSim.Region.Framework.Scenes
public void ScriptSetPhysicsStatus(bool usePhysics)
{
+ if (usePhysics)
+ {
+ if (KeyframeMotion != null)
+ KeyframeMotion.Stop();
+ KeyframeMotion = null;
+ }
UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
}
--
cgit v1.1
From aa552d0526349f0db6911dbd867c847cf4e810f6 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 26 Feb 2012 12:29:35 +0100
Subject: Serialize Keyframe motion for region crossings
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9898681..d488189 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1823,6 +1823,11 @@ namespace OpenSim.Region.Framework.Scenes
// Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(false);
+ if (KeyframeMotion != null)
+ {
+ backup_group.KeyframeMotion = KeyframeMotion.FromData(backup_group, KeyframeMotion.Serialize());
+ KeyframeMotion.UpdateSceneObject(this);
+ }
backup_group.RootPart.Velocity = RootPart.Velocity;
backup_group.RootPart.Acceleration = RootPart.Acceleration;
backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
--
cgit v1.1
From 8cdc115c91bd074539c5fbae719313d4dc616355 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 26 Feb 2012 14:30:24 +0100
Subject: Fix deserialization of Buoyancy, Force and Torque. Remove debug from
the new code.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d488189..ac2fe82 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -896,6 +896,10 @@ namespace OpenSim.Region.Framework.Scenes
ApplyPhysics();
if (RootPart.PhysActor != null)
+ RootPart.Force = RootPart.Force;
+ if (RootPart.PhysActor != null)
+ RootPart.Torque = RootPart.Torque;
+ if (RootPart.PhysActor != null)
RootPart.Buoyancy = RootPart.Buoyancy;
// Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
--
cgit v1.1
From ac1e30156a7ec8e461b3378149a082b3b5d57884 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 26 Feb 2012 15:09:00 +0100
Subject: Implement proper selection behavior
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ac2fe82..e509d4e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -726,6 +726,8 @@ namespace OpenSim.Region.Framework.Scenes
child.PhysActor.Selected = value;
}
}
+ if (KeyframeMotion != null)
+ KeyframeMotion.Selected = value;
}
}
--
cgit v1.1
From fca8c82232a42191270cb8d18dba6b54d382a2c2 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 26 Feb 2012 18:11:38 +0100
Subject: Move KeyframeMotion from SOG to SOP because we can't persist it any
other way because SOG doesn't technically exist in the DB
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 26 +++++++++-------------
1 file changed, 10 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e509d4e..fefae9d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -114,12 +114,6 @@ namespace OpenSim.Region.Framework.Scenes
private Random m_rand;
private bool m_suspendUpdates;
private List m_linkedAvatars = new List();
- private KeyframeMotion m_keyframeMotion = null;
-
- public KeyframeMotion KeyframeMotion
- {
- get; set;
- }
public bool areUpdatesSuspended
{
@@ -726,8 +720,8 @@ namespace OpenSim.Region.Framework.Scenes
child.PhysActor.Selected = value;
}
}
- if (KeyframeMotion != null)
- KeyframeMotion.Selected = value;
+ if (RootPart.KeyframeMotion != null)
+ RootPart.KeyframeMotion.Selected = value;
}
}
@@ -1829,11 +1823,6 @@ namespace OpenSim.Region.Framework.Scenes
// Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(false);
- if (KeyframeMotion != null)
- {
- backup_group.KeyframeMotion = KeyframeMotion.FromData(backup_group, KeyframeMotion.Serialize());
- KeyframeMotion.UpdateSceneObject(this);
- }
backup_group.RootPart.Velocity = RootPart.Velocity;
backup_group.RootPart.Acceleration = RootPart.Acceleration;
backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
@@ -1846,6 +1835,11 @@ namespace OpenSim.Region.Framework.Scenes
backup_group.ForEachPart(delegate(SceneObjectPart part)
{
+ if (part.KeyframeMotion != null)
+ {
+ part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
+ part.KeyframeMotion.UpdateSceneObject(this);
+ }
part.Inventory.ProcessInventoryBackup(datastore);
});
@@ -2001,9 +1995,9 @@ namespace OpenSim.Region.Framework.Scenes
{
if (usePhysics)
{
- if (KeyframeMotion != null)
- KeyframeMotion.Stop();
- KeyframeMotion = null;
+ if (RootPart.KeyframeMotion != null)
+ RootPart.KeyframeMotion.Stop();
+ RootPart.KeyframeMotion = null;
}
UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
}
--
cgit v1.1
From 6dc4a6dfb1af79ea116d1b5ca8dcd82307349c64 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 4 Mar 2012 00:06:07 +0100
Subject: Zero velocity when drag-copying
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index fefae9d..c9ea8e4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1989,6 +1989,8 @@ namespace OpenSim.Region.Framework.Scenes
public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{
SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed));
+ if (userExposed)
+ RootPart.Velocity = Vector3.Zero; // In case source is moving
}
public void ScriptSetPhysicsStatus(bool usePhysics)
--
cgit v1.1
From cca94aaefc36fad366e789d6d2e902dda078e3f7 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 6 Mar 2012 05:13:39 +0000
Subject: make copied parts have diferent LocalIds than original. More building
control for ubitODE. for all let physics know about linking of physical
parts. Assume UNTESTED
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 74 +++++++++++++++++++++-
1 file changed, 71 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c9ea8e4..b99f80d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -957,12 +957,21 @@ namespace OpenSim.Region.Framework.Scenes
///
public void GetAxisAlignedBoundingBoxRaw(out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ)
{
+ /* ????
maxX = -256f;
maxY = -256f;
maxZ = -256f;
minX = 256f;
minY = 256f;
minZ = 8192f;
+ */
+
+ maxX = float.MinValue;
+ maxY = float.MinValue;
+ maxZ = float.MinValue;
+ minX = float.MaxValue;
+ minY = float.MaxValue;
+ minZ = float.MaxValue;
SceneObjectPart[] parts = m_parts.GetArray();
foreach (SceneObjectPart part in parts)
@@ -1918,6 +1927,8 @@ namespace OpenSim.Region.Framework.Scenes
dupe.IsAttachment = previousAttachmentStatus;
}
+
+
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
@@ -1988,7 +1999,12 @@ namespace OpenSim.Region.Framework.Scenes
///
public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{
- SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed));
+ // SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed));
+ // give newpart a new local ID lettng old part keep same
+ SceneObjectPart newpart = part.Copy(part.LocalId, OwnerID, GroupID, 0, userExposed);
+ newpart.LocalId = m_scene.AllocateLocalId();
+
+ SetRootPart(newpart);
if (userExposed)
RootPart.Velocity = Vector3.Zero; // In case source is moving
}
@@ -2191,7 +2207,10 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{
- SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
+ // give new ID to the new part, letting old keep original
+ // SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
+ SceneObjectPart newPart = part.Copy(part.LocalId, OwnerID, GroupID, m_parts.Count, userExposed);
+ newPart.LocalId = m_scene.AllocateLocalId();
newPart.SetParent(this);
AddPart(newPart);
@@ -2485,6 +2504,11 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart linkPart = objectGroup.m_rootPart;
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = true;
+ if (linkPart.PhysActor != null)
+ linkPart.PhysActor.Building = true;
+
Vector3 oldGroupPosition = linkPart.GroupPosition;
Quaternion oldRootRotation = linkPart.RotationOffset;
@@ -2528,6 +2552,13 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.SetParent(this);
linkPart.CreateSelected = true;
+ // let physics know
+ if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
+ {
+ linkPart.PhysActor.link(m_rootPart.PhysActor);
+ this.Scene.PhysicsScene.AddPhysicsActorTaint(linkPart.PhysActor);
+ }
+
linkPart.LinkNum = linkNum++;
SceneObjectPart[] ogParts = objectGroup.Parts;
@@ -2540,7 +2571,15 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = ogParts[i];
if (part.UUID != objectGroup.m_rootPart.UUID)
+ {
LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
+ // let physics know
+ if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
+ {
+ part.PhysActor.link(m_rootPart.PhysActor);
+ this.Scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
+ }
+ }
part.ClearUndoState();
}
}
@@ -2560,6 +2599,9 @@ namespace OpenSim.Region.Framework.Scenes
// unmoved prims!
ResetChildPrimPhysicsPositions();
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = false;
+
//HasGroupChanged = true;
//ScheduleGroupForFullUpdate();
}
@@ -2612,7 +2654,10 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
-
+
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = true;
+
linkPart.ClearUndoState();
Quaternion worldRot = linkPart.GetWorldRotation();
@@ -2672,6 +2717,10 @@ namespace OpenSim.Region.Framework.Scenes
// When we delete a group, we currently have to force persist to the database if the object id has changed
// (since delete works by deleting all rows which have a given object id)
+
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = false;
+
objectGroup.HasGroupChangedDueToDelink = true;
return objectGroup;
@@ -3284,6 +3333,10 @@ namespace OpenSim.Region.Framework.Scenes
part.StoreUndoState(false);
part.IgnoreUndoUpdate = true;
+// unlock parts position change
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = true;
+
if (part.UUID == m_rootPart.UUID)
{
UpdateRootPosition(pos);
@@ -3293,6 +3346,9 @@ namespace OpenSim.Region.Framework.Scenes
part.UpdateOffSet(pos);
}
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = false;
+
HasGroupChanged = true;
part.IgnoreUndoUpdate = false;
}
@@ -3434,6 +3490,9 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Updating single rotation of {0} {1} to {2}", part.Name, part.LocalId, rot);
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = true;
+
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
@@ -3442,6 +3501,9 @@ namespace OpenSim.Region.Framework.Scenes
{
part.UpdateRotation(rot);
}
+
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = false;
}
}
@@ -3462,6 +3524,9 @@ namespace OpenSim.Region.Framework.Scenes
part.StoreUndoState();
part.IgnoreUndoUpdate = true;
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = true;
+
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
@@ -3482,6 +3547,9 @@ namespace OpenSim.Region.Framework.Scenes
part.OffsetPosition = pos;
}
+ if (m_rootPart.PhysActor != null)
+ m_rootPart.PhysActor.Building = false;
+
part.IgnoreUndoUpdate = false;
}
}
--
cgit v1.1
From de03d1ece0f4b4b9337ded53a71fcc68676c77d9 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 6 Mar 2012 09:56:19 +0100
Subject: Removed some whitespace errors - don't be naughty, don't use hard
tabs! Also removed commented code block.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 11 -----------
1 file changed, 11 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b99f80d..8809cd0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -957,15 +957,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public void GetAxisAlignedBoundingBoxRaw(out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ)
{
- /* ????
- maxX = -256f;
- maxY = -256f;
- maxZ = -256f;
- minX = 256f;
- minY = 256f;
- minZ = 8192f;
- */
-
maxX = float.MinValue;
maxY = float.MinValue;
maxZ = float.MinValue;
@@ -1927,8 +1918,6 @@ namespace OpenSim.Region.Framework.Scenes
dupe.IsAttachment = previousAttachmentStatus;
}
-
-
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
--
cgit v1.1
From 3d3b81e67698cc361a9eca28083f5f526ff1de2e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 7 Mar 2012 07:31:26 +0000
Subject: changes on undo/redo (untested/incomplete). Think we may consider
moving this mfrom SOP to client side. At least does seem to work a bit better
( again there wwas a issue on sop.copy )
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8809cd0..038eaa4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -549,11 +549,12 @@ namespace OpenSim.Region.Framework.Scenes
val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f);
}
}
-
+/* don't see the need but worse don't see where is restored to false if things stay in
foreach (SceneObjectPart part in m_parts.GetArray())
{
part.IgnoreUndoUpdate = true;
}
+ */
if (RootPart.GetStatusSandbox())
{
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
@@ -3519,7 +3520,7 @@ namespace OpenSim.Region.Framework.Scenes
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
- if (!m_rootPart.Undoing)
+/* if (!m_rootPart.Undoing)
{
m_rootPart.Undoing = true;
AbsolutePosition = pos;
@@ -3527,8 +3528,9 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
+ */
AbsolutePosition = pos;
- }
+// }
}
else
{
--
cgit v1.1
From 05cdf9bda910ced0da29474b8b40a58e8a423d69 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 9 Mar 2012 01:53:58 +0000
Subject: more changes in undo/redo. Basicly moved control to llclientview.cs.
later we can move back to a dispatcher function on SOG that handles the
several cases( in a viwer independent way (?)) and calls current exec
funtions. made cosmetic changes replacing decimals by hexs so bits are easier
to read. Changed behavour of case 12 and 28 ( 0x0c and 0x1c) to make
identical to 0x0d and 0x1d ( scale only and scale plus position). DOn't see
12 and 28 in use... cases 1c and 1d still broken
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 62 +++++++++++-----------
1 file changed, 31 insertions(+), 31 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 038eaa4..2d71372 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1569,7 +1569,7 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE OBJECT GROUP]: Processing OnGrabPart for {0} on {1} {2}, offsetPos {3}",
// remoteClient.Name, part.Name, part.LocalId, offsetPos);
- part.StoreUndoState();
+// part.StoreUndoState();
part.OnGrab(offsetPos, remoteClient);
}
@@ -3119,7 +3119,7 @@ namespace OpenSim.Region.Framework.Scenes
{
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
- RootPart.StoreUndoState(true);
+// RootPart.StoreUndoState(true);
scale.X = Math.Min(scale.X, Scene.m_maxNonphys);
scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys);
@@ -3230,7 +3230,7 @@ namespace OpenSim.Region.Framework.Scenes
if (obPart.UUID != m_rootPart.UUID)
{
- obPart.IgnoreUndoUpdate = true;
+// obPart.IgnoreUndoUpdate = true;
Vector3 currentpos = new Vector3(obPart.OffsetPosition);
currentpos.X *= x;
@@ -3245,7 +3245,7 @@ namespace OpenSim.Region.Framework.Scenes
obPart.Resize(newSize);
obPart.UpdateOffSet(currentpos);
- obPart.IgnoreUndoUpdate = false;
+// obPart.IgnoreUndoUpdate = false;
}
// obPart.IgnoreUndoUpdate = false;
@@ -3270,7 +3270,7 @@ namespace OpenSim.Region.Framework.Scenes
{
// m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos);
- RootPart.StoreUndoState(true);
+// RootPart.StoreUndoState(true);
// SceneObjectPart[] parts = m_parts.GetArray();
// for (int i = 0; i < parts.Length; i++)
@@ -3311,17 +3311,17 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = GetChildPart(localID);
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].StoreUndoState();
+// SceneObjectPart[] parts = m_parts.GetArray();
+// for (int i = 0; i < parts.Length; i++)
+// parts[i].StoreUndoState();
if (part != null)
{
// m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos);
- part.StoreUndoState(false);
- part.IgnoreUndoUpdate = true;
+// part.StoreUndoState(false);
+// part.IgnoreUndoUpdate = true;
// unlock parts position change
if (m_rootPart.PhysActor != null)
@@ -3340,7 +3340,7 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.PhysActor.Building = false;
HasGroupChanged = true;
- part.IgnoreUndoUpdate = false;
+// part.IgnoreUndoUpdate = false;
}
}
@@ -3377,16 +3377,16 @@ namespace OpenSim.Region.Framework.Scenes
}
//We have to set undoing here because otherwise an undo state will be saved
- if (!m_rootPart.Undoing)
- {
- m_rootPart.Undoing = true;
- AbsolutePosition = newPos;
- m_rootPart.Undoing = false;
- }
- else
- {
+// if (!m_rootPart.Undoing)
+// {
+// m_rootPart.Undoing = true;
AbsolutePosition = newPos;
- }
+// m_rootPart.Undoing = false;
+// }
+// else
+// {
+// AbsolutePosition = newPos;
+// }
HasGroupChanged = true;
if (m_rootPart.Undoing)
@@ -3416,9 +3416,9 @@ namespace OpenSim.Region.Framework.Scenes
// for (int i = 0; i < parts.Length; i++)
// parts[i].StoreUndoState();
- m_rootPart.StoreUndoState(true);
+// m_rootPart.StoreUndoState(true);
- m_rootPart.UpdateRotation(rot);
+// m_rootPart.UpdateRotation(rot);
PhysicsActor actor = m_rootPart.PhysActor;
if (actor != null)
@@ -3445,8 +3445,8 @@ namespace OpenSim.Region.Framework.Scenes
// for (int i = 0; i < parts.Length; i++)
// parts[i].StoreUndoState();
- RootPart.StoreUndoState(true);
- RootPart.IgnoreUndoUpdate = true;
+// RootPart.StoreUndoState(true);
+// RootPart.IgnoreUndoUpdate = true;
m_rootPart.UpdateRotation(rot);
@@ -3462,7 +3462,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
ScheduleGroupForTerseUpdate();
- RootPart.IgnoreUndoUpdate = false;
+// RootPart.IgnoreUndoUpdate = false;
}
///
@@ -3511,8 +3511,8 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}",
// part.Name, part.LocalId, rot);
- part.StoreUndoState();
- part.IgnoreUndoUpdate = true;
+// part.StoreUndoState();
+// part.IgnoreUndoUpdate = true;
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = true;
@@ -3541,7 +3541,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = false;
- part.IgnoreUndoUpdate = false;
+// part.IgnoreUndoUpdate = false;
}
}
@@ -3557,7 +3557,7 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion axRot = rot;
Quaternion oldParentRot = m_rootPart.RotationOffset;
- m_rootPart.StoreUndoState();
+// m_rootPart.StoreUndoState();
//Don't use UpdateRotation because it schedules an update prematurely
m_rootPart.RotationOffset = rot;
@@ -3573,7 +3573,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart prim = parts[i];
if (prim.UUID != m_rootPart.UUID)
{
- prim.IgnoreUndoUpdate = true;
+// prim.IgnoreUndoUpdate = true;
Quaternion NewRot = oldParentRot * prim.RotationOffset;
NewRot = Quaternion.Inverse(axRot) * NewRot;
@@ -3585,7 +3585,7 @@ namespace OpenSim.Region.Framework.Scenes
axPos *= Quaternion.Inverse(axRot);
prim.OffsetPosition = axPos;
- prim.IgnoreUndoUpdate = false;
+// prim.IgnoreUndoUpdate = false;
}
}
--
cgit v1.1
From e83a2181d06717afe3e5a02d8c918effbe80f226 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 9 Mar 2012 17:19:10 +0000
Subject: on linking update linked parts physical flags acording to new parent
ones ( untested )
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 2d71372..5818798 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2499,6 +2499,11 @@ namespace OpenSim.Region.Framework.Scenes
if (linkPart.PhysActor != null)
linkPart.PhysActor.Building = true;
+ // physics flags from group to be applied to linked parts
+ bool grpusephys = UsesPhysics;
+ bool grptemporary = IsTemporary;
+ bool gprphantom = IsPhantom;
+
Vector3 oldGroupPosition = linkPart.GroupPosition;
Quaternion oldRootRotation = linkPart.RotationOffset;
@@ -2542,7 +2547,8 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.SetParent(this);
linkPart.CreateSelected = true;
- // let physics know
+ // let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
+ linkPart.UpdatePrimFlags(grpusephys, grptemporary, gprphantom, linkPart.VolumeDetectActive, true);
if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
{
linkPart.PhysActor.link(m_rootPart.PhysActor);
@@ -2564,6 +2570,7 @@ namespace OpenSim.Region.Framework.Scenes
{
LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
// let physics know
+ part.UpdatePrimFlags(grpusephys, grptemporary, gprphantom, part.VolumeDetectActive, true);
if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
{
part.PhysActor.link(m_rootPart.PhysActor);
--
cgit v1.1
From 908abb1c3dded307e769abac71f660b835875975 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 10 Mar 2012 20:32:19 +0000
Subject: BIG MESS. changed Iclient interface so only one event is used to
inform scene about position scale or rotation change by client (others can be
added). Its served at SceneGraph that does permition checks, undostore and
sends down to SOG. changed values are stored in a class (ObjectChangeData)
and what is changed as a enum (ObjectChangeWhat) with bit fields and 'macros'
of this for better readability (at top of scenegraph.cs lasy to find better
place for now) this can be extended for other things clients changes and need
undo/redo. SOG process acording to what is changed. Changed UNDO/redo to use
this also (warning is only storing what is changed, previus stored all, this
must be checked for side efects. to save all PRS change commented line in
scenegraph). Still have excessive calls to ScheduleGroupForTerseUpdate. ****
UNTESTED ****
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 204 +++++++++------------
1 file changed, 83 insertions(+), 121 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5818798..92f2d54 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3124,10 +3124,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public void GroupResize(Vector3 scale)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
-// RootPart.StoreUndoState(true);
-
scale.X = Math.Min(scale.X, Scene.m_maxNonphys);
scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys);
scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys);
@@ -3152,7 +3148,6 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart obPart = parts[i];
if (obPart.UUID != m_rootPart.UUID)
{
-// obPart.IgnoreUndoUpdate = true;
Vector3 oldSize = new Vector3(obPart.Scale);
float f = 1.0f;
@@ -3216,8 +3211,6 @@ namespace OpenSim.Region.Framework.Scenes
z *= a;
}
}
-
-// obPart.IgnoreUndoUpdate = false;
}
}
}
@@ -3226,9 +3219,8 @@ namespace OpenSim.Region.Framework.Scenes
prevScale.X *= x;
prevScale.Y *= y;
prevScale.Z *= z;
-// RootPart.IgnoreUndoUpdate = true;
+
RootPart.Resize(prevScale);
-// RootPart.IgnoreUndoUpdate = false;
parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
@@ -3237,8 +3229,6 @@ namespace OpenSim.Region.Framework.Scenes
if (obPart.UUID != m_rootPart.UUID)
{
-// obPart.IgnoreUndoUpdate = true;
-
Vector3 currentpos = new Vector3(obPart.OffsetPosition);
currentpos.X *= x;
currentpos.Y *= y;
@@ -3251,18 +3241,12 @@ namespace OpenSim.Region.Framework.Scenes
obPart.Resize(newSize);
obPart.UpdateOffSet(currentpos);
-
-// obPart.IgnoreUndoUpdate = false;
}
-// obPart.IgnoreUndoUpdate = false;
HasGroupChanged = true;
m_rootPart.TriggerScriptChangedEvent(Changed.SCALE);
ScheduleGroupForTerseUpdate();
}
-
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Finished group resizing {0} {1} to {2}", Name, LocalId, RootPart.Scale);
}
#endregion
@@ -3275,14 +3259,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupPosition(Vector3 pos)
{
-// m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos);
-
-// RootPart.StoreUndoState(true);
-
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
-
if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
{
if (IsAttachment)
@@ -3314,22 +3290,14 @@ namespace OpenSim.Region.Framework.Scenes
///
///
///
+ ///
+
public void UpdateSinglePosition(Vector3 pos, uint localID)
{
SceneObjectPart part = GetChildPart(localID);
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
-
if (part != null)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos);
-
-// part.StoreUndoState(false);
-// part.IgnoreUndoUpdate = true;
-
// unlock parts position change
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = true;
@@ -3347,7 +3315,6 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.PhysActor.Building = false;
HasGroupChanged = true;
-// part.IgnoreUndoUpdate = false;
}
}
@@ -3357,13 +3324,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateRootPosition(Vector3 pos)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating root position of {0} {1} to {2}", Name, LocalId, pos);
-
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
-
+ // needs to be called with phys building true
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
Vector3 oldPos =
new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X,
@@ -3383,17 +3344,7 @@ namespace OpenSim.Region.Framework.Scenes
obPart.OffsetPosition = obPart.OffsetPosition + diff;
}
- //We have to set undoing here because otherwise an undo state will be saved
-// if (!m_rootPart.Undoing)
-// {
-// m_rootPart.Undoing = true;
- AbsolutePosition = newPos;
-// m_rootPart.Undoing = false;
-// }
-// else
-// {
-// AbsolutePosition = newPos;
-// }
+ AbsolutePosition = newPos;
HasGroupChanged = true;
if (m_rootPart.Undoing)
@@ -3416,17 +3367,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupRotationR(Quaternion rot)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating group rotation R of {0} {1} to {2}", Name, LocalId, rot);
-
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
-
-// m_rootPart.StoreUndoState(true);
-
-// m_rootPart.UpdateRotation(rot);
-
PhysicsActor actor = m_rootPart.PhysActor;
if (actor != null)
{
@@ -3445,16 +3385,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating group rotation PR of {0} {1} to {2}", Name, LocalId, rot);
-
-// SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].StoreUndoState();
-
-// RootPart.StoreUndoState(true);
-// RootPart.IgnoreUndoUpdate = true;
-
m_rootPart.UpdateRotation(rot);
PhysicsActor actor = m_rootPart.PhysActor;
@@ -3468,8 +3398,6 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = true;
ScheduleGroupForTerseUpdate();
-
-// RootPart.IgnoreUndoUpdate = false;
}
///
@@ -3484,9 +3412,6 @@ namespace OpenSim.Region.Framework.Scenes
if (part != null)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating single rotation of {0} {1} to {2}", part.Name, part.LocalId, rot);
-
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = true;
@@ -3514,30 +3439,13 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = GetChildPart(localID);
if (part != null)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}",
-// part.Name, part.LocalId, rot);
-
-// part.StoreUndoState();
-// part.IgnoreUndoUpdate = true;
-
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = true;
if (part.UUID == m_rootPart.UUID)
{
UpdateRootRotation(rot);
-/* if (!m_rootPart.Undoing)
- {
- m_rootPart.Undoing = true;
- AbsolutePosition = pos;
- m_rootPart.Undoing = false;
- }
- else
- {
- */
- AbsolutePosition = pos;
-// }
+ AbsolutePosition = pos;
}
else
{
@@ -3547,8 +3455,6 @@ namespace OpenSim.Region.Framework.Scenes
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = false;
-
-// part.IgnoreUndoUpdate = false;
}
}
@@ -3558,13 +3464,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateRootRotation(Quaternion rot)
{
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}",
-// Name, LocalId, rot);
-
+ // needs to be called with phys building true
Quaternion axRot = rot;
Quaternion oldParentRot = m_rootPart.RotationOffset;
-// m_rootPart.StoreUndoState();
//Don't use UpdateRotation because it schedules an update prematurely
m_rootPart.RotationOffset = rot;
@@ -3580,8 +3482,6 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart prim = parts[i];
if (prim.UUID != m_rootPart.UUID)
{
-// prim.IgnoreUndoUpdate = true;
-
Quaternion NewRot = oldParentRot * prim.RotationOffset;
NewRot = Quaternion.Inverse(axRot) * NewRot;
prim.RotationOffset = NewRot;
@@ -3591,26 +3491,88 @@ namespace OpenSim.Region.Framework.Scenes
axPos *= oldParentRot;
axPos *= Quaternion.Inverse(axRot);
prim.OffsetPosition = axPos;
-
-// prim.IgnoreUndoUpdate = false;
}
}
-// for (int i = 0; i < parts.Length; i++)
-// {
-// SceneObjectPart childpart = parts[i];
-// if (childpart != m_rootPart)
-// {
-//// childpart.IgnoreUndoUpdate = false;
-//// childpart.StoreUndoState();
-// }
-// }
HasGroupChanged = true;
ScheduleGroupForFullUpdate();
+ }
-// m_log.DebugFormat(
-// "[SCENE OBJECT GROUP]: Updated root rotation of {0} {1} to {2}",
-// Name, LocalId, rot);
+ public void doChangeObject(SceneObjectPart part, ObjectChangeData data)
+ {
+ // TODO this still as excessive ScheduleGroupForTerseUpdate()s
+
+ if (part != null && part.ParentGroup != null)
+ {
+ ObjectChangeWhat what = data.what;
+ bool togroup = ((what & ObjectChangeWhat.Group) != 0);
+ // bool uniform = ((what & ObjectChangeWhat.UniformScale) != 0); not in use
+
+ SceneObjectGroup group = part.ParentGroup;
+ PhysicsActor pha = group.RootPart.PhysActor;
+
+ bool needgrpUpdate = false;
+
+ if (togroup)
+ {
+ // related to group
+ if ((what & ObjectChangeWhat.Position) != 0)
+ {
+ group.AbsolutePosition = data.position;
+ needgrpUpdate = true;
+ }
+ if ((what & ObjectChangeWhat.Rotation) != 0)
+ group.RootPart.UpdateRotation(data.rotation);
+ if ((what & ObjectChangeWhat.Scale) != 0)
+ {
+ if (pha != null)
+ pha.Building = true;
+ group.GroupResize(data.scale);
+ if (pha != null)
+ pha.Building = false;
+ }
+ }
+ else
+ {
+ // related to single prim in a link-set ( ie group)
+ if (pha != null)
+ pha.Building = true;
+
+ // must deal with root part specially for position and rotation
+ // so parts offset positions or rotations are fixed
+
+ if (part == group.RootPart)
+ {
+ if ((what & ObjectChangeWhat.Position) != 0)
+ group.UpdateRootPosition(data.position);
+ if ((what & ObjectChangeWhat.Rotation) != 0)
+ group.UpdateRootRotation(data.rotation);
+ }
+ else
+ {
+
+ if ((what & ObjectChangeWhat.Position) != 0)
+ {
+ part.OffsetPosition = data.position;
+ needgrpUpdate = true;
+ }
+ if ((what & ObjectChangeWhat.Rotation) != 0)
+ part.UpdateRotation(data.rotation);
+ }
+
+ if ((what & ObjectChangeWhat.Scale) != 0)
+ part.Resize(data.scale);
+
+ if (pha != null)
+ pha.Building = false;
+ }
+
+ if (needgrpUpdate)
+ {
+ HasGroupChanged = true;
+ ScheduleGroupForTerseUpdate();
+ }
+ }
}
#endregion
--
cgit v1.1
From dba0d79833632227a806e1a46047607a0f653b58 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 11 Mar 2012 02:55:39 +0000
Subject: minor changes on updates control on doChangeObject(..)
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 58 ++++++++++++++++++----
1 file changed, 48 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 92f2d54..92fd1fa 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3498,6 +3498,15 @@ namespace OpenSim.Region.Framework.Scenes
ScheduleGroupForFullUpdate();
}
+ private enum updatetype :int
+ {
+ none = 0,
+ partterse = 1,
+ partfull = 2,
+ groupterse = 3,
+ groupfull = 4
+ }
+
public void doChangeObject(SceneObjectPart part, ObjectChangeData data)
{
// TODO this still as excessive ScheduleGroupForTerseUpdate()s
@@ -3511,7 +3520,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup group = part.ParentGroup;
PhysicsActor pha = group.RootPart.PhysActor;
- bool needgrpUpdate = false;
+ updatetype updateType = updatetype.none;
if (togroup)
{
@@ -3519,15 +3528,21 @@ namespace OpenSim.Region.Framework.Scenes
if ((what & ObjectChangeWhat.Position) != 0)
{
group.AbsolutePosition = data.position;
- needgrpUpdate = true;
+ updateType = updatetype.groupterse;
}
if ((what & ObjectChangeWhat.Rotation) != 0)
+ {
group.RootPart.UpdateRotation(data.rotation);
+ updateType = updatetype.none;
+ }
if ((what & ObjectChangeWhat.Scale) != 0)
{
if (pha != null)
pha.Building = true;
+
group.GroupResize(data.scale);
+ updateType = updatetype.none;
+
if (pha != null)
pha.Building = false;
}
@@ -3547,30 +3562,53 @@ namespace OpenSim.Region.Framework.Scenes
group.UpdateRootPosition(data.position);
if ((what & ObjectChangeWhat.Rotation) != 0)
group.UpdateRootRotation(data.rotation);
+ if ((what & ObjectChangeWhat.Scale) != 0)
+ part.Resize(data.scale);
}
else
{
-
if ((what & ObjectChangeWhat.Position) != 0)
{
part.OffsetPosition = data.position;
- needgrpUpdate = true;
+ updateType = updatetype.partterse;
}
if ((what & ObjectChangeWhat.Rotation) != 0)
+ {
part.UpdateRotation(data.rotation);
+ updateType = updatetype.none;
+ }
+ if ((what & ObjectChangeWhat.Scale) != 0)
+ {
+ part.Resize(data.scale);
+ updateType = updatetype.none;
+ }
}
- if ((what & ObjectChangeWhat.Scale) != 0)
- part.Resize(data.scale);
-
if (pha != null)
pha.Building = false;
}
- if (needgrpUpdate)
+ if (updateType != updatetype.none)
{
- HasGroupChanged = true;
- ScheduleGroupForTerseUpdate();
+ group.HasGroupChanged = true;
+
+ switch (updateType)
+ {
+ case updatetype.partterse:
+ part.ScheduleTerseUpdate();
+ break;
+ case updatetype.partfull:
+ part.ScheduleFullUpdate();
+ break;
+ case updatetype.groupterse:
+ group.ScheduleGroupForTerseUpdate();
+ break;
+ case updatetype.groupfull:
+ group.ScheduleGroupForFullUpdate();
+ break;
+ default:
+ break;
+ }
}
}
}
--
cgit v1.1
From 80160c128de25e6f0013640f57e3bea0a89aeb7a Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 11 Mar 2012 02:58:56 +0000
Subject: coments change..
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 92fd1fa..bb554e1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3509,7 +3509,7 @@ namespace OpenSim.Region.Framework.Scenes
public void doChangeObject(SceneObjectPart part, ObjectChangeData data)
{
- // TODO this still as excessive ScheduleGroupForTerseUpdate()s
+ // TODO this still as excessive *.Schedule*Update()s
if (part != null && part.ParentGroup != null)
{
@@ -3553,8 +3553,8 @@ namespace OpenSim.Region.Framework.Scenes
if (pha != null)
pha.Building = true;
- // must deal with root part specially for position and rotation
- // so parts offset positions or rotations are fixed
+ // root part is special
+ // parts offset positions or rotations need to change also
if (part == group.RootPart)
{
--
cgit v1.1
From dab7e0358499702754fbc1aaa932767c77153453 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 11 Mar 2012 08:43:53 +0000
Subject: bug fix (??) in sog copy()
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 29 ++++++++++++++--------
1 file changed, 19 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index bb554e1..2654563 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1940,37 +1940,46 @@ namespace OpenSim.Region.Framework.Scenes
{
newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
newPart.LinkNum = part.LinkNum;
- }
+ if (userExposed)
+ newPart.ParentID = dupe.m_rootPart.LocalId;
+ }
else
{
newPart = dupe.m_rootPart;
}
+/*
+ bool isphys = ((newPart.Flags & PrimFlags.Physics) != 0);
+ bool isphan = ((newPart.Flags & PrimFlags.Phantom) != 0);
// Need to duplicate the physics actor as well
- if (part.PhysActor != null && userExposed)
+ if (userExposed && (isphys || !isphan || newPart.VolumeDetectActive))
{
PrimitiveBaseShape pbs = newPart.Shape;
-
newPart.PhysActor
= m_scene.PhysicsScene.AddPrimShape(
string.Format("{0}/{1}", newPart.Name, newPart.UUID),
pbs,
newPart.AbsolutePosition,
newPart.Scale,
- //newPart.RotationOffset,
newPart.GetWorldRotation(),
- part.PhysActor.IsPhysical,
+ isphys,
+ isphan,
newPart.LocalId);
- newPart.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
- }
+ newPart.DoPhysicsPropertyUpdate(isphys, true);
+ */
+ if (userExposed)
+ newPart.ApplyPhysics((uint)newPart.Flags,newPart.VolumeDetectActive,true);
+// }
}
- if (dupe.m_rootPart.PhysActor != null && userExposed)
- dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building
if (userExposed)
{
- dupe.UpdateParentIDs();
+// done above dupe.UpdateParentIDs();
+
+ if (dupe.m_rootPart.PhysActor != null)
+ dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building
+
dupe.HasGroupChanged = true;
dupe.AttachToBackup();
--
cgit v1.1
From edc8a15487554cf28a1843e3cbff343a782b1a94 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 12 Mar 2012 14:06:39 +0100
Subject: Restore duplication of the SL bug where linking phantom to solid lets
the child prim remain phantom
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 2654563..e5cfed0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2511,7 +2511,6 @@ namespace OpenSim.Region.Framework.Scenes
// physics flags from group to be applied to linked parts
bool grpusephys = UsesPhysics;
bool grptemporary = IsTemporary;
- bool gprphantom = IsPhantom;
Vector3 oldGroupPosition = linkPart.GroupPosition;
Quaternion oldRootRotation = linkPart.RotationOffset;
@@ -2557,7 +2556,7 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.CreateSelected = true;
// let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
- linkPart.UpdatePrimFlags(grpusephys, grptemporary, gprphantom, linkPart.VolumeDetectActive, true);
+ linkPart.UpdatePrimFlags(grpusephys, grptemporary, (linkPart.Flags & PrimFlags.Phantom) != null, linkPart.VolumeDetectActive, true);
if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
{
linkPart.PhysActor.link(m_rootPart.PhysActor);
@@ -2579,7 +2578,7 @@ namespace OpenSim.Region.Framework.Scenes
{
LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
// let physics know
- part.UpdatePrimFlags(grpusephys, grptemporary, gprphantom, part.VolumeDetectActive, true);
+ part.UpdatePrimFlags(grpusephys, grptemporary, (part.Flags & PrimFlags.Phantom) != null, part.VolumeDetectActive, true);
if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
{
part.PhysActor.link(m_rootPart.PhysActor);
--
cgit v1.1
From ebcd4910a21726c830796cfe14c0792007b766b7 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 13 Mar 2012 13:08:32 +0100
Subject: Refactor, move OjectChangeData into it's own file and rename
ObjectChnageWhat what into ObjectChangeType change. What is no name for a
variable or type!
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e5cfed0..b2502e0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3521,9 +3521,9 @@ namespace OpenSim.Region.Framework.Scenes
if (part != null && part.ParentGroup != null)
{
- ObjectChangeWhat what = data.what;
- bool togroup = ((what & ObjectChangeWhat.Group) != 0);
- // bool uniform = ((what & ObjectChangeWhat.UniformScale) != 0); not in use
+ ObjectChangeType change = data.change;
+ bool togroup = ((change & ObjectChangeType.Group) != 0);
+ // bool uniform = ((what & ObjectChangeType.UniformScale) != 0); not in use
SceneObjectGroup group = part.ParentGroup;
PhysicsActor pha = group.RootPart.PhysActor;
@@ -3533,17 +3533,17 @@ namespace OpenSim.Region.Framework.Scenes
if (togroup)
{
// related to group
- if ((what & ObjectChangeWhat.Position) != 0)
+ if ((change & ObjectChangeType.Position) != 0)
{
group.AbsolutePosition = data.position;
updateType = updatetype.groupterse;
}
- if ((what & ObjectChangeWhat.Rotation) != 0)
+ if ((change & ObjectChangeType.Rotation) != 0)
{
group.RootPart.UpdateRotation(data.rotation);
updateType = updatetype.none;
}
- if ((what & ObjectChangeWhat.Scale) != 0)
+ if ((change & ObjectChangeType.Scale) != 0)
{
if (pha != null)
pha.Building = true;
@@ -3566,26 +3566,26 @@ namespace OpenSim.Region.Framework.Scenes
if (part == group.RootPart)
{
- if ((what & ObjectChangeWhat.Position) != 0)
+ if ((change & ObjectChangeType.Position) != 0)
group.UpdateRootPosition(data.position);
- if ((what & ObjectChangeWhat.Rotation) != 0)
+ if ((change & ObjectChangeType.Rotation) != 0)
group.UpdateRootRotation(data.rotation);
- if ((what & ObjectChangeWhat.Scale) != 0)
+ if ((change & ObjectChangeType.Scale) != 0)
part.Resize(data.scale);
}
else
{
- if ((what & ObjectChangeWhat.Position) != 0)
+ if ((change & ObjectChangeType.Position) != 0)
{
part.OffsetPosition = data.position;
updateType = updatetype.partterse;
}
- if ((what & ObjectChangeWhat.Rotation) != 0)
+ if ((change & ObjectChangeType.Rotation) != 0)
{
part.UpdateRotation(data.rotation);
updateType = updatetype.none;
}
- if ((what & ObjectChangeWhat.Scale) != 0)
+ if ((change & ObjectChangeType.Scale) != 0)
{
part.Resize(data.scale);
updateType = updatetype.none;
--
cgit v1.1
From 22e0cc09ac4bc4ed639d1203d930309f687fdb6f Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 13 Mar 2012 13:12:14 +0100
Subject: Ensure child prims of a phantom prim are marked as phantom
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b2502e0..314705e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2556,7 +2556,7 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.CreateSelected = true;
// let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
- linkPart.UpdatePrimFlags(grpusephys, grptemporary, (linkPart.Flags & PrimFlags.Phantom) != null, linkPart.VolumeDetectActive, true);
+ linkPart.UpdatePrimFlags(grpusephys, grptemporary, IsPhantom || ((linkPart.Flags & PrimFlags.Phantom) != null), linkPart.VolumeDetectActive, true);
if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
{
linkPart.PhysActor.link(m_rootPart.PhysActor);
@@ -2578,7 +2578,7 @@ namespace OpenSim.Region.Framework.Scenes
{
LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
// let physics know
- part.UpdatePrimFlags(grpusephys, grptemporary, (part.Flags & PrimFlags.Phantom) != null, part.VolumeDetectActive, true);
+ part.UpdatePrimFlags(grpusephys, grptemporary, IsPhantom || ((part.Flags & PrimFlags.Phantom) != null), part.VolumeDetectActive, true);
if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
{
part.PhysActor.link(m_rootPart.PhysActor);
--
cgit v1.1
From bf2a5508debe058cbf48fc1da52d2a6d96954f80 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 13 Mar 2012 19:17:32 +0000
Subject: bug fix
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 314705e..6feb333 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2556,7 +2556,7 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.CreateSelected = true;
// let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
- linkPart.UpdatePrimFlags(grpusephys, grptemporary, IsPhantom || ((linkPart.Flags & PrimFlags.Phantom) != null), linkPart.VolumeDetectActive, true);
+ linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive, true);
if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
{
linkPart.PhysActor.link(m_rootPart.PhysActor);
@@ -2578,7 +2578,7 @@ namespace OpenSim.Region.Framework.Scenes
{
LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
// let physics know
- part.UpdatePrimFlags(grpusephys, grptemporary, IsPhantom || ((part.Flags & PrimFlags.Phantom) != null), part.VolumeDetectActive, true);
+ part.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (part.Flags & PrimFlags.Phantom) != 0), part.VolumeDetectActive, true);
if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
{
part.PhysActor.link(m_rootPart.PhysActor);
--
cgit v1.1
From cf9ebd301c32fa7cd991e78647ce011b0aefc796 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 14 Mar 2012 18:24:04 +0000
Subject: bug fixs, added a default physics shape estimator based on being a
mesh or not and use it on unlink if new root part as type none. Viewer
doesn't get updated even with fullupdates we are missing something still
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6feb333..5507aa0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2723,6 +2723,10 @@ namespace OpenSim.Region.Framework.Scenes
// When we delete a group, we currently have to force persist to the database if the object id has changed
// (since delete works by deleting all rows which have a given object id)
+ // this is as it seems to be in sl now
+ if(linkPart.PhysicsShapeType == (byte)PhysShapeType.none)
+ linkPart.PhysicsShapeType = linkPart.DefaultPhysicsShapeType(); // root prims can't have type none for now
+
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = false;
--
cgit v1.1
From ae8e089b9c73a6a675038759e3e3f9491819eb72 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 16 Mar 2012 15:33:49 +0000
Subject: some more work on costs
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 96 ++++++++++++++++++++++
1 file changed, 96 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5507aa0..3e4d552 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1231,6 +1231,102 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
+ public void GetResourcesCosts(SceneObjectPart apart,
+ out float linksetResCost, out float linksetPhysCost, out float partCost, out float partPhysCost)
+ {
+ // this information may need to be cached
+
+ float cost;
+ float tmpcost;
+
+ bool ComplexCost = false;
+
+ SceneObjectPart p;
+ SceneObjectPart[] parts;
+
+ lock (m_parts)
+ {
+ parts = m_parts.GetArray();
+ }
+
+ int nparts = parts.Length;
+
+
+ for (int i = 0; i < nparts; i++)
+ {
+ p = parts[i];
+
+ if (p.UsesComplexCost)
+ {
+ ComplexCost = true;
+ break;
+ }
+ }
+
+ if (ComplexCost)
+ {
+ linksetResCost = 0;
+ linksetPhysCost = 0;
+ partCost = 0;
+ partPhysCost = 0;
+
+ for (int i = 0; i < nparts; i++)
+ {
+ p = parts[i];
+
+ cost = p.StreamingCost;
+ tmpcost = p.SimulationCost;
+ if (tmpcost > cost)
+ cost = tmpcost;
+ tmpcost = p.PhysicsCost;
+ if (tmpcost > cost)
+ cost = tmpcost;
+
+ linksetPhysCost += tmpcost;
+ linksetResCost += cost;
+
+ if (p == apart)
+ {
+ partCost = cost;
+ partPhysCost = tmpcost;
+ }
+ }
+ }
+ else
+ {
+ partPhysCost = 1.0f;
+ partCost = 1.0f;
+ linksetResCost = (float)nparts;
+ linksetPhysCost = linksetResCost;
+ }
+ }
+
+ public void GetSelectedCosts(out float PhysCost, out float StreamCost, out float SimulCost)
+ {
+ SceneObjectPart p;
+ SceneObjectPart[] parts;
+
+ lock (m_parts)
+ {
+ parts = m_parts.GetArray();
+ }
+
+ int nparts = parts.Length;
+
+ PhysCost = 0;
+ StreamCost = 0;
+ SimulCost = 0;
+
+ for (int i = 0; i < nparts; i++)
+ {
+ p = parts[i];
+
+ StreamCost += p.StreamingCost;
+ SimulCost += p.SimulationCost;
+ PhysCost += p.PhysicsCost;
+ }
+ }
+
public void SaveScriptedState(XmlTextWriter writer)
{
SaveScriptedState(writer, false);
--
cgit v1.1
From 1c4bcf3fedbdb3c8143f364c43c939da810e896e Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 3 Apr 2012 23:13:48 +0200
Subject: Fix merge artefacts
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 27 +---------------------
1 file changed, 1 insertion(+), 26 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5b47fc0..ca6b5cb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2181,20 +2181,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- public void applyAngularImpulse(Vector3 impulse)
- {
- PhysicsActor pa = RootPart.PhysActor;
-
- if (pa != null)
- {
- if (!IsAttachment)
- {
- pa.AddAngularForce(impulse, true);
- m_scene.PhysicsScene.AddPhysicsActorTaint(pa);
- }
- }
- }
-
public void setAngularImpulse(Vector3 impulse)
{
PhysicsActor pa = RootPart.PhysActor;
@@ -2211,18 +2197,7 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 GetTorque()
{
- PhysicsActor pa = RootPart.PhysActor;
-
- if (pa != null)
- {
- if (!IsAttachment)
- {
- Vector3 torque = pa.Torque;
- return torque;
- }
- }
-
- return Vector3.Zero;
+ return Torque;
}
// This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object
--
cgit v1.1
From 1bded840b9f1b93829090a33a9f56dbfed2ce02a Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 3 Apr 2012 23:25:34 +0200
Subject: More artefact
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ca6b5cb..fde146c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2197,7 +2197,7 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 GetTorque()
{
- return Torque;
+ return RootPart.Torque;
}
// This is used by both Double-Click Auto-Pilot and llMoveToTarget() in an attached object
--
cgit v1.1
From 726915e9ef369a5b4cb7089ec9301c5c927dd862 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 3 Apr 2012 23:38:12 +0200
Subject: Fix the last merge artefacts
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index fde146c..5f33452 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3583,7 +3583,6 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion axRot = rot;
Quaternion oldParentRot = m_rootPart.RotationOffset;
- m_rootPart.StoreUndoState();
//Don't use UpdateRotation because it schedules an update prematurely
m_rootPart.RotationOffset = rot;
--
cgit v1.1
From 787cc0d076f0a56cf48dbef4475ec991da00adf0 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 4 Apr 2012 16:38:29 +0100
Subject: reverted changes to llApplyRotationalImpulse execution in SOP/SOG.
This functions naming is misleading, Here Apply means to apply a instante
impulse that may add to previus unprocessed ones and not setting a permanente
torque (that is done by llSetTorque).
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5f33452..54e8d50 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2181,7 +2181,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- public void setAngularImpulse(Vector3 impulse)
+ public void ApplyAngularImpulse(Vector3 impulse)
{
PhysicsActor pa = RootPart.PhysActor;
@@ -2189,7 +2189,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (!IsAttachment)
{
- pa.Torque = impulse;
+ pa.AddAngularForce(impulse, true);
m_scene.PhysicsScene.AddPhysicsActorTaint(pa);
}
}
--
cgit v1.1
From c4a9eae961030280473f6df77e59cb53865535b6 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 9 Apr 2012 23:33:42 +0100
Subject: make llGetGeometricCenter() work as in current SL. Now this is not
real geom center but a average of positions relative to root prim ignoring
prims details, so no need to use physics engine.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 30 +++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 107d9b6..3fd1f5e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3955,7 +3955,35 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+
+ public Vector3 GetGeometricCenter()
+ {
+ // this is not real geometric center but a average of positions relative to root prim acording to
+ // http://wiki.secondlife.com/wiki/llGetGeometricCenter
+ // ignoring tortured prims details since sl also seems to ignore
+ // so no real use in doing it on physics
+
+ Vector3 gc = Vector3.Zero;
+
+ int nparts = m_parts.Count;
+ if (nparts <= 1)
+ return gc;
+
+ SceneObjectPart[] parts = m_parts.GetArray();
+ nparts = parts.Length; // just in case it changed
+ if (nparts <= 1)
+ return gc;
+
+ // average all parts positions
+ for (int i = 0; i < nparts; i++)
+ gc += parts[i].GetWorldPosition();
+ gc /= nparts;
+
+ // relative to root:
+ gc -= AbsolutePosition;
+ return gc;
+ }
+
public float GetMass()
{
float retmass = 0f;
--
cgit v1.1
From 0fe0b2ceec2440ff284d7a494d090ce43449fd97 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 17 Apr 2012 23:39:41 +0200
Subject: Prevent objects rezzed in sim from being seen as attachments and
becoming uneditable or crashers. (Foxtail of death)
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3fd1f5e..47020af 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1941,6 +1941,12 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE]: Storing {0}, {1} in {2}",
// Name, UUID, m_scene.RegionInfo.RegionName);
+ if (RootPart.Shape.PCode == 9 && RootPart.Shape.State != 0)
+ {
+ RootPart.Shape.State = 0;
+ ScheduleGroupForFullUpdate();
+ }
+
SceneObjectGroup backup_group = Copy(false);
backup_group.RootPart.Velocity = RootPart.Velocity;
backup_group.RootPart.Acceleration = RootPart.Acceleration;
--
cgit v1.1
From 3b56c4445390461ea6cdef7bc9ad8f8b26fc97c1 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 20 Apr 2012 18:51:32 +0100
Subject: changed seletion code. SOP now knows about parts selection. UI
actions are sent to SOP and this reports to SOG. Group is selected if any
part is selected.sop.isSelect get() is only used in SOG. Will need to be
improved for better performance on largelinksets. *UNTESTED* NEEDS CHECKING
for side efects
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 48 ++++++++++++++++++----
1 file changed, 39 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 47020af..0100ab3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -726,6 +726,11 @@ namespace OpenSim.Region.Framework.Scenes
m_isSelected = value;
// Tell physics engine that group is selected
+ // this is not right
+ // but ode engines should only really need to know about root part
+ // so they can put entire object simulation on hold and not colliding
+ // keep as was for now
+
PhysicsActor pa = m_rootPart.PhysActor;
if (pa != null)
{
@@ -747,6 +752,40 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ public void PartSelectChanged(bool partSelect)
+ {
+ // any part selected makes group selected
+ if (m_isSelected == partSelect)
+ return;
+
+ if (partSelect)
+ {
+ IsSelected = partSelect;
+// if (!IsAttachment)
+// ScheduleGroupForFullUpdate();
+ }
+ else
+ {
+ // bad bad bad 2 heavy for large linksets
+ // since viewer does send lot of (un)selects
+ // this needs to be replaced by a specific list or count ?
+ // but that will require extra code in several places
+
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ {
+ SceneObjectPart part = parts[i];
+ if (part.IsSelected)
+ return;
+ }
+ IsSelected = partSelect;
+ if (!IsAttachment)
+ {
+ ScheduleGroupForFullUpdate();
+ }
+ }
+ }
+
private SceneObjectPart m_PlaySoundMasterPrim = null;
public SceneObjectPart PlaySoundMasterPrim
{
@@ -3139,14 +3178,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
-/*
- RootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
- for (int i = 0; i < parts.Length; i++)
- {
- if (parts[i] != RootPart)
- parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
- }
-*/
if (parts.Length > 1)
{
m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
@@ -3163,7 +3194,6 @@ namespace OpenSim.Region.Framework.Scenes
}
else
m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, false);
-
}
}
--
cgit v1.1
From 816a44d6dad4f20bbdc3d90cb60a862790ae97f3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 24 Apr 2012 21:48:12 +0100
Subject: SOG bug fix in UI object changes
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 31 ++++++++++++++--------
1 file changed, 20 insertions(+), 11 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0100ab3..b0f0a5d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3685,16 +3685,25 @@ namespace OpenSim.Region.Framework.Scenes
if (togroup)
{
- // related to group
- if ((change & ObjectChangeType.Position) != 0)
+ // related to group
+ if ((change & (ObjectChangeType.Rotation | ObjectChangeType.Position)) != 0)
{
- group.AbsolutePosition = data.position;
- updateType = updatetype.groupterse;
- }
- if ((change & ObjectChangeType.Rotation) != 0)
- {
- group.RootPart.UpdateRotation(data.rotation);
- updateType = updatetype.none;
+ if ((change & ObjectChangeType.Rotation) != 0)
+ {
+ group.RootPart.UpdateRotation(data.rotation);
+ updateType = updatetype.none;
+ }
+ if ((change & ObjectChangeType.Position) != 0)
+ {
+ group.AbsolutePosition = data.position;
+ updateType = updatetype.groupterse;
+ }
+ else
+ // ugly rotation update of all parts
+ {
+ group.AbsolutePosition = AbsolutePosition;
+ }
+
}
if ((change & ObjectChangeType.Scale) != 0)
{
@@ -3719,10 +3728,10 @@ namespace OpenSim.Region.Framework.Scenes
if (part == group.RootPart)
{
- if ((change & ObjectChangeType.Position) != 0)
- group.UpdateRootPosition(data.position);
if ((change & ObjectChangeType.Rotation) != 0)
group.UpdateRootRotation(data.rotation);
+ if ((change & ObjectChangeType.Position) != 0)
+ group.UpdateRootPosition(data.position);
if ((change & ObjectChangeType.Scale) != 0)
part.Resize(data.scale);
}
--
cgit v1.1
From 22ea2ef9a0bc45b54ecad3ccfe450dcaae5b9648 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 25 Apr 2012 17:11:32 +0100
Subject: set PIDHoverTau and not PIDTau since all physics need that
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b0f0a5d..ba353c4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2339,7 +2339,7 @@ namespace OpenSim.Region.Framework.Scenes
{
pa.PIDHoverHeight = height;
pa.PIDHoverType = hoverType;
- pa.PIDTau = tau;
+ pa.PIDHoverTau = tau;
pa.PIDHoverActive = true;
}
else
@@ -2660,19 +2660,21 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion oldRootRotation = linkPart.RotationOffset;
linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
+
linkPart.ParentID = m_rootPart.LocalId;
- linkPart.GroupPosition = AbsolutePosition;
- Vector3 axPos = linkPart.OffsetPosition;
+
+ linkPart.GroupPosition = AbsolutePosition;
+ Vector3 axPos = linkPart.OffsetPosition;
Quaternion parentRot = m_rootPart.RotationOffset;
axPos *= Quaternion.Inverse(parentRot);
-
linkPart.OffsetPosition = axPos;
+
Quaternion oldRot = linkPart.RotationOffset;
Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
linkPart.RotationOffset = newRot;
- linkPart.ParentID = m_rootPart.LocalId;
+// linkPart.ParentID = m_rootPart.LocalId; done above
if (m_rootPart.LinkNum == 0)
m_rootPart.LinkNum = 1;
--
cgit v1.1
From dd745f60c201aee7ff48ba81d567e7b38a8f186c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 28 Apr 2012 21:36:38 +0100
Subject: fix llGetCenterOfMass ( checked with ubitODE only)
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ba353c4..b0f2015 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -4041,6 +4041,39 @@ namespace OpenSim.Region.Framework.Scenes
return retmass;
}
+ // center of mass of full object
+ public Vector3 GetCenterOfMass()
+ {
+ PhysicsActor pa = RootPart.PhysActor;
+
+ if(((RootPart.Flags & PrimFlags.Physics) !=0) && pa !=null)
+ {
+ // physics knows better about center of mass of physical prims
+ Vector3 tmp = pa.CenterOfMass;
+ return tmp;
+ }
+
+ Vector3 Ptot = Vector3.Zero;
+ float totmass = 0f;
+ float m;
+
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ {
+ m = parts[i].GetMass();
+ Ptot += parts[i].GetPartCenterOfMass() * m;
+ totmass += m;
+ }
+
+ if (totmass == 0)
+ totmass = 0;
+ else
+ totmass = 1 / totmass;
+ Ptot *= totmass;
+
+ return Ptot;
+ }
+
///
/// If the object is a sculpt/mesh, retrieve the mesh data for each part and reinsert it into each shape so that
/// the physics engine can use it.
--
cgit v1.1
From df9935273f59371061bda7e61dbdd38594e5c85a Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 29 Apr 2012 00:41:51 +0100
Subject: SOG bug fix in group rotations updates
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b0f2015..f870b58 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2667,11 +2667,11 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 axPos = linkPart.OffsetPosition;
Quaternion parentRot = m_rootPart.RotationOffset;
- axPos *= Quaternion.Inverse(parentRot);
+ axPos *= Quaternion.Conjugate(parentRot);
linkPart.OffsetPosition = axPos;
Quaternion oldRot = linkPart.RotationOffset;
- Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
+ Quaternion newRot = Quaternion.Conjugate(parentRot) * oldRot;
linkPart.RotationOffset = newRot;
// linkPart.ParentID = m_rootPart.LocalId; done above
@@ -2923,12 +2923,12 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion rootRotation = m_rootPart.RotationOffset;
Vector3 pos = part.OffsetPosition;
- pos *= Quaternion.Inverse(rootRotation);
+ pos *= Quaternion.Conjugate(rootRotation);
part.OffsetPosition = pos;
parentRot = m_rootPart.RotationOffset;
oldRot = part.RotationOffset;
- Quaternion newRot = Quaternion.Inverse(parentRot) * worldRot;
+ Quaternion newRot = Quaternion.Conjugate(parentRot) * worldRot;
part.RotationOffset = newRot;
}
@@ -3526,6 +3526,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdateGroupRotationR(Quaternion rot)
{
+ m_rootPart.UpdateRotation(rot);
+
PhysicsActor actor = m_rootPart.PhysActor;
if (actor != null)
{
--
cgit v1.1
From c7c0d5558bc7f51f2da19782cf83362f766d831a Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 29 Apr 2012 01:00:46 +0100
Subject: remove repeated set of group rotation to physics
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f870b58..bc2ca4c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3527,14 +3527,15 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdateGroupRotationR(Quaternion rot)
{
m_rootPart.UpdateRotation(rot);
-
+
+/* this is done by rootpart RotationOffset set called by UpdateRotation
PhysicsActor actor = m_rootPart.PhysActor;
if (actor != null)
{
actor.Orientation = m_rootPart.RotationOffset;
m_scene.PhysicsScene.AddPhysicsActorTaint(actor);
}
-
+*/
HasGroupChanged = true;
ScheduleGroupForTerseUpdate();
}
--
cgit v1.1
From 84b5b3e89b4814c29b7782578dfcd6fa2f0c77f9 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 29 Apr 2012 06:39:09 +0100
Subject: llGetGeometricCenter...
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index bc2ca4c..f81cfe2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -4024,13 +4024,25 @@ namespace OpenSim.Region.Framework.Scenes
if (nparts <= 1)
return gc;
+ Quaternion parentRot = RootPart.RotationOffset;
+ Vector3 pPos;
+
// average all parts positions
for (int i = 0; i < nparts; i++)
- gc += parts[i].GetWorldPosition();
+ {
+ // do it directly
+ // gc += parts[i].GetWorldPosition();
+ if (parts[i] != RootPart)
+ {
+ pPos = parts[i].OffsetPosition;
+ gc += pPos;
+ }
+
+ }
gc /= nparts;
// relative to root:
- gc -= AbsolutePosition;
+// gc -= AbsolutePosition;
return gc;
}
--
cgit v1.1
From fc3cf2b5a3ec6d5405db41c2729a968d11c4a8fb Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 1 May 2012 23:21:28 +0200
Subject: Fix saving of attachment positions
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index bc2ca4c..10d53d7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3700,7 +3700,7 @@ namespace OpenSim.Region.Framework.Scenes
}
if ((change & ObjectChangeType.Position) != 0)
{
- group.AbsolutePosition = data.position;
+ UpdateGroupPosition(data.position);
updateType = updatetype.groupterse;
}
else
--
cgit v1.1
From a135e51d232143556e8154ccffeaf4860e02e33d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 2 May 2012 22:08:09 +0100
Subject: Improved sitted avatars crossings ( plus tests on vehicles)
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 76804d7..8e1f447 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -634,10 +634,18 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence agent = icon.EndInvoke(iar);
//// If the cross was successful, this agent is a child agent
- //if (agent.IsChildAgent)
- // agent.Reset();
- //else // Not successful
- // agent.RestoreInCurrentScene();
+ if (agent.IsChildAgent)
+ {
+ if (agent.ParentUUID != UUID.Zero)
+ {
+ agent.ParentPart = null;
+ agent.ParentPosition = Vector3.Zero;
+ }
+ }
+
+// agent.Reset();
+// else // Not successful
+// agent.RestoreInCurrentScene();
// In any case
agent.IsInTransit = false;
--
cgit v1.1
From 58a1a0710c971b83142bf21fa6259c95aa9d99dd Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 4 May 2012 11:32:37 +0100
Subject: SOG copy bug fix, now new group has own empty list of sitted avatars.
Also changed crossing code to restore sitting avas in case of group cross
fail
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 66 ++++++++++++++++++----
1 file changed, 54 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8e1f447..7e6b077 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -465,7 +465,15 @@ namespace OpenSim.Region.Framework.Scenes
{
return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0));
}
-
+
+
+
+ private struct avtocrossInfo
+ {
+ public ScenePresence av;
+ public uint ParentID;
+ }
+
///
/// The absolute position of this scene object in the scene
///
@@ -517,15 +525,24 @@ namespace OpenSim.Region.Framework.Scenes
{
// We unparent the SP quietly so that it won't
// be made to stand up
+
+ List avsToCross = new List();
+
foreach (ScenePresence av in m_linkedAvatars)
{
+ avtocrossInfo avinfo = new avtocrossInfo();
SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID);
if (parentPart != null)
av.ParentUUID = parentPart.UUID;
+ avinfo.av = av;
+ avinfo.ParentID = av.ParentID;
+ avsToCross.Add(avinfo);
+
av.ParentID = 0;
}
+// m_linkedAvatars.Clear();
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
// Normalize
@@ -541,18 +558,37 @@ namespace OpenSim.Region.Framework.Scenes
// If it's deleted, crossing was successful
if (IsDeleted)
{
- foreach (ScenePresence av in m_linkedAvatars)
+ // foreach (ScenePresence av in m_linkedAvatars)
+ foreach (avtocrossInfo avinfo in avsToCross)
{
- m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
-
- av.IsInTransit = true;
-
- CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
- d.BeginInvoke(av, val, x, y, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
+ ScenePresence av = avinfo.av;
+ if (!av.IsInTransit) // just in case...
+ {
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
+
+ av.IsInTransit = true;
+
+ CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
+ d.BeginInvoke(av, val, x, y, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
+ }
+ else
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val);
}
-
+ avsToCross.Clear();
return;
}
+ else // cross failed, put avas back ??
+ {
+ foreach (avtocrossInfo avinfo in avsToCross)
+ {
+ ScenePresence av = avinfo.av;
+ av.ParentUUID = UUID.Zero;
+ av.ParentID = avinfo.ParentID;
+// m_linkedAvatars.Add(av);
+ }
+ }
+ avsToCross.Clear();
+
}
else if (RootPart.PhysActor != null)
{
@@ -565,6 +601,7 @@ namespace OpenSim.Region.Framework.Scenes
val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f);
}
}
+
/* don't see the need but worse don't see where is restored to false if things stay in
foreach (SceneObjectPart part in m_parts.GetArray())
{
@@ -640,9 +677,12 @@ namespace OpenSim.Region.Framework.Scenes
{
agent.ParentPart = null;
agent.ParentPosition = Vector3.Zero;
+ // agent.ParentUUID = UUID.Zero;
}
}
+ agent.ParentUUID = UUID.Zero;
+
// agent.Reset();
// else // Not successful
// agent.RestoreInCurrentScene();
@@ -1779,15 +1819,14 @@ namespace OpenSim.Region.Framework.Scenes
part.ClearUpdateSchedule();
if (part == m_rootPart)
{
- if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) ||
+ if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) ||
(AttachmentPoint < 31) || (AttachmentPoint > 38))
avatar.ControllingClient.SendKillObject(m_regionHandle, new List { part.LocalId });
}
}
});
}
-
-
+
}
public void AddScriptLPS(int count)
@@ -2069,6 +2108,9 @@ namespace OpenSim.Region.Framework.Scenes
dupe.m_isBackedUp = false;
dupe.m_parts = new MapAndArray();
+ // new group as no sitting avatars
+ dupe.m_linkedAvatars = new List();
+
// Warning, The following code related to previousAttachmentStatus is needed so that clones of
// attachments do not bordercross while they're being duplicated. This is hacktastic!
// Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
--
cgit v1.1
From e3226aecd9fd1859f450f7912a6544c563834fcf Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 5 May 2012 10:47:51 +0100
Subject: SOG: tell physics about when we want a force or a impulse. (sorry
add to change here also)
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7e6b077..f9c2193 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2276,7 +2276,8 @@ namespace OpenSim.Region.Framework.Scenes
if (pa != null)
{
- pa.AddForce(impulse, true);
+ // false to be applied as a impulse
+ pa.AddForce(impulse, false);
m_scene.PhysicsScene.AddPhysicsActorTaint(pa);
}
}
@@ -2290,7 +2291,8 @@ namespace OpenSim.Region.Framework.Scenes
{
if (!IsAttachment)
{
- pa.AddAngularForce(impulse, true);
+ // false to be applied as a impulse
+ pa.AddAngularForce(impulse, false);
m_scene.PhysicsScene.AddPhysicsActorTaint(pa);
}
}
--
cgit v1.1
From e78043cb705520d1754a1a9450a4f82ff3deba53 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 14 May 2012 01:32:22 +0200
Subject: Check parcel entry permissions when moving objects
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f9c2193..fd25194 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3752,7 +3752,8 @@ namespace OpenSim.Region.Framework.Scenes
}
if ((change & ObjectChangeType.Position) != 0)
{
- UpdateGroupPosition(data.position);
+ if (m_scene.Permissions.CanObjectEntry(group.UUID, false, data.position))
+ UpdateGroupPosition(data.position);
updateType = updatetype.groupterse;
}
else
--
cgit v1.1
From e3c376156c37fe8bf1b0e0b69cb4acd655d3528f Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 14 May 2012 22:45:54 +0200
Subject: Completely revamp collision handling. Now works as it is supposed to.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 11 -----------
1 file changed, 11 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index fd25194..a6551c1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -755,17 +755,6 @@ namespace OpenSim.Region.Framework.Scenes
get { return true; }
}
- private bool m_passCollision;
- public bool PassCollision
- {
- get { return m_passCollision; }
- set
- {
- m_passCollision = value;
- HasGroupChanged = true;
- }
- }
-
public bool IsSelected
{
get { return m_isSelected; }
--
cgit v1.1
From d69f197a5d8946c576b5e799f04f209400e2e227 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sat, 19 May 2012 12:35:07 +0200
Subject: Fix setting positions of attachments. The recent security fix
regarding prim entry messed it up.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a6551c1..7568888 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3741,7 +3741,7 @@ namespace OpenSim.Region.Framework.Scenes
}
if ((change & ObjectChangeType.Position) != 0)
{
- if (m_scene.Permissions.CanObjectEntry(group.UUID, false, data.position))
+ if (IsAttachment || m_scene.Permissions.CanObjectEntry(group.UUID, false, data.position))
UpdateGroupPosition(data.position);
updateType = updatetype.groupterse;
}
--
cgit v1.1
From f5cbe56c569ad9453a055adba0636cf4a6614ec3 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 7 Jun 2012 19:01:33 +0200
Subject: Make not_at_target stop when the target is reached even if the script
is not listening to at_target
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7568888..8fa7880 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3926,10 +3926,11 @@ namespace OpenSim.Region.Framework.Scenes
scriptPosTarget target = m_targets[idx];
if (Util.GetDistanceTo(target.targetPos, m_rootPart.GroupPosition) <= target.tolerance)
{
+ at_target = true;
+
// trigger at_target
if (m_scriptListens_atTarget)
{
- at_target = true;
scriptPosTarget att = new scriptPosTarget();
att.targetPos = target.targetPos;
att.tolerance = target.tolerance;
--
cgit v1.1
From cd4994947858516f9177501499a1139f23ddd3cf Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 11 Jun 2012 22:43:35 +0100
Subject: change object drag so it applies a impulse and not a push force so it
works as before my fix to impulse/forces
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8fa7880..aab6a49 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2992,10 +2992,14 @@ namespace OpenSim.Region.Framework.Scenes
{
if (!m_rootPart.BlockGrab)
{
- Vector3 llmoveforce = pos - AbsolutePosition;
+/* Vector3 llmoveforce = pos - AbsolutePosition;
Vector3 grabforce = llmoveforce;
grabforce = (grabforce / 10) * pa.Mass;
- pa.AddForce(grabforce, true);
+ */
+ // empirically convert distance diference to a impulse
+ Vector3 grabforce = pos - AbsolutePosition;
+ grabforce = grabforce * (pa.Mass/ 10.0f);
+ pa.AddForce(grabforce, false);
m_scene.PhysicsScene.AddPhysicsActorTaint(pa);
}
}
--
cgit v1.1
From 8cf414ba32ba995562e574cd2a58ce7ee204a562 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 17 Jun 2012 11:38:40 +0100
Subject: *CHECK/REVIEW* comented out not used sp.ParentPosition. Comented out
SOG.AbsolutePosition changing 'linked' avatars positions ( reason in code
coment )
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index aab6a49..96eeec4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -631,6 +631,14 @@ namespace OpenSim.Region.Framework.Scenes
if (triggerScriptEvent)
part.TriggerScriptChangedEvent(Changed.POSITION);
}
+
+/*
+ This seems not needed and should not be needed:
+ sp absolute position depends on sit part absolute position fixed above.
+ sp ParentPosition is not used anywhere.
+ Since presence is sitting, viewer considers it 'linked' to root prim, so it will move/rotate it
+ Sending a extra packet with avatar position is not only bandwidth waste, but may cause jitter in viewers due to UPD nature.
+
if (!m_dupeInProgress)
{
foreach (ScenePresence av in m_linkedAvatars)
@@ -640,12 +648,12 @@ namespace OpenSim.Region.Framework.Scenes
{
Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
av.AbsolutePosition += offset;
- av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
+// av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
av.SendAvatarDataToAllAgents();
}
}
}
-
+*/
//if (m_rootPart.PhysActor != null)
//{
//m_rootPart.PhysActor.Position =
@@ -676,8 +684,8 @@ namespace OpenSim.Region.Framework.Scenes
if (agent.ParentUUID != UUID.Zero)
{
agent.ParentPart = null;
- agent.ParentPosition = Vector3.Zero;
- // agent.ParentUUID = UUID.Zero;
+// agent.ParentPosition = Vector3.Zero;
+// agent.ParentUUID = UUID.Zero;
}
}
@@ -3752,7 +3760,7 @@ namespace OpenSim.Region.Framework.Scenes
else
// ugly rotation update of all parts
{
- group.AbsolutePosition = AbsolutePosition;
+ group.ResetChildPrimPhysicsPositions();
}
}
--
cgit v1.1
From 59cd0a2419266f190375074e2bede0d9a10de370 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 11 Jul 2012 23:32:12 +0200
Subject: Change order of operations on backup to ensure keyframe motions are
backed up properly
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 96eeec4..1734ab7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2039,8 +2039,6 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChangedDueToDelink = false;
m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
- datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
-
backup_group.ForEachPart(delegate(SceneObjectPart part)
{
if (part.KeyframeMotion != null)
@@ -2048,6 +2046,12 @@ namespace OpenSim.Region.Framework.Scenes
part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
part.KeyframeMotion.UpdateSceneObject(this);
}
+ });
+
+ datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
+
+ backup_group.ForEachPart(delegate(SceneObjectPart part)
+ {
part.Inventory.ProcessInventoryBackup(datastore);
});
--
cgit v1.1
From ea91a36483f3eba90e16b664715d152f9eca2980 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 11 Jul 2012 23:33:13 +0200
Subject: Add instrumentation to log finalizer being called. Suppressed for
backup interim copies to avoid spammage. Not for release to the grid, must be
reverted first!
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1734ab7..1730723 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2045,6 +2045,7 @@ namespace OpenSim.Region.Framework.Scenes
{
part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
part.KeyframeMotion.UpdateSceneObject(this);
+ part.SuppressFinalizerLogging = true;
}
});
--
cgit v1.1
From d9b0b03aa3f92bcd860e4edb656cf6b1221776a6 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 11 Jul 2012 23:54:45 +0200
Subject: Place instrumentation in the proper place. This needs reverting, too!
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1730723..efeb551 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2045,8 +2045,8 @@ namespace OpenSim.Region.Framework.Scenes
{
part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
part.KeyframeMotion.UpdateSceneObject(this);
- part.SuppressFinalizerLogging = true;
}
+ part.SuppressFinalizerLogging = true;
});
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
--
cgit v1.1
From bae35ad97e10df4cfd3ecb73fab84081d85ede20 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 12 Jul 2012 01:01:29 +0200
Subject: Revert "Place instrumentation in the proper place. This needs
reverting, too!"
This reverts commit d9b0b03aa3f92bcd860e4edb656cf6b1221776a6.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index efeb551..1730723 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2045,8 +2045,8 @@ namespace OpenSim.Region.Framework.Scenes
{
part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
part.KeyframeMotion.UpdateSceneObject(this);
+ part.SuppressFinalizerLogging = true;
}
- part.SuppressFinalizerLogging = true;
});
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
--
cgit v1.1
From 906ac4adc4adc8eef84a584b73323fda25127806 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 12 Jul 2012 01:01:43 +0200
Subject: Revert "Add instrumentation to log finalizer being called. Suppressed
for backup"
This reverts commit ea91a36483f3eba90e16b664715d152f9eca2980.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 -
1 file changed, 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1730723..1734ab7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2045,7 +2045,6 @@ namespace OpenSim.Region.Framework.Scenes
{
part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
part.KeyframeMotion.UpdateSceneObject(this);
- part.SuppressFinalizerLogging = true;
}
});
--
cgit v1.1
From 1ff498266cd5ecc4ed8f3b1de86758b78a327f61 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 17 Jul 2012 05:25:34 +0100
Subject: minor changes, removed extra parts physics updates on linking
nonroot prims
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f1f94a7..6ab0027 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3066,7 +3066,7 @@ namespace OpenSim.Region.Framework.Scenes
part.LinkNum = linkNum;
// Compute the new position of this SOP relative to the group position
- part.OffsetPosition = part.GroupPosition - AbsolutePosition;
+ part.OffsetPosition = newPos - AbsolutePosition;
// (radams1 20120711: I don't know why part.OffsetPosition is set multiple times.
// It would have the affect of setting the physics engine position multiple
@@ -3087,7 +3087,8 @@ namespace OpenSim.Region.Framework.Scenes
// Since this SOP's state has changed, push those changes into the physics engine
// and the simulator.
- part.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false);
+ // done on caller
+// part.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect, false);
}
///
--
cgit v1.1
From b97053269b33c4fc733372cf44f0f16d244d87b8 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 16 Aug 2012 01:02:20 +0200
Subject: Change case of areUpdatesSuspended to upper case as is proper for a
property
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d837adb..4d610f4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_suspendUpdates;
private List m_linkedAvatars = new List();
- public bool areUpdatesSuspended
+ public bool AreUpdatesSuspended
{
get
{
--
cgit v1.1
From bbac8f76faff387756bfa55dea83fa3bd589ef79 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 16 Aug 2012 01:18:32 +0200
Subject: Remove AreUpdatesSuspended flag because it does nothing
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 17 -----------------
1 file changed, 17 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4d610f4..6104c66 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -113,25 +113,8 @@ namespace OpenSim.Region.Framework.Scenes
private long m_maxPersistTime = 0;
private long m_minPersistTime = 0;
private Random m_rand;
- private bool m_suspendUpdates;
private List m_linkedAvatars = new List();
- public bool AreUpdatesSuspended
- {
- get
- {
- return m_suspendUpdates;
- }
- set
- {
- m_suspendUpdates = value;
- if (!value)
- {
- QueueForUpdateCheck();
- }
- }
- }
-
///
/// This indicates whether the object has changed such that it needs to be repersisted to permenant storage
/// (the database).
--
cgit v1.1
From 26224704de9c641cebcc0b47197e1c5a677861cf Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 21 Aug 2012 19:24:41 +0200
Subject: Cause a persistence save if prim flags change
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6104c66..cb4aa2d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3306,6 +3306,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public void UpdatePrimFlags(uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect)
{
+ HasGroupChanged = true;
+
SceneObjectPart selectionPart = GetPart(localID);
if (SetTemporary && Scene != null)
--
cgit v1.1
From c1a0c7fad17bb2aead1539b61fe82fee16686190 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 23 Aug 2012 23:09:32 +0200
Subject: Fix bad child prim permissions that can make objects change perms
after rezzing
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index cb4aa2d..eee53d7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2852,6 +2852,9 @@ namespace OpenSim.Region.Framework.Scenes
// Can't do this yet since backup still makes use of the root part without any synchronization
// objectGroup.m_rootPart = null;
+ // If linking prims with different permissions, fix them
+ AdjustChildPrimPermissions();
+
AttachToBackup();
// Here's the deal, this is ABSOLUTELY CRITICAL so the physics scene gets the update about the
@@ -3391,12 +3394,21 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ public void AdjustChildPrimPermissions()
+ {
+ ForEachPart(part =>
+ {
+ if (part != RootPart)
+ part.ClonePermissions(RootPart);
+ });
+ }
+
public void UpdatePermissions(UUID AgentID, byte field, uint localID,
uint mask, byte addRemTF)
{
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].UpdatePermissions(AgentID, field, localID, mask, addRemTF);
+ RootPart.UpdatePermissions(AgentID, field, localID, mask, addRemTF);
+
+ AdjustChildPrimPermissions();
HasGroupChanged = true;
--
cgit v1.1
From ef6e007a4c7301dbd7a1a0392a07664e7034201b Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 28 Aug 2012 03:21:03 +0100
Subject: [possible still very broken] mess around keyframes. timer events
threads overlaps, some null objects exceptions, region crossing...
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 29 +++++++++++++++++-----
1 file changed, 23 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index eee53d7..65a1da2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -509,6 +509,9 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 newpos = Vector3.Zero;
OpenSim.Services.Interfaces.GridRegion destination = null;
+ if (m_rootPart.KeyframeMotion != null)
+ m_rootPart.KeyframeMotion.StartCrossingCheck();
+
bool canCross = true;
foreach (ScenePresence av in m_linkedAvatars)
{
@@ -551,7 +554,7 @@ namespace OpenSim.Region.Framework.Scenes
av.ParentID = 0;
}
-// m_linkedAvatars.Clear();
+ // m_linkedAvatars.Clear();
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
// Normalize
@@ -599,11 +602,16 @@ namespace OpenSim.Region.Framework.Scenes
avsToCross.Clear();
}
- else if (RootPart.PhysActor != null)
+ else
{
- RootPart.PhysActor.CrossingFailure();
- }
+ if (m_rootPart.KeyframeMotion != null)
+ m_rootPart.KeyframeMotion.CrossingFailure();
+ if (RootPart.PhysActor != null)
+ {
+ RootPart.PhysActor.CrossingFailure();
+ }
+ }
Vector3 oldp = AbsolutePosition;
val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f);
val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
@@ -2058,8 +2066,8 @@ namespace OpenSim.Region.Framework.Scenes
{
if (part.KeyframeMotion != null)
{
- part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
- part.KeyframeMotion.UpdateSceneObject(this);
+ part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize(false));
+// part.KeyframeMotion.UpdateSceneObject(this);
}
});
@@ -4407,6 +4415,15 @@ namespace OpenSim.Region.Framework.Scenes
public virtual ISceneObject CloneForNewScene()
{
SceneObjectGroup sog = Copy(false);
+ sog.ForEachPart(delegate(SceneObjectPart part)
+ {
+ if (part.KeyframeMotion != null)
+ {
+ part.KeyframeMotion = KeyframeMotion.FromData(sog, part.KeyframeMotion.Serialize(true));
+ // this is called later
+// part.KeyframeMotion.UpdateSceneObject(this);
+ }
+ });
sog.IsDeleted = false;
return sog;
}
--
cgit v1.1
From 5284e514d5e71e6f1637bff133db6de73e6ff7ef Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 28 Aug 2012 22:16:01 +0200
Subject: Fix a nullref while object is being created
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index eee53d7..da312f3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3025,7 +3025,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public virtual void DetachFromBackup()
{
- m_scene.SceneGraph.FireDetachFromBackup(this);
+ if (m_scene != null)
+ m_scene.SceneGraph.FireDetachFromBackup(this);
if (m_isBackedUp && Scene != null)
m_scene.EventManager.OnBackup -= ProcessBackup;
--
cgit v1.1
From 2e54c3cc8f4caf6b6d056ae04419b171942a17d7 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 29 Aug 2012 03:19:47 +0100
Subject: A few more changes to keyframes
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 65a1da2..834d27b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2066,7 +2066,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (part.KeyframeMotion != null)
{
- part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize(false));
+ part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
// part.KeyframeMotion.UpdateSceneObject(this);
}
});
@@ -4419,7 +4419,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (part.KeyframeMotion != null)
{
- part.KeyframeMotion = KeyframeMotion.FromData(sog, part.KeyframeMotion.Serialize(true));
+ part.KeyframeMotion = KeyframeMotion.FromData(sog, part.KeyframeMotion.Serialize());
// this is called later
// part.KeyframeMotion.UpdateSceneObject(this);
}
--
cgit v1.1
From c821153a4fcc0a0d806d2c9be63cf48494e4dd06 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 30 Aug 2012 00:15:46 +0100
Subject: [possible still bad] make use of keyframemotion.copy on sop.copy,
replacing fromdata(seralize). for now its called with null group since
sop.copy() hasn't usable new group information, so for copied keyframes be
fully operational UpdateSceneObject(newgroup) needs to be called on them.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 834d27b..fe34ad4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2062,6 +2062,7 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChangedDueToDelink = false;
m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
+/*
backup_group.ForEachPart(delegate(SceneObjectPart part)
{
if (part.KeyframeMotion != null)
@@ -2070,7 +2071,7 @@ namespace OpenSim.Region.Framework.Scenes
// part.KeyframeMotion.UpdateSceneObject(this);
}
});
-
+*/
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
backup_group.ForEachPart(delegate(SceneObjectPart part)
@@ -4415,15 +4416,6 @@ namespace OpenSim.Region.Framework.Scenes
public virtual ISceneObject CloneForNewScene()
{
SceneObjectGroup sog = Copy(false);
- sog.ForEachPart(delegate(SceneObjectPart part)
- {
- if (part.KeyframeMotion != null)
- {
- part.KeyframeMotion = KeyframeMotion.FromData(sog, part.KeyframeMotion.Serialize());
- // this is called later
-// part.KeyframeMotion.UpdateSceneObject(this);
- }
- });
sog.IsDeleted = false;
return sog;
}
--
cgit v1.1
From a7281003d85b6e9620d02387d4d9a42dcae27b24 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 30 Aug 2012 01:30:56 +0100
Subject: move keyframemotion.copy from sop.copy to sog.copy, where there is
newgroup information avaiable.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index df4bd0d..bc0f5b6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2159,6 +2159,7 @@ namespace OpenSim.Region.Framework.Scenes
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
+
if (userExposed)
dupe.m_rootPart.TrimPermissions();
@@ -2209,6 +2210,9 @@ namespace OpenSim.Region.Framework.Scenes
if (userExposed)
newPart.ApplyPhysics((uint)newPart.Flags,newPart.VolumeDetectActive,true);
// }
+ // copy keyframemotion
+ if (part.KeyframeMotion != null)
+ newPart.KeyframeMotion = part.KeyframeMotion.Copy(dupe);
}
if (userExposed)
--
cgit v1.1
From 056e66b3dec555613bd96b153ba03a124863dbf2 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 4 Sep 2012 03:14:39 +0200
Subject: Refactor avatar transfer so that the heavy (UpdateAgent) part is
separated into it's own sub-method
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index bc0f5b6..4798481 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -581,7 +581,7 @@ namespace OpenSim.Region.Framework.Scenes
av.IsInTransit = true;
CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
- d.BeginInvoke(av, val, x, y, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
+ d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
}
else
m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val);
--
cgit v1.1
From 9eca154bced7423867e8f9597b8baf214de79087 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 26 Sep 2012 23:17:21 +0100
Subject: Make it possible to rescale SOGs when they are not in a scene.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 53 ++++++++++++----------
1 file changed, 30 insertions(+), 23 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f1df6d6..ddcc956 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3483,27 +3483,35 @@ namespace OpenSim.Region.Framework.Scenes
///
public void GroupResize(Vector3 scale)
{
- scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X));
- scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y));
- scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z));
+// m_log.DebugFormat(
+// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
PhysicsActor pa = m_rootPart.PhysActor;
- if (pa != null && pa.IsPhysical)
+ RootPart.StoreUndoState(true);
+
+ if (Scene != null)
{
- scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X));
- scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y));
- scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z));
+ scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X));
+ scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y));
+ scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z));
+
+ if (pa != null && pa.IsPhysical)
+ {
+ scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X));
+ scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y));
+ scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z));
+ }
}
float x = (scale.X / RootPart.Scale.X);
float y = (scale.Y / RootPart.Scale.Y);
float z = (scale.Z / RootPart.Scale.Z);
- SceneObjectPart[] parts;
- if (x > 1.0f || y > 1.0f || z > 1.0f)
+ SceneObjectPart[] parts = m_parts.GetArray();
+
+ if (Scene != null & (x > 1.0f || y > 1.0f || z > 1.0f))
{
- parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart obPart = parts[i];
@@ -3516,7 +3524,7 @@ namespace OpenSim.Region.Framework.Scenes
if (pa != null && pa.IsPhysical)
{
- if (oldSize.X * x > m_scene.m_maxPhys)
+ if (oldSize.X * x > Scene.m_maxPhys)
{
f = m_scene.m_maxPhys / oldSize.X;
a = f / x;
@@ -3524,7 +3532,7 @@ namespace OpenSim.Region.Framework.Scenes
y *= a;
z *= a;
}
- else if (oldSize.X * x < m_scene.m_minPhys)
+ else if (oldSize.X * x < Scene.m_minPhys)
{
f = m_scene.m_minPhys / oldSize.X;
a = f / x;
@@ -3533,7 +3541,7 @@ namespace OpenSim.Region.Framework.Scenes
z *= a;
}
- if (oldSize.Y * y > m_scene.m_maxPhys)
+ if (oldSize.Y * y > Scene.m_maxPhys)
{
f = m_scene.m_maxPhys / oldSize.Y;
a = f / y;
@@ -3541,7 +3549,7 @@ namespace OpenSim.Region.Framework.Scenes
y *= a;
z *= a;
}
- else if (oldSize.Y * y < m_scene.m_minPhys)
+ else if (oldSize.Y * y < Scene.m_minPhys)
{
f = m_scene.m_minPhys / oldSize.Y;
a = f / y;
@@ -3550,7 +3558,7 @@ namespace OpenSim.Region.Framework.Scenes
z *= a;
}
- if (oldSize.Z * z > m_scene.m_maxPhys)
+ if (oldSize.Z * z > Scene.m_maxPhys)
{
f = m_scene.m_maxPhys / oldSize.Z;
a = f / z;
@@ -3558,7 +3566,7 @@ namespace OpenSim.Region.Framework.Scenes
y *= a;
z *= a;
}
- else if (oldSize.Z * z < m_scene.m_minPhys)
+ else if (oldSize.Z * z < Scene.m_minPhys)
{
f = m_scene.m_minPhys / oldSize.Z;
a = f / z;
@@ -3569,7 +3577,7 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
- if (oldSize.X * x > m_scene.m_maxNonphys)
+ if (oldSize.X * x > Scene.m_maxNonphys)
{
f = m_scene.m_maxNonphys / oldSize.X;
a = f / x;
@@ -3577,7 +3585,7 @@ namespace OpenSim.Region.Framework.Scenes
y *= a;
z *= a;
}
- else if (oldSize.X * x < m_scene.m_minNonphys)
+ else if (oldSize.X * x < Scene.m_minNonphys)
{
f = m_scene.m_minNonphys / oldSize.X;
a = f / x;
@@ -3586,7 +3594,7 @@ namespace OpenSim.Region.Framework.Scenes
z *= a;
}
- if (oldSize.Y * y > m_scene.m_maxNonphys)
+ if (oldSize.Y * y > Scene.m_maxNonphys)
{
f = m_scene.m_maxNonphys / oldSize.Y;
a = f / y;
@@ -3594,7 +3602,7 @@ namespace OpenSim.Region.Framework.Scenes
y *= a;
z *= a;
}
- else if (oldSize.Y * y < m_scene.m_minNonphys)
+ else if (oldSize.Y * y < Scene.m_minNonphys)
{
f = m_scene.m_minNonphys / oldSize.Y;
a = f / y;
@@ -3603,7 +3611,7 @@ namespace OpenSim.Region.Framework.Scenes
z *= a;
}
- if (oldSize.Z * z > m_scene.m_maxNonphys)
+ if (oldSize.Z * z > Scene.m_maxNonphys)
{
f = m_scene.m_maxNonphys / oldSize.Z;
a = f / z;
@@ -3611,7 +3619,7 @@ namespace OpenSim.Region.Framework.Scenes
y *= a;
z *= a;
}
- else if (oldSize.Z * z < m_scene.m_minNonphys)
+ else if (oldSize.Z * z < Scene.m_minNonphys)
{
f = m_scene.m_minNonphys / oldSize.Z;
a = f / z;
@@ -3631,7 +3639,6 @@ namespace OpenSim.Region.Framework.Scenes
RootPart.Resize(prevScale);
- parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart obPart = parts[i];
--
cgit v1.1
From b52311b8f80db28183069901d5540d61db0bd8ea Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 27 Sep 2012 17:16:39 +0100
Subject: Remove a core undo call that we don't need.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 --
1 file changed, 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ddcc956..bf898bb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3488,8 +3488,6 @@ namespace OpenSim.Region.Framework.Scenes
PhysicsActor pa = m_rootPart.PhysActor;
- RootPart.StoreUndoState(true);
-
if (Scene != null)
{
scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X));
--
cgit v1.1
From 78ce7a0a04dc5ce3212acfb0e88a3a5a1b876100 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 7 Oct 2012 01:20:52 +0100
Subject: [DANGER UNTESTED] ODE mesh assets. Other plugins will not do
meshs/sculpts now
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4798481..4b22ebe 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -4299,8 +4299,8 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].CheckSculptAndLoad();
+// for (int i = 0; i < parts.Length; i++)
+// parts[i].CheckSculptAndLoad();
}
///
--
cgit v1.1
From 8894f4ad7735fc0a37fd62c89467163f6ec503cb Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 8 Oct 2012 01:34:32 +0200
Subject: Change permissions on child prim inventory items when god mode "force
permissive" is used.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++++++
1 file changed, 8 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4798481..9dd6639 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3422,8 +3422,16 @@ namespace OpenSim.Region.Framework.Scenes
{
RootPart.UpdatePermissions(AgentID, field, localID, mask, addRemTF);
+ bool god = Scene.Permissions.IsGod(AgentID);
+
AdjustChildPrimPermissions();
+ if (field == 1 && god) // Base mask was set. Update all child part inventories
+ {
+ foreach (SceneObjectPart part in Parts)
+ part.Inventory.ApplyGodPermissions(RootPart.BaseMask);
+ }
+
HasGroupChanged = true;
// Send the group's properties to all clients once all parts are updated
--
cgit v1.1
From aba078c93f4966cf6be10fc02228323843b9249e Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 14 Oct 2012 17:32:46 +0200
Subject: Fix perms when linking an object. Set root part perms to the perms of
the link set to make the build floater behave consistently. Fixes permissions
exploit introduced on 23 August.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9dd6639..053bfb4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3410,11 +3410,18 @@ namespace OpenSim.Region.Framework.Scenes
public void AdjustChildPrimPermissions()
{
+ uint newOwnerMask = (uint)PermissionMask.All & 0xfffffff8; // Mask folded bits
+ uint foldedPerms = RootPart.OwnerMask & 3;
+
ForEachPart(part =>
{
+ newOwnerMask &= part.BaseMask;
if (part != RootPart)
part.ClonePermissions(RootPart);
});
+
+ RootPart.OwnerMask = newOwnerMask | foldedPerms;
+ RootPart.ScheduleFullUpdate();
}
public void UpdatePermissions(UUID AgentID, byte field, uint localID,
--
cgit v1.1
From 7228ad7a51e7f976e58331e06aba133528ee2cb3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 18 Oct 2012 15:30:42 +0100
Subject: extend coment to include all unused SOG CheckSculptAndLoad()
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4b22ebe..f490d90 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -4287,6 +4287,7 @@ namespace OpenSim.Region.Framework.Scenes
///
/// When the physics engine has finished with it, the sculpt data is discarded to save memory.
///
+/*
public void CheckSculptAndLoad()
{
if (IsDeleted)
@@ -4299,10 +4300,10 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart[] parts = m_parts.GetArray();
-// for (int i = 0; i < parts.Length; i++)
-// parts[i].CheckSculptAndLoad();
+ for (int i = 0; i < parts.Length; i++)
+ parts[i].CheckSculptAndLoad();
}
-
+*/
///
/// Set the user group to which this scene object belongs.
///
--
cgit v1.1
From 1a34f42426b5819f97079c138c596182bf683416 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 28 Oct 2012 18:34:57 +0100
Subject: Add a property to determine if a link set is stored in the database.
Also, fix a bug where "Force object permissive" god action would fail to
reset child prim permissions.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 13 +++++++++++++
1 file changed, 13 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b12d0e0..ee61de6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -307,6 +307,11 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_isBackedUp;
+ public bool IsBackedUp
+ {
+ get { return m_isBackedUp; }
+ }
+
protected MapAndArray m_parts = new MapAndArray();
protected ulong m_regionHandle;
@@ -3431,6 +3436,14 @@ namespace OpenSim.Region.Framework.Scenes
bool god = Scene.Permissions.IsGod(AgentID);
+ if (field == 1 && god)
+ {
+ ForEachPart(part =>
+ {
+ part.BaseMask = RootPart.BaseMask;
+ });
+ }
+
AdjustChildPrimPermissions();
if (field == 1 && god) // Base mask was set. Update all child part inventories
--
cgit v1.1
From b8c19fe1a9dc49a060be7afce6d317d52db1983a Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 2 Nov 2012 17:40:17 +0000
Subject: Create a new random when needed using normal time based seed instead
of reusing a shared one than may not be valid
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ee61de6..6339522 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Region.Framework.Scenes
private long timeLastChanged = 0;
private long m_maxPersistTime = 0;
private long m_minPersistTime = 0;
- private Random m_rand;
+// private Random m_rand;
private List m_linkedAvatars = new List();
///
@@ -130,6 +130,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (value)
{
+
if (m_isBackedUp)
{
m_scene.SceneGraph.FireChangeBackup(this);
@@ -139,13 +140,15 @@ namespace OpenSim.Region.Framework.Scenes
timeFirstChanged = DateTime.Now.Ticks;
if (m_rootPart != null && m_rootPart.UUID != null && m_scene != null)
{
+/*
if (m_rand == null)
{
byte[] val = new byte[16];
m_rootPart.UUID.ToBytes(val, 0);
m_rand = new Random(BitConverter.ToInt32(val, 0));
}
-
+ */
+ Random m_rand = new Random();
if (m_scene.GetRootAgentCount() == 0)
{
//If the region is empty, this change has been made by an automated process
--
cgit v1.1
From e642b80a79bc2a5585972caa14a8f5f59a5dc6fb Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 2 Nov 2012 17:49:54 +0000
Subject: actually remove the use of random on persist timmings
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6339522..e94ecee 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -148,13 +148,13 @@ namespace OpenSim.Region.Framework.Scenes
m_rand = new Random(BitConverter.ToInt32(val, 0));
}
*/
- Random m_rand = new Random();
if (m_scene.GetRootAgentCount() == 0)
{
//If the region is empty, this change has been made by an automated process
//and thus we delay the persist time by a random amount between 1.5 and 2.5.
- float factor = 1.5f + (float)(m_rand.NextDouble());
+// float factor = 1.5f + (float)(m_rand.NextDouble());
+ float factor = 2.0f;
m_maxPersistTime = (long)((float)m_scene.m_persistAfter * factor);
m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * factor);
}
@@ -162,8 +162,10 @@ namespace OpenSim.Region.Framework.Scenes
{
//If the region is not empty, we want to obey the minimum and maximum persist times
//but add a random factor so we stagger the object persistance a little
- m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
- m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
+// m_maxPersistTime = (long)((float)m_scene.m_persistAfter * (1.0d - (m_rand.NextDouble() / 5.0d))); //Multiply by 1.0-1.5
+// m_minPersistTime = (long)((float)m_scene.m_dontPersistBefore * (1.0d + (m_rand.NextDouble() / 2.0d))); //Multiply by 0.8-1.0
+ m_maxPersistTime = m_scene.m_persistAfter;
+ m_minPersistTime = m_scene.m_dontPersistBefore;
}
}
}
--
cgit v1.1
From d2695cb3f7356a5c4047bbef2ac8f83fc8350976 Mon Sep 17 00:00:00 2001
From: teravus
Date: Sat, 15 Dec 2012 16:26:03 -0500
Subject: * Fix for Prim Locking. Prior to the merge, it was just a clone of
the root part to each of the child parts.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b9f9c86..0b82093 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3439,17 +3439,17 @@ namespace OpenSim.Region.Framework.Scenes
public void AdjustChildPrimPermissions()
{
- uint newOwnerMask = (uint)PermissionMask.All & 0xfffffff8; // Mask folded bits
- uint foldedPerms = RootPart.OwnerMask & 3;
+ //uint newOwnerMask = (uint)PermissionMask.All & 0xfffffff8; // Mask folded bits
+ //uint foldedPerms = RootPart.OwnerMask & 3;
ForEachPart(part =>
{
- newOwnerMask &= part.BaseMask;
+ //newOwnerMask &= part.BaseMask;
if (part != RootPart)
part.ClonePermissions(RootPart);
});
- RootPart.OwnerMask = newOwnerMask | foldedPerms;
+ //RootPart.OwnerMask = newOwnerMask | foldedPerms;
RootPart.ScheduleFullUpdate();
}
--
cgit v1.1
From 7d8c2b342c77cd4c5b26ee9500b5d9383b8bae77 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 16 Dec 2012 02:05:01 +0100
Subject: Fix locking objects
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b9f9c86..4ad8b11 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3449,7 +3449,9 @@ namespace OpenSim.Region.Framework.Scenes
part.ClonePermissions(RootPart);
});
- RootPart.OwnerMask = newOwnerMask | foldedPerms;
+ uint lockMask = ~(uint)PermissionMask.Move;
+ uint lockBit = RootPart.OwnerMask & (uint)PermissionMask.Move;
+ RootPart.OwnerMask = (RootPart.OwnerMask & lockBit) | ((newOwnerMask | foldedPerms) & lockMask);
RootPart.ScheduleFullUpdate();
}
--
cgit v1.1
From 861477d85e794d067f372587ccf56d8887e5ec63 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 18 Dec 2012 09:32:05 +0100
Subject: Fix locking for good
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0b974c6..4ad8b11 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3439,12 +3439,12 @@ namespace OpenSim.Region.Framework.Scenes
public void AdjustChildPrimPermissions()
{
- //uint newOwnerMask = (uint)PermissionMask.All & 0xfffffff8; // Mask folded bits
- //uint foldedPerms = RootPart.OwnerMask & 3;
+ uint newOwnerMask = (uint)PermissionMask.All & 0xfffffff8; // Mask folded bits
+ uint foldedPerms = RootPart.OwnerMask & 3;
ForEachPart(part =>
{
- //newOwnerMask &= part.BaseMask;
+ newOwnerMask &= part.BaseMask;
if (part != RootPart)
part.ClonePermissions(RootPart);
});
--
cgit v1.1
From 819f4b338d7c998a6e93b4558d6bd005a097904d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 11 Jan 2013 16:02:14 +0000
Subject: remove redundant lastPhysGroupPos and lastPhysGroupRot checks in
SOG Update(). rootpart does more complet checks
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4ad8b11..b008e66 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -307,9 +307,6 @@ namespace OpenSim.Region.Framework.Scenes
get { return RootPart.VolumeDetectActive; }
}
- private Vector3 lastPhysGroupPos;
- private Quaternion lastPhysGroupRot;
-
private bool m_isBackedUp;
public bool IsBackedUp
@@ -2525,6 +2522,7 @@ namespace OpenSim.Region.Framework.Scenes
#endregion
+
public override void Update()
{
// Check that the group was not deleted before the scheduled update
@@ -2543,19 +2541,8 @@ namespace OpenSim.Region.Framework.Scenes
// check to see if the physical position or rotation warrant an update.
if (m_rootPart.UpdateFlag == UpdateRequired.NONE)
{
- bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
-
- if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
- {
- m_rootPart.UpdateFlag = UpdateRequired.TERSE;
- lastPhysGroupPos = AbsolutePosition;
- }
-
- if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
- {
- m_rootPart.UpdateFlag = UpdateRequired.TERSE;
- lastPhysGroupRot = GroupRotation;
- }
+ // rootpart SendScheduledUpdates will check if a update is needed
+ m_rootPart.UpdateFlag = UpdateRequired.TERSE;
}
SceneObjectPart[] parts = m_parts.GetArray();
--
cgit v1.1
From de49440839e905cc4b3668962be96f8e274704d0 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 16 Jan 2013 22:17:10 +0000
Subject: dont send a full grp update on stopmovetotarget. just a rootpart
terse
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b008e66..b474979 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2369,6 +2369,8 @@ namespace OpenSim.Region.Framework.Scenes
if (pa != null)
pa.PIDActive = false;
+
+ RootPart.ScheduleTerseUpdate(); // send a stop information
}
public void rotLookAt(Quaternion target, float strength, float damping)
--
cgit v1.1
From a291e6be93ada150e35e141dbeb37a31d580f87d Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 21 Jan 2013 01:47:54 +0100
Subject: Limit active at targets to 8
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b474979..17f5a0f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -320,8 +320,8 @@ namespace OpenSim.Region.Framework.Scenes
protected SceneObjectPart m_rootPart;
// private Dictionary m_scriptEvents = new Dictionary();
- private Dictionary m_targets = new Dictionary();
- private Dictionary m_rotTargets = new Dictionary();
+ private SortedDictionary m_targets = new SortedDictionary();
+ private SortedDictionary m_rotTargets = new SortedDictionary();
private bool m_scriptListens_atTarget;
private bool m_scriptListens_notAtTarget;
@@ -4112,6 +4112,8 @@ namespace OpenSim.Region.Framework.Scenes
waypoint.handle = handle;
lock (m_rotTargets)
{
+ if (m_rotTargets.Count >= 8)
+ m_rotTargets.Remove(m_rotTargets.ElementAt(0).Key);
m_rotTargets.Add(handle, waypoint);
}
m_scene.AddGroupTarget(this);
@@ -4137,6 +4139,8 @@ namespace OpenSim.Region.Framework.Scenes
waypoint.handle = handle;
lock (m_targets)
{
+ if (m_targets.Count >= 8)
+ m_targets.Remove(m_targets.ElementAt(0).Key);
m_targets.Add(handle, waypoint);
}
m_scene.AddGroupTarget(this);
--
cgit v1.1
From da6f589885b7acf5f85aaeb2c011792b9d41a22e Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 21 Jan 2013 08:36:21 +0100
Subject: Add accessors to allow serializing rot and position targets
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 17f5a0f..ed1bbd8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -79,14 +79,14 @@ namespace OpenSim.Region.Framework.Scenes
object_rez = 4194304
}
- struct scriptPosTarget
+ public struct scriptPosTarget
{
public Vector3 targetPos;
public float tolerance;
public uint handle;
}
- struct scriptRotTarget
+ public struct scriptRotTarget
{
public Quaternion targetRot;
public float tolerance;
@@ -323,6 +323,16 @@ namespace OpenSim.Region.Framework.Scenes
private SortedDictionary m_targets = new SortedDictionary();
private SortedDictionary m_rotTargets = new SortedDictionary();
+ public SortedDictionary AtTargets
+ {
+ get { return m_targets; }
+ }
+
+ public SortedDictionary RotTargets
+ {
+ get { return m_rotTargets; }
+ }
+
private bool m_scriptListens_atTarget;
private bool m_scriptListens_notAtTarget;
private bool m_scriptListens_atRotTarget;
--
cgit v1.1
From c341664c1b8ccf3bd7b81795b900b971a15ff318 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 24 Mar 2013 18:56:28 +0100
Subject: Phase 1 of implementing a transfer permission. Overwrite libOMV's
PermissionMask with our own and add export permissions as well as a new
definition for "All" as meaning "all conventional permissions" rather than
"all possible permissions"
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0f5d116..b109b4f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -41,6 +41,7 @@ using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Physics.Manager;
using OpenSim.Region.Framework.Scenes.Serialization;
+using PermissionMask = OpenSim.Framework.PermissionMask;
namespace OpenSim.Region.Framework.Scenes
{
--
cgit v1.1
From 4bf9c4bbb833f8ecbd0757b333da76ffaea14bc7 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 31 Mar 2013 20:25:32 +0200
Subject: Export permission, part two. Setting export perms for textures and
clothing works. Setting perms for prims also works but they don't propagate
correctly yet. NOT FOR PRODUCTIN USE. Your database will need to be updated
before you can use this!
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b109b4f..69fb6df 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3468,7 +3468,7 @@ namespace OpenSim.Region.Framework.Scenes
public void AdjustChildPrimPermissions()
{
- uint newOwnerMask = (uint)PermissionMask.All & 0xfffffff8; // Mask folded bits
+ uint newOwnerMask = (uint)(PermissionMask.All | PermissionMask.Export) & 0xfffffff8; // Mask folded bits
uint foldedPerms = RootPart.OwnerMask & 3;
ForEachPart(part =>
--
cgit v1.1
From a348c8e44a72bd2de0151fc6db7a229cd8ee86a2 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 26 May 2013 14:11:48 +0200
Subject: Allow Linden trees to preserve their type when taken into inventory
and rezzed again. Allow Linden trees to be sensed by LLSensor as PASSIVE
objects.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 69fb6df..0ea4e09 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -272,6 +272,11 @@ namespace OpenSim.Region.Framework.Scenes
{
AttachmentPoint = 0;
+ // Don't zap trees
+ if (RootPart.Shape.PCode == (byte)PCode.Tree ||
+ RootPart.Shape.PCode == (byte)PCode.NewTree)
+ return;
+
// Even though we don't use child part state parameters for attachments any more, we still need to set
// these to zero since having them non-zero in rezzed scene objects will crash some clients. Even if
// we store them correctly, scene objects that we receive from elsewhere might not.
--
cgit v1.1
From 689969e143dad47fd9c257f9824ec71e3fafc8e6 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 13 Jun 2013 02:50:39 +0100
Subject: * This fixes having to select and deselect prim to get keyframemotion
to start running when pulled from data storage.
Conflicts:
OpenSim/Data/SQLite/SQLiteSimulationData.cs
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0ea4e09..a99261f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1072,6 +1072,11 @@ namespace OpenSim.Region.Framework.Scenes
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
+ if (part.KeyframeMotion != null)
+ {
+ part.KeyframeMotion.UpdateSceneObject(this);
+ }
+
if (Object.ReferenceEquals(part, m_rootPart))
continue;
--
cgit v1.1
From 8e9d6c6c56c7169adfa4b99c328933df4b68107b Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 23 Jun 2013 01:14:07 +0200
Subject: Fix prim locking to behave like SL
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a99261f..f306651 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3488,8 +3488,8 @@ namespace OpenSim.Region.Framework.Scenes
part.ClonePermissions(RootPart);
});
- uint lockMask = ~(uint)PermissionMask.Move;
- uint lockBit = RootPart.OwnerMask & (uint)PermissionMask.Move;
+ uint lockMask = ~(uint)(PermissionMask.Move | PermissionMask.Modify);
+ uint lockBit = RootPart.OwnerMask & (uint)(PermissionMask.Move | PermissionMask.Modify);
RootPart.OwnerMask = (RootPart.OwnerMask & lockBit) | ((newOwnerMask | foldedPerms) & lockMask);
RootPart.ScheduleFullUpdate();
}
--
cgit v1.1
From ddf67bf929fbc32d8319f777b248642b4da0305a Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 8 Sep 2013 19:41:51 +0200
Subject: Mono 2.0 fix - call ToArray() explicitly
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f306651..3e1dcaa 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -591,6 +591,7 @@ namespace OpenSim.Region.Framework.Scenes
avinfo.ParentID = av.ParentID;
avsToCross.Add(avinfo);
+ av.PrevSitOffset = av.OffsetPosition;
av.ParentID = 0;
}
--
cgit v1.1
From ece2d24077cacba677de5cebdd3a9da463306ecd Mon Sep 17 00:00:00 2001
From: teravus
Date: Sat, 5 Oct 2013 17:36:58 -0500
Subject: * Fixes cases where Last Attachment Point gets overwritten with 0
when it shouldn't * Fixes cases where Last Attachment Point doesn't get
written when it should. * Fixes Null Reference in BaseHttpServer when
shutting down, null path provided. * Drop then Wear retains Last Attachment
Point
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 6deb870..997a1be 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1667,7 +1667,8 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
if (avatar == null)
return;
-
+ m_rootPart.Shape.LastAttachPoint = m_rootPart.Shape.State;
+ m_rootPart.AttachedPos = m_rootPart.OffsetPosition;
avatar.RemoveAttachment(this);
Vector3 detachedpos = new Vector3(127f,127f,127f);
@@ -2107,6 +2108,7 @@ namespace OpenSim.Region.Framework.Scenes
if (RootPart.Shape.PCode == 9 && RootPart.Shape.State != 0)
{
+ RootPart.Shape.LastAttachPoint = RootPart.Shape.State;
RootPart.Shape.State = 0;
ScheduleGroupForFullUpdate();
}
--
cgit v1.1
From a30ad71651cb49720bf8b04e2d651bd28f5b8ea2 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 25 Mar 2014 03:17:44 +0100
Subject: Guard against Scene being null in attachments it the wearing avatar
is in the process of logging out.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 30 ++++++++++++----------
1 file changed, 16 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3e1dcaa..86f60bb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1886,25 +1886,27 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = parts[i];
- Scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
+ if (Scene != null)
{
- if (avatar.ParentID == LocalId)
- avatar.StandUp();
-
- if (!silent)
+ Scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
{
- part.ClearUpdateSchedule();
- if (part == m_rootPart)
+ if (avatar.ParentID == LocalId)
+ avatar.StandUp();
+
+ if (!silent)
{
- if (!IsAttachment
- || AttachedAvatar == avatar.ControllingClient.AgentId
- || !HasPrivateAttachmentPoint)
- avatar.ControllingClient.SendKillObject(m_regionHandle, new List { part.LocalId });
+ part.ClearUpdateSchedule();
+ if (part == m_rootPart)
+ {
+ if (!IsAttachment
+ || AttachedAvatar == avatar.ControllingClient.AgentId
+ || !HasPrivateAttachmentPoint)
+ avatar.ControllingClient.SendKillObject(m_regionHandle, new List { part.LocalId });
+ }
}
- }
- });
+ });
+ }
}
-
}
public void AddScriptLPS(int count)
--
cgit v1.1
From 0e4a9e35c75a466f4b98f1d4aa7d862e98da5e5d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 22 Jul 2014 04:10:51 +0100
Subject: bug fix. Child position got broken because first prim i parts array
may not be the root prim
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index cfa862e..745872a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -681,8 +681,13 @@ namespace OpenSim.Region.Framework.Scenes
bool triggerScriptEvent = m_rootPart.GroupPosition != val;
if (m_dupeInProgress)
triggerScriptEvent = false;
+ m_rootPart.GroupPosition = val;
+ if (triggerScriptEvent)
+ m_rootPart.TriggerScriptChangedEvent(Changed.POSITION);
foreach (SceneObjectPart part in parts)
{
+ if (part == m_rootPart)
+ continue;
part.GroupPosition = val;
if (triggerScriptEvent)
part.TriggerScriptChangedEvent(Changed.POSITION);
--
cgit v1.1
From 5269511339738b465938e5cfd3da12cfa0594e28 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 22 Jul 2014 14:31:47 +0100
Subject: dont try to cross with avatars on DIE_AT_EDGE or RETURN_AT_EDGE sog
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 180 +++++++++++----------
1 file changed, 96 insertions(+), 84 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 745872a..299effa 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -550,114 +550,126 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 newpos = Vector3.Zero;
OpenSim.Services.Interfaces.GridRegion destination = null;
- if (m_rootPart.KeyframeMotion != null)
- m_rootPart.KeyframeMotion.StartCrossingCheck();
-
- bool canCross = true;
- foreach (ScenePresence av in m_linkedAvatars)
+ if (m_rootPart.DIE_AT_EDGE || m_rootPart.RETURN_AT_EDGE)
{
- // We need to cross these agents. First, let's find
- // out if any of them can't cross for some reason.
- // We have to deny the crossing entirely if any
- // of them are banned. Alternatively, we could
- // unsit banned agents....
-
-
- // We set the avatar position as being the object
- // position to get the region to send to
- if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out x, out y, out version, out newpos)) == null)
- {
- canCross = false;
- break;
- }
-
- m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
+ // this should delete the grp in this case
+ m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
}
-
- if (canCross)
+ else
{
- // We unparent the SP quietly so that it won't
- // be made to stand up
+ if (m_rootPart.KeyframeMotion != null)
+ m_rootPart.KeyframeMotion.StartCrossingCheck();
- List avsToCross = new List();
+ bool canCross = true;
foreach (ScenePresence av in m_linkedAvatars)
{
- avtocrossInfo avinfo = new avtocrossInfo();
- SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID);
- if (parentPart != null)
- av.ParentUUID = parentPart.UUID;
+ // We need to cross these agents. First, let's find
+ // out if any of them can't cross for some reason.
+ // We have to deny the crossing entirely if any
+ // of them are banned. Alternatively, we could
+ // unsit banned agents....
- avinfo.av = av;
- avinfo.ParentID = av.ParentID;
- avsToCross.Add(avinfo);
- av.PrevSitOffset = av.OffsetPosition;
- av.ParentID = 0;
- }
+ // We set the avatar position as being the object
+ // position to get the region to send to
+ if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out x, out y, out version, out newpos)) == null)
+ {
+ canCross = false;
+ break;
+ }
- // m_linkedAvatars.Clear();
- m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
+ m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
+ }
- // Normalize
- if (val.X >= Constants.RegionSize)
- val.X -= Constants.RegionSize;
- if (val.Y >= Constants.RegionSize)
- val.Y -= Constants.RegionSize;
- if (val.X < 0)
- val.X += Constants.RegionSize;
- if (val.Y < 0)
- val.Y += Constants.RegionSize;
-
- // If it's deleted, crossing was successful
- if (IsDeleted)
+ if (canCross)
{
- // foreach (ScenePresence av in m_linkedAvatars)
- foreach (avtocrossInfo avinfo in avsToCross)
+ // We unparent the SP quietly so that it won't
+ // be made to stand up
+
+ List avsToCross = new List();
+
+ foreach (ScenePresence av in m_linkedAvatars)
{
- ScenePresence av = avinfo.av;
- if (!av.IsInTransit) // just in case...
- {
- m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
+ avtocrossInfo avinfo = new avtocrossInfo();
+ SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID);
+ if (parentPart != null)
+ av.ParentUUID = parentPart.UUID;
+
+ avinfo.av = av;
+ avinfo.ParentID = av.ParentID;
+ avsToCross.Add(avinfo);
- av.IsInTransit = true;
+ av.PrevSitOffset = av.OffsetPosition;
+ av.ParentID = 0;
+ }
- CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
- d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
+ // m_linkedAvatars.Clear();
+ m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
+
+ // Normalize
+ if (val.X >= Constants.RegionSize)
+ val.X -= Constants.RegionSize;
+ if (val.Y >= Constants.RegionSize)
+ val.Y -= Constants.RegionSize;
+ if (val.X < 0)
+ val.X += Constants.RegionSize;
+ if (val.Y < 0)
+ val.Y += Constants.RegionSize;
+
+ // If it's deleted, crossing was successful
+ if (IsDeleted)
+ {
+ // foreach (ScenePresence av in m_linkedAvatars)
+ foreach (avtocrossInfo avinfo in avsToCross)
+ {
+ ScenePresence av = avinfo.av;
+ if (!av.IsInTransit) // just in case...
+ {
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
+
+ av.IsInTransit = true;
+
+ CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
+ d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
+ }
+ else
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val);
}
- else
- m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val);
+ avsToCross.Clear();
+ return;
}
- avsToCross.Clear();
- return;
- }
- else // cross failed, put avas back ??
- {
- foreach (avtocrossInfo avinfo in avsToCross)
+ else // cross failed, put avas back ??
{
- ScenePresence av = avinfo.av;
- av.ParentUUID = UUID.Zero;
- av.ParentID = avinfo.ParentID;
-// m_linkedAvatars.Add(av);
+ foreach (avtocrossInfo avinfo in avsToCross)
+ {
+ ScenePresence av = avinfo.av;
+ av.ParentUUID = UUID.Zero;
+ av.ParentID = avinfo.ParentID;
+ // m_linkedAvatars.Add(av);
+ }
}
- }
- avsToCross.Clear();
+ avsToCross.Clear();
- }
- else
- {
- if (m_rootPart.KeyframeMotion != null)
- m_rootPart.KeyframeMotion.CrossingFailure();
+ }
+ // else
+ // we need to do this on all fails
- if (RootPart.PhysActor != null)
{
- RootPart.PhysActor.CrossingFailure();
+ if (m_rootPart.KeyframeMotion != null)
+ m_rootPart.KeyframeMotion.CrossingFailure();
+
+ if (RootPart.PhysActor != null)
+ {
+ RootPart.PhysActor.CrossingFailure();
+ }
}
+ Vector3 oldp = AbsolutePosition;
+ val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f);
+ val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
+ // dont crash land StarShips
+ // val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f);
}
- Vector3 oldp = AbsolutePosition;
- val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f);
- val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
- val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f);
}
}
--
cgit v1.1
From cf132430ae6d989412cccc0e9c8148798b1382d5 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 22 Jul 2014 14:50:17 +0100
Subject: tell scripts about positions changes after they are actually changed
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 28 ++++++++++++++--------
1 file changed, 18 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 299effa..48aacfe 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -687,22 +687,30 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- // Restuff the new GroupPosition into each SOP of the linkset.
- // This has the affect of resetting and tainting the physics actors.
- SceneObjectPart[] parts = m_parts.GetArray();
bool triggerScriptEvent = m_rootPart.GroupPosition != val;
- if (m_dupeInProgress)
+ if (m_dupeInProgress || IsDeleted)
triggerScriptEvent = false;
+
m_rootPart.GroupPosition = val;
- if (triggerScriptEvent)
- m_rootPart.TriggerScriptChangedEvent(Changed.POSITION);
+
+ // Restuff the new GroupPosition into each child SOP of the linkset.
+ // this is needed because physics may not have linksets but just loose SOPs in world
+
+ SceneObjectPart[] parts = m_parts.GetArray();
+
foreach (SceneObjectPart part in parts)
{
- if (part == m_rootPart)
- continue;
- part.GroupPosition = val;
- if (triggerScriptEvent)
+ if (part != m_rootPart)
+ part.GroupPosition = val;
+ }
+
+ // now that position is changed tell it to scripts
+ if (triggerScriptEvent)
+ {
+ foreach (SceneObjectPart part in parts)
+ {
part.TriggerScriptChangedEvent(Changed.POSITION);
+ }
}
/*
--
cgit v1.1
From f9fdf26ec37f9f7e0478deb6d9bfe3a3efcbc39e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 22 Jul 2014 15:13:37 +0100
Subject: make ResetChildPrimPhysicsPositions only do what it is supposed to do
and not what AbsolutePosition does
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 48aacfe..c7f4684 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1840,11 +1840,21 @@ namespace OpenSim.Region.Framework.Scenes
// Setting this SOG's absolute position also loops through and sets the positions
// of the SOP's in this SOG's linkset. This has the side affect of making sure
// the physics world matches the simulated world.
- AbsolutePosition = AbsolutePosition; // could someone in the know please explain how this works?
+ // AbsolutePosition = AbsolutePosition; // could someone in the know please explain how this works?
// teravus: AbsolutePosition is NOT a normal property!
// the code in the getter of AbsolutePosition is significantly different then the code in the setter!
// jhurliman: Then why is it a property instead of two methods?
+
+ // do only what is supposed to do
+ Vector3 groupPosition = m_rootPart.GroupPosition;
+ SceneObjectPart[] parts = m_parts.GetArray();
+
+ foreach (SceneObjectPart part in parts)
+ {
+ if (part != m_rootPart)
+ part.GroupPosition = groupPosition;
+ }
}
public UUID GetPartsFullID(uint localID)
--
cgit v1.1
From ed905418b3dc0a2ec569af610024b8c4fe7a0389 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 22 Jul 2014 15:47:42 +0100
Subject: consider that CrossPrimGroupIntoNewRegion removes DIE_AT_EDGE and
RETURN_AT_EDGE from simulation
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c7f4684..d4051c0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -554,6 +554,8 @@ namespace OpenSim.Region.Framework.Scenes
{
// this should delete the grp in this case
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
+ // actually assume this sog was removed from simulation
+ return;
}
else
{
--
cgit v1.1
From fe900b28c69ad0970c273ea25f4194c7f4456520 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 22 Jul 2014 15:56:20 +0100
Subject: CrossPrimGroupIntoNewRegion does keyframes and physics crossing
fails, so revert previus change assuming it didnt. remove a no longer needed
else {}
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 177 ++++++++++-----------
1 file changed, 86 insertions(+), 91 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d4051c0..4ac6743 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -557,121 +557,116 @@ namespace OpenSim.Region.Framework.Scenes
// actually assume this sog was removed from simulation
return;
}
- else
+
+ if (m_rootPart.KeyframeMotion != null)
+ m_rootPart.KeyframeMotion.StartCrossingCheck();
+
+ bool canCross = true;
+
+ foreach (ScenePresence av in m_linkedAvatars)
{
- if (m_rootPart.KeyframeMotion != null)
- m_rootPart.KeyframeMotion.StartCrossingCheck();
+ // We need to cross these agents. First, let's find
+ // out if any of them can't cross for some reason.
+ // We have to deny the crossing entirely if any
+ // of them are banned. Alternatively, we could
+ // unsit banned agents....
- bool canCross = true;
- foreach (ScenePresence av in m_linkedAvatars)
+ // We set the avatar position as being the object
+ // position to get the region to send to
+ if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out x, out y, out version, out newpos)) == null)
{
- // We need to cross these agents. First, let's find
- // out if any of them can't cross for some reason.
- // We have to deny the crossing entirely if any
- // of them are banned. Alternatively, we could
- // unsit banned agents....
+ canCross = false;
+ break;
+ }
+ m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
+ }
- // We set the avatar position as being the object
- // position to get the region to send to
- if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out x, out y, out version, out newpos)) == null)
- {
- canCross = false;
- break;
- }
+ if (canCross)
+ {
+ // We unparent the SP quietly so that it won't
+ // be made to stand up
- m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
- }
+ List avsToCross = new List();
- if (canCross)
+ foreach (ScenePresence av in m_linkedAvatars)
{
- // We unparent the SP quietly so that it won't
- // be made to stand up
+ avtocrossInfo avinfo = new avtocrossInfo();
+ SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID);
+ if (parentPart != null)
+ av.ParentUUID = parentPart.UUID;
- List avsToCross = new List();
+ avinfo.av = av;
+ avinfo.ParentID = av.ParentID;
+ avsToCross.Add(avinfo);
- foreach (ScenePresence av in m_linkedAvatars)
- {
- avtocrossInfo avinfo = new avtocrossInfo();
- SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID);
- if (parentPart != null)
- av.ParentUUID = parentPart.UUID;
-
- avinfo.av = av;
- avinfo.ParentID = av.ParentID;
- avsToCross.Add(avinfo);
+ av.PrevSitOffset = av.OffsetPosition;
+ av.ParentID = 0;
+ }
- av.PrevSitOffset = av.OffsetPosition;
- av.ParentID = 0;
- }
+ // m_linkedAvatars.Clear();
+ m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
- // m_linkedAvatars.Clear();
- m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
-
- // Normalize
- if (val.X >= Constants.RegionSize)
- val.X -= Constants.RegionSize;
- if (val.Y >= Constants.RegionSize)
- val.Y -= Constants.RegionSize;
- if (val.X < 0)
- val.X += Constants.RegionSize;
- if (val.Y < 0)
- val.Y += Constants.RegionSize;
-
- // If it's deleted, crossing was successful
- if (IsDeleted)
- {
- // foreach (ScenePresence av in m_linkedAvatars)
- foreach (avtocrossInfo avinfo in avsToCross)
- {
- ScenePresence av = avinfo.av;
- if (!av.IsInTransit) // just in case...
- {
- m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
-
- av.IsInTransit = true;
-
- CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
- d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
- }
- else
- m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val);
- }
- avsToCross.Clear();
- return;
- }
- else // cross failed, put avas back ??
+ // Normalize
+ if (val.X >= Constants.RegionSize)
+ val.X -= Constants.RegionSize;
+ if (val.Y >= Constants.RegionSize)
+ val.Y -= Constants.RegionSize;
+ if (val.X < 0)
+ val.X += Constants.RegionSize;
+ if (val.Y < 0)
+ val.Y += Constants.RegionSize;
+
+ // If it's deleted, crossing was successful
+ if (IsDeleted)
+ {
+ // foreach (ScenePresence av in m_linkedAvatars)
+ foreach (avtocrossInfo avinfo in avsToCross)
{
- foreach (avtocrossInfo avinfo in avsToCross)
+ ScenePresence av = avinfo.av;
+ if (!av.IsInTransit) // just in case...
{
- ScenePresence av = avinfo.av;
- av.ParentUUID = UUID.Zero;
- av.ParentID = avinfo.ParentID;
- // m_linkedAvatars.Add(av);
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
+
+ av.IsInTransit = true;
+
+ CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
+ d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
}
+ else
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val);
}
avsToCross.Clear();
-
+ return;
}
- // else
- // we need to do this on all fails
-
+ else // cross failed, put avas back ??
{
- if (m_rootPart.KeyframeMotion != null)
- m_rootPart.KeyframeMotion.CrossingFailure();
-
- if (RootPart.PhysActor != null)
+ foreach (avtocrossInfo avinfo in avsToCross)
{
- RootPart.PhysActor.CrossingFailure();
+ ScenePresence av = avinfo.av;
+ av.ParentUUID = UUID.Zero;
+ av.ParentID = avinfo.ParentID;
+ // m_linkedAvatars.Add(av);
}
}
- Vector3 oldp = AbsolutePosition;
- val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f);
- val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
- // dont crash land StarShips
- // val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f);
+ avsToCross.Clear();
+ }
+ else
+ {
+ if (m_rootPart.KeyframeMotion != null)
+ m_rootPart.KeyframeMotion.CrossingFailure();
+
+ if (RootPart.PhysActor != null)
+ {
+ RootPart.PhysActor.CrossingFailure();
+ }
}
+ Vector3 oldp = AbsolutePosition;
+ val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f);
+ val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
+ // dont crash land StarShips
+ // val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f);
}
}
--
cgit v1.1
From 43cf184603389d188bbbac14e5f14022be658a1e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sat, 26 Jul 2014 16:56:21 +0100
Subject: clear script controls on crossing (untested)(possible should be done
elsewhere/othe way)
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4ac6743..9527fa5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -761,6 +761,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (agent.ParentUUID != UUID.Zero)
{
+ agent.ClearControls();
agent.ParentPart = null;
// agent.ParentPosition = Vector3.Zero;
// agent.ParentUUID = UUID.Zero;
--
cgit v1.1
From c3b5a6c2abaa5f508344f75d338fc7ff1be08538 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 27 Jul 2014 08:18:27 +0100
Subject: change how sounds work. May be bad.. needs testing
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9527fa5..ba97c47 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -908,14 +908,14 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+ // PlaySoundMasterPrim no longer in use to remove
private SceneObjectPart m_PlaySoundMasterPrim = null;
public SceneObjectPart PlaySoundMasterPrim
{
get { return m_PlaySoundMasterPrim; }
set { m_PlaySoundMasterPrim = value; }
}
-
+ // PlaySoundSlavePrims no longer in use to remove
private List m_PlaySoundSlavePrims = new List();
public List PlaySoundSlavePrims
{
@@ -923,6 +923,7 @@ namespace OpenSim.Region.Framework.Scenes
set { m_PlaySoundSlavePrims = value; }
}
+ // LoopSoundMasterPrim no longer in use to remove
private SceneObjectPart m_LoopSoundMasterPrim = null;
public SceneObjectPart LoopSoundMasterPrim
{
@@ -930,6 +931,7 @@ namespace OpenSim.Region.Framework.Scenes
set { m_LoopSoundMasterPrim = value; }
}
+ // m_LoopSoundSlavePrims no longer in use to remove
private List m_LoopSoundSlavePrims = new List();
public List LoopSoundSlavePrims
{
--
cgit v1.1
From e296f25445ef5d0fc8d114aed6241da664c57b34 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 1 Aug 2014 19:52:55 +0100
Subject: sitting avatars hidding by their position. This is not as SL that
uses avatar sitting on root prim. All cases have good and bad situations,
this is simpler. Only SOG position changes triggers checks, rotation alone
will not. ( as happens in other cases ) (UNTESTED, as usual )
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ba97c47..28758a9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -701,6 +701,11 @@ namespace OpenSim.Region.Framework.Scenes
part.GroupPosition = val;
}
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ av.sitSOGmoved();
+ }
+
// now that position is changed tell it to scripts
if (triggerScriptEvent)
{
--
cgit v1.1
From ad6f9422792f981cf1c4b240a2a443075624b614 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Thu, 21 Aug 2014 06:11:19 +0100
Subject: add filter sog updates
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 28758a9..dd5ee65 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2636,6 +2636,16 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.UpdateFlag = UpdateRequired.TERSE;
}
+ if (IsAttachment)
+ {
+ ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
+ if (sp != null)
+ {
+ sp.SendAttachmentScheduleUpdate(this);
+ return;
+ }
+ }
+
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
@@ -2697,6 +2707,16 @@ namespace OpenSim.Region.Framework.Scenes
return;
// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
+
+ if (IsAttachment)
+ {
+ ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
+ if (sp != null)
+ {
+ sp.SendAttachmentUpdate(this,UpdateRequired.FULL);
+ return;
+ }
+ }
RootPart.SendFullUpdateToAllClients();
@@ -2720,6 +2740,16 @@ namespace OpenSim.Region.Framework.Scenes
if (IsDeleted)
return;
+ if (IsAttachment)
+ {
+ ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
+ if (sp != null)
+ {
+ sp.SendAttachmentUpdate(RootPart, UpdateRequired.TERSE);
+ return;
+ }
+ }
+
RootPart.SendTerseUpdateToAllClients();
}
@@ -2739,6 +2769,16 @@ namespace OpenSim.Region.Framework.Scenes
if (IsDeleted)
return;
+ if (IsAttachment)
+ {
+ ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
+ if (sp != null)
+ {
+ sp.SendAttachmentUpdate(this, UpdateRequired.TERSE);
+ return;
+ }
+ }
+
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
parts[i].SendTerseUpdateToAllClients();
--
cgit v1.1
From 0295e6822dd6408b6dc6580b4a7a92b0f057d4b8 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 22 Aug 2014 20:01:07 +0100
Subject: some cleanup ( well or not )
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index dd5ee65..d3dd5d7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2717,15 +2717,15 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
}
-
- RootPart.SendFullUpdateToAllClients();
+
+ RootPart.SendFullUpdateToAllClientsInternal();
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
if (part != RootPart)
- part.SendFullUpdateToAllClients();
+ part.SendFullUpdateToAllClientsInternal();
}
}
@@ -2740,16 +2740,6 @@ namespace OpenSim.Region.Framework.Scenes
if (IsDeleted)
return;
- if (IsAttachment)
- {
- ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
- if (sp != null)
- {
- sp.SendAttachmentUpdate(RootPart, UpdateRequired.TERSE);
- return;
- }
- }
-
RootPart.SendTerseUpdateToAllClients();
}
@@ -2781,7 +2771,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart[] parts = m_parts.GetArray();
for (int i = 0; i < parts.Length; i++)
- parts[i].SendTerseUpdateToAllClients();
+ parts[i].SendTerseUpdateToAllClientsInternal();
}
///
--
cgit v1.1
From 8e15d4ad57de6f2a0c900968ef778fba7cdced63 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 8 Sep 2014 23:58:49 +0100
Subject: limit number of prims on physical objects. Not all cases covered
still
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 46 +++++++++++++++++++++-
1 file changed, 44 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d3dd5d7..d4a563f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1712,7 +1712,9 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.SetParentLocalId(0);
AttachmentPoint = (byte)0;
// must check if buildind should be true or false here
- m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive,false);
+// m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive,false);
+ ApplyPhysics();
+
HasGroupChanged = true;
RootPart.Rezzed = DateTime.Now;
RootPart.RemFlag(PrimFlags.TemporaryOnRez);
@@ -2879,6 +2881,33 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
+ // physical prims count limit
+ // not very eficient :(
+
+ if (UsesPhysics && m_scene.m_linksetPhysCapacity > 0 && (PrimCount + objectGroup.PrimCount) >
+ m_scene.m_linksetPhysCapacity)
+ {
+ int cntr = 0;
+ foreach (SceneObjectPart part in Parts)
+ {
+ if (part.PhysicsShapeType != (byte)PhysicsShapeType.None)
+ cntr++;
+ }
+ foreach (SceneObjectPart part in objectGroup.Parts)
+ {
+ if (part.PhysicsShapeType != (byte)PhysicsShapeType.None)
+ cntr++;
+ }
+
+ if (cntr > m_scene.m_linksetPhysCapacity)
+ {
+ // cancel physics
+ RootPart.Flags &= ~PrimFlags.Physics;
+ ApplyPhysics();
+ }
+ }
+
+
// 'linkPart' == the root of the group being linked into this group
SceneObjectPart linkPart = objectGroup.m_rootPart;
@@ -3477,8 +3506,12 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart[] parts = m_parts.GetArray();
- if (Scene != null)
+ if (Scene != null && UsePhysics)
{
+ int maxprims = m_scene.m_linksetPhysCapacity;
+ bool checkShape = (maxprims > 0 &&
+ parts.Length > maxprims);
+
for (int i = 0; i < parts.Length; i++)
{
SceneObjectPart part = parts[i];
@@ -3489,6 +3522,15 @@ namespace OpenSim.Region.Framework.Scenes
UsePhysics = false; // Reset physics
break;
}
+
+ if (checkShape && part.PhysicsShapeType != (byte)PhysicsShapeType.None)
+ {
+ if (--maxprims < 0)
+ {
+ UsePhysics = false;
+ break;
+ }
+ }
}
}
--
cgit v1.1
From 51697944b62954ee94dd4da50dd37847535bdcb3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Tue, 9 Sep 2014 00:09:39 +0100
Subject: dont send fullObjectUpdate on deselect
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d4a563f..15349e3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -907,10 +907,10 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
IsSelected = partSelect;
- if (!IsAttachment)
- {
- ScheduleGroupForFullUpdate();
- }
+// if (!IsAttachment)
+// {
+// ScheduleGroupForFullUpdate();
+// }
}
}
// PlaySoundMasterPrim no longer in use to remove
--
cgit v1.1
From bcaf202e34ab058a049c921e1279793d61eef5ea Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 22 Sep 2014 13:59:23 +0100
Subject: update scenegraph group find by part information in sog link, so
script link functions do update that also.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 15349e3..b939b58 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2560,11 +2560,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{
- // give new ID to the new part, letting old keep original
- // SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
SceneObjectPart newPart = part.Copy(part.LocalId, OwnerID, GroupID, m_parts.Count, userExposed);
newPart.LocalId = m_scene.AllocateLocalId();
- newPart.SetParent(this);
AddPart(newPart);
@@ -2977,6 +2974,8 @@ namespace OpenSim.Region.Framework.Scenes
m_parts.Add(linkPart.UUID, linkPart);
linkPart.SetParent(this);
+ m_scene.updateScenePartGroup(linkPart, this);
+
linkPart.CreateSelected = true;
// let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
@@ -3238,9 +3237,12 @@ namespace OpenSim.Region.Framework.Scenes
part.SetParent(this);
part.ParentID = m_rootPart.LocalId;
m_parts.Add(part.UUID, part);
+
part.LinkNum = linkNum;
+ m_scene.updateScenePartGroup(part, this);
+
// Compute the new position of this SOP relative to the group position
part.OffsetPosition = newPos - AbsolutePosition;
--
cgit v1.1
From ea4a526095c7797e3863f540abb8d439dac3f9d3 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 22 Sep 2014 16:09:39 +0100
Subject: a few more changes on link/unlink
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b939b58..ca6f457 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -3177,9 +3177,6 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.AddNewSceneObject(objectGroup, true);
- if (sendEvents)
- linkPart.TriggerScriptChangedEvent(Changed.LINK);
-
linkPart.Rezzed = RootPart.Rezzed;
// When we delete a group, we currently have to force persist to the database if the object id has changed
@@ -3194,6 +3191,9 @@ namespace OpenSim.Region.Framework.Scenes
objectGroup.HasGroupChangedDueToDelink = true;
+ if (sendEvents)
+ linkPart.TriggerScriptChangedEvent(Changed.LINK);
+
return objectGroup;
}
--
cgit v1.1
From 79e47eb60e304fba1bdf04b57d374a843c250ef8 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 22 Sep 2014 23:32:55 +0100
Subject: some changes in link/unlink code, bypassing complex variables set
methods
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 50 +++++++++++-----------
1 file changed, 25 insertions(+), 25 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ca6f457..0eed64e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2929,22 +2929,24 @@ namespace OpenSim.Region.Framework.Scenes
// First move the new group's root SOP's position to be relative to ours
// (radams1: Not sure if the multiple setting of OffsetPosition is required. If not,
// this code can be reordered to have a more logical flow.)
- linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
+ linkPart.setOffsetPosition(linkPart.GroupPosition - AbsolutePosition);
// Assign the new parent to the root of the old group
linkPart.ParentID = m_rootPart.LocalId;
// Now that it's a child, it's group position is our root position
- linkPart.GroupPosition = AbsolutePosition;
+ linkPart.setGroupPosition(AbsolutePosition);
- Vector3 axPos = linkPart.OffsetPosition;
// Rotate the linking root SOP's position to be relative to the new root prim
Quaternion parentRot = m_rootPart.RotationOffset;
- axPos *= Quaternion.Conjugate(parentRot);
- linkPart.OffsetPosition = axPos;
// Make the linking root SOP's rotation relative to the new root prim
Quaternion oldRot = linkPart.RotationOffset;
Quaternion newRot = Quaternion.Conjugate(parentRot) * oldRot;
- linkPart.RotationOffset = newRot;
+ linkPart.setRotationOffset(newRot);
+
+ Vector3 axPos = linkPart.OffsetPosition;
+ axPos *= Quaternion.Conjugate(parentRot);
+ linkPart.OffsetPosition = axPos;
+
// If there is only one SOP in a SOG, the LinkNum is zero. I.e., not a linkset.
// Now that we know this SOG has at least two SOPs in it, the new root
@@ -3168,9 +3170,9 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition;
linkPart.OffsetPosition = new Vector3(0, 0, 0);
*/
- linkPart.GroupPosition = worldPos;
- linkPart.OffsetPosition = Vector3.Zero;
- linkPart.RotationOffset = worldRot;
+ linkPart.setGroupPosition(worldPos);
+ linkPart.setOffsetPosition(Vector3.Zero);
+ linkPart.setRotationOffset(worldRot);
// Create a new SOG to go around this unlinked and unattached SOP
SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart);
@@ -3221,15 +3223,14 @@ namespace OpenSim.Region.Framework.Scenes
Quaternion parentRot = oldGroupRotation;
Quaternion oldRot = part.RotationOffset;
- // Move our position to not be relative to the old parent
+ // Move our position in world
Vector3 axPos = part.OffsetPosition;
axPos *= parentRot;
- part.OffsetPosition = axPos;
- Vector3 newPos = oldGroupPosition + part.OffsetPosition;
- part.GroupPosition = newPos;
- part.OffsetPosition = Vector3.Zero;
+ Vector3 newPos = oldGroupPosition + axPos;
+ part.setGroupPosition(newPos);
+ part.setOffsetPosition(Vector3.Zero);
- // Compution our rotation to be not relative to the old parent
+ // Compution our rotation in world
Quaternion worldRot = parentRot * oldRot;
part.RotationOffset = worldRot;
@@ -3237,31 +3238,30 @@ namespace OpenSim.Region.Framework.Scenes
part.SetParent(this);
part.ParentID = m_rootPart.LocalId;
m_parts.Add(part.UUID, part);
-
part.LinkNum = linkNum;
m_scene.updateScenePartGroup(part, this);
// Compute the new position of this SOP relative to the group position
- part.OffsetPosition = newPos - AbsolutePosition;
+ part.setOffsetPosition(newPos - AbsolutePosition);
// (radams1 20120711: I don't know why part.OffsetPosition is set multiple times.
// It would have the affect of setting the physics engine position multiple
// times. In theory, that is not necessary but I don't have a good linkset
// test to know that cleaning up this code wouldn't break things.)
- // Rotate the relative position by the rotation of the group
- Quaternion rootRotation = m_rootPart.RotationOffset;
- Vector3 pos = part.OffsetPosition;
- pos *= Quaternion.Conjugate(rootRotation);
- part.OffsetPosition = pos;
-
// Compute the SOP's rotation relative to the rotation of the group.
parentRot = m_rootPart.RotationOffset;
+
oldRot = part.RotationOffset;
Quaternion newRot = Quaternion.Conjugate(parentRot) * worldRot;
- part.RotationOffset = newRot;
+ part.setRotationOffset(newRot);
+
+ Vector3 pos = part.OffsetPosition;
+ pos *= Quaternion.Conjugate(parentRot);
+
+ part.OffsetPosition = pos; // update position and orientation on physics also
// Since this SOP's state has changed, push those changes into the physics engine
// and the simulator.
@@ -3947,7 +3947,7 @@ namespace OpenSim.Region.Framework.Scenes
}
AbsolutePosition = newPos;
-
+
if (IsAttachment)
m_rootPart.AttachedPos = newPos;
--
cgit v1.1
From 4571e5bc3e284c916d1ae4dd6429b80a8028b8e0 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 24 Oct 2014 18:10:28 +0100
Subject: try to make SOG crossings full async. Simplify some borders
checking....
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 357 ++++++++++++---------
1 file changed, 199 insertions(+), 158 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0eed64e..a7e7294 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -516,6 +516,10 @@ namespace OpenSim.Region.Framework.Scenes
public uint ParentID;
}
+
+ public bool inTransit = false;
+ public delegate SceneObjectGroup SOGCrossDelegate(SceneObjectGroup sog,Vector3 pos);
+
///
/// The absolute position of this scene object in the scene
///
@@ -525,8 +529,8 @@ namespace OpenSim.Region.Framework.Scenes
set
{
Vector3 val = value;
-
- if (Scene != null)
+
+ if (Scene != null && !inTransit)
{
if (
// (Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E)
@@ -543,130 +547,10 @@ namespace OpenSim.Region.Framework.Scenes
|| Scene.TestBorderCross(val, Cardinals.S))
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{
- IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface();
- uint x = 0;
- uint y = 0;
- string version = String.Empty;
- Vector3 newpos = Vector3.Zero;
- OpenSim.Services.Interfaces.GridRegion destination = null;
-
- if (m_rootPart.DIE_AT_EDGE || m_rootPart.RETURN_AT_EDGE)
- {
- // this should delete the grp in this case
- m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
- // actually assume this sog was removed from simulation
- return;
- }
-
- if (m_rootPart.KeyframeMotion != null)
- m_rootPart.KeyframeMotion.StartCrossingCheck();
-
- bool canCross = true;
-
- foreach (ScenePresence av in m_linkedAvatars)
- {
- // We need to cross these agents. First, let's find
- // out if any of them can't cross for some reason.
- // We have to deny the crossing entirely if any
- // of them are banned. Alternatively, we could
- // unsit banned agents....
-
-
- // We set the avatar position as being the object
- // position to get the region to send to
- if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out x, out y, out version, out newpos)) == null)
- {
- canCross = false;
- break;
- }
-
- m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
- }
-
- if (canCross)
- {
- // We unparent the SP quietly so that it won't
- // be made to stand up
-
- List avsToCross = new List();
-
- foreach (ScenePresence av in m_linkedAvatars)
- {
- avtocrossInfo avinfo = new avtocrossInfo();
- SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID);
- if (parentPart != null)
- av.ParentUUID = parentPart.UUID;
-
- avinfo.av = av;
- avinfo.ParentID = av.ParentID;
- avsToCross.Add(avinfo);
-
- av.PrevSitOffset = av.OffsetPosition;
- av.ParentID = 0;
- }
-
- // m_linkedAvatars.Clear();
- m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
-
- // Normalize
- if (val.X >= Constants.RegionSize)
- val.X -= Constants.RegionSize;
- if (val.Y >= Constants.RegionSize)
- val.Y -= Constants.RegionSize;
- if (val.X < 0)
- val.X += Constants.RegionSize;
- if (val.Y < 0)
- val.Y += Constants.RegionSize;
-
- // If it's deleted, crossing was successful
- if (IsDeleted)
- {
- // foreach (ScenePresence av in m_linkedAvatars)
- foreach (avtocrossInfo avinfo in avsToCross)
- {
- ScenePresence av = avinfo.av;
- if (!av.IsInTransit) // just in case...
- {
- m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
-
- av.IsInTransit = true;
-
- CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
- d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
- }
- else
- m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val);
- }
- avsToCross.Clear();
- return;
- }
- else // cross failed, put avas back ??
- {
- foreach (avtocrossInfo avinfo in avsToCross)
- {
- ScenePresence av = avinfo.av;
- av.ParentUUID = UUID.Zero;
- av.ParentID = avinfo.ParentID;
- // m_linkedAvatars.Add(av);
- }
- }
- avsToCross.Clear();
- }
- else
- {
- if (m_rootPart.KeyframeMotion != null)
- m_rootPart.KeyframeMotion.CrossingFailure();
-
- if (RootPart.PhysActor != null)
- {
- RootPart.PhysActor.CrossingFailure();
- }
- }
- Vector3 oldp = AbsolutePosition;
- val.X = Util.Clamp(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f);
- val.Y = Util.Clamp(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
- // dont crash land StarShips
- // val.Z = Util.Clamp(oldp.Z, 0.5f, 4096.0f);
+ inTransit = true;
+ SOGCrossDelegate d = CrossAsync;
+ d.BeginInvoke(this, val, CrossAsyncCompleted, d);
+ return;
}
}
@@ -714,46 +598,197 @@ namespace OpenSim.Region.Framework.Scenes
part.TriggerScriptChangedEvent(Changed.POSITION);
}
}
+
+ Scene.EventManager.TriggerParcelPrimCountTainted();
+ }
+ }
-/*
- This seems not needed and should not be needed:
- sp absolute position depends on sit part absolute position fixed above.
- sp ParentPosition is not used anywhere.
- Since presence is sitting, viewer considers it 'linked' to root prim, so it will move/rotate it
- Sending a extra packet with avatar position is not only bandwidth waste, but may cause jitter in viewers due to UPD nature.
-
- if (!m_dupeInProgress)
+ public SceneObjectGroup CrossAsync(SceneObjectGroup sog, Vector3 val)
+ {
+ Scene sogScene = sog.m_scene;
+ IEntityTransferModule entityTransfer = sogScene.RequestModuleInterface();
+
+ Vector3 newpos = Vector3.Zero;
+ OpenSim.Services.Interfaces.GridRegion destination = null;
+
+ if (sog.RootPart.DIE_AT_EDGE)
+ {
+ try
+ {
+ sogScene.DeleteSceneObject(sog, false);
+ }
+ catch (Exception)
+ {
+ m_log.Warn("[SCENE]: exception when trying to remove the prim that crossed the border.");
+ }
+ return sog;
+ }
+
+ if (sog.RootPart.RETURN_AT_EDGE)
+ {
+ // We remove the object here
+ try
+ {
+ List localIDs = new List();
+ localIDs.Add(sog.RootPart.LocalId);
+ sogScene.AddReturn(sog.OwnerID, sog.Name, sog.AbsolutePosition,
+ "Returned at region cross");
+ sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero);
+ }
+ catch (Exception)
+ {
+ m_log.Warn("[SCENE]: exception when trying to return the prim that crossed the border.");
+ }
+ return sog;
+ }
+
+ if (sog.m_rootPart.KeyframeMotion != null)
+ sog.m_rootPart.KeyframeMotion.StartCrossingCheck();
+
+ if (entityTransfer == null)
+ return sog;
+
+ destination = entityTransfer.GetObjectDestination(sog, val, out newpos);
+ if (destination == null)
+ return sog;
+
+ if (sog.m_linkedAvatars.Count == 0)
+ {
+ entityTransfer.CrossPrimGroupIntoNewRegion(destination, newpos, sog, true);
+ return sog;
+ }
+
+ string reason = String.Empty;
+ string version = String.Empty;
+
+ foreach (ScenePresence av in sog.m_linkedAvatars)
+ {
+ // We need to cross these agents. First, let's find
+ // out if any of them can't cross for some reason.
+ // We have to deny the crossing entirely if any
+ // of them are banned. Alternatively, we could
+ // unsit banned agents....
+
+ // We set the avatar position as being the object
+ // position to get the region to send to
+ if(!entityTransfer.checkAgentAccessToRegion(av, destination, newpos, out version, out reason))
+ {
+ return sog;
+ }
+ m_log.DebugFormat("[SCENE OBJECT]: Avatar {0} needs to be crossed to {1}", av.Name, destination.RegionName);
+ }
+
+ // We unparent the SP quietly so that it won't
+ // be made to stand up
+
+ List avsToCross = new List();
+
+ foreach (ScenePresence av in sog.m_linkedAvatars)
+ {
+ avtocrossInfo avinfo = new avtocrossInfo();
+ SceneObjectPart parentPart = sogScene.GetSceneObjectPart(av.ParentID);
+ if (parentPart != null)
+ av.ParentUUID = parentPart.UUID;
+
+ avinfo.av = av;
+ avinfo.ParentID = av.ParentID;
+ avsToCross.Add(avinfo);
+
+ av.PrevSitOffset = av.OffsetPosition;
+ av.ParentID = 0;
+ }
+
+ if (entityTransfer.CrossPrimGroupIntoNewRegion(destination, newpos, sog, true))
+ {
+ foreach (avtocrossInfo avinfo in avsToCross)
{
- foreach (ScenePresence av in m_linkedAvatars)
+ ScenePresence av = avinfo.av;
+ if (!av.IsInTransit) // just in case...
{
- SceneObjectPart p = m_scene.GetSceneObjectPart(av.ParentID);
- if (p != null && m_parts.TryGetValue(p.UUID, out p))
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val);
+
+ av.IsInTransit = true;
+
+// CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
+// d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
+ entityTransfer.CrossAgentToNewRegionAsync(av, newpos, destination, av.Flying, version);
+ if(av.IsChildAgent)
{
- Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
- av.AbsolutePosition += offset;
-// av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
- av.SendAvatarDataToAllAgents();
+ if (av.ParentUUID != UUID.Zero)
+ {
+ av.ClearControls();
+ av.ParentPart = null;
+ }
}
+ av.ParentUUID = UUID.Zero;
+ // In any case
+ av.IsInTransit = false;
+
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} completed.", av.Firstname, av.Lastname);
}
+ else
+ m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar already in transit {0} to {1}", av.Name, val);
+ }
+ avsToCross.Clear();
+ return sog;
+ }
+ else // cross failed, put avas back ??
+ {
+ foreach (avtocrossInfo avinfo in avsToCross)
+ {
+ ScenePresence av = avinfo.av;
+ av.ParentUUID = UUID.Zero;
+ av.ParentID = avinfo.ParentID;
}
-*/
- //if (m_rootPart.PhysActor != null)
- //{
- //m_rootPart.PhysActor.Position =
- //new PhysicsVector(m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y,
- //m_rootPart.GroupPosition.Z);
- //m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
- //}
-
- if (Scene != null)
- Scene.EventManager.TriggerParcelPrimCountTainted();
}
+ avsToCross.Clear();
+
+ return sog;
}
- public override Vector3 Velocity
+ public void CrossAsyncCompleted(IAsyncResult iar)
{
- get { return RootPart.Velocity; }
- set { RootPart.Velocity = value; }
+ SOGCrossDelegate icon = (SOGCrossDelegate)iar.AsyncState;
+ SceneObjectGroup sog = icon.EndInvoke(iar);
+
+ if (sog.IsDeleted)
+ {
+ sog.inTransit = false; // just in case...
+ }
+ else
+ {
+ SceneObjectPart rootp = sog.m_rootPart;
+ Vector3 oldp = rootp.GroupPosition;
+ oldp.X = Util.Clamp(oldp.X, 0.5f, sog.m_scene.RegionInfo.RegionSizeX - 0.5f);
+ oldp.Y = Util.Clamp(oldp.Y, 0.5f, sog.m_scene.RegionInfo.RegionSizeY - 0.5f);
+ rootp.GroupPosition = oldp;
+
+ SceneObjectPart[] parts = sog.m_parts.GetArray();
+
+ foreach (SceneObjectPart part in parts)
+ {
+ if (part != rootp)
+ part.GroupPosition = oldp;
+ }
+
+ foreach (ScenePresence av in sog.m_linkedAvatars)
+ {
+ av.sitSOGmoved();
+ }
+
+ sog.Velocity = Vector3.Zero;
+
+ if (sog.m_rootPart.KeyframeMotion != null)
+ sog.m_rootPart.KeyframeMotion.CrossingFailure();
+
+ if (sog.RootPart.PhysActor != null)
+ {
+ sog.RootPart.PhysActor.CrossingFailure();
+ }
+
+ sog.inTransit = false;
+ sog.ScheduleGroupForFullUpdate();
+ }
}
private void CrossAgentToNewRegionCompleted(IAsyncResult iar)
@@ -784,6 +819,12 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[SCENE OBJECT]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
}
+ public override Vector3 Velocity
+ {
+ get { return RootPart.Velocity; }
+ set { RootPart.Velocity = value; }
+ }
+
public override uint LocalId
{
get { return m_rootPart.LocalId; }
@@ -2620,7 +2661,7 @@ namespace OpenSim.Region.Framework.Scenes
// an object has been deleted from a scene before update was processed.
// A more fundamental overhaul of the update mechanism is required to eliminate all
// the race conditions.
- if (IsDeleted)
+ if (IsDeleted || inTransit)
return;
// Even temporary objects take part in physics (e.g. temp-on-rez bullets)
@@ -2736,7 +2777,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void SendGroupRootTerseUpdate()
{
- if (IsDeleted)
+ if (IsDeleted || inTransit)
return;
RootPart.SendTerseUpdateToAllClients();
@@ -2755,7 +2796,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void SendGroupTerseUpdate()
{
- if (IsDeleted)
+ if (IsDeleted || inTransit)
return;
if (IsAttachment)
--
cgit v1.1
From 16608ffb01e5eeda3f2122c35d288148c9bed8ca Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 24 Oct 2014 21:51:38 +0100
Subject: don't backup in transit SOGs
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a7e7294..a1cdfa5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2115,7 +2115,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
- if (IsDeleted || UUID == UUID.Zero)
+ if (IsDeleted || inTransit || UUID == UUID.Zero)
{
// m_log.DebugFormat(
// "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID);
--
cgit v1.1
From 639f128d2cace3a8efd10ffe9b9eba4d85ee7b1e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 26 Oct 2014 01:27:43 +0100
Subject: some cleanup, localID coerence fix..
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 34 +++++-----------------
1 file changed, 7 insertions(+), 27 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a1cdfa5..dea8f3e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2274,28 +2274,8 @@ namespace OpenSim.Region.Framework.Scenes
// new group as no sitting avatars
dupe.m_linkedAvatars = new List();
-
- // Warning, The following code related to previousAttachmentStatus is needed so that clones of
- // attachments do not bordercross while they're being duplicated. This is hacktastic!
- // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
- // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
- // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
- // then restore it's attachment state
-
- // This is only necessary when userExposed is false!
-
- bool previousAttachmentStatus = dupe.IsAttachment;
-
- if (!userExposed)
- dupe.IsAttachment = true;
-
dupe.m_sittingAvatars = new List();
- if (!userExposed)
- {
- dupe.IsAttachment = previousAttachmentStatus;
- }
-
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
@@ -2318,7 +2298,7 @@ namespace OpenSim.Region.Framework.Scenes
{
newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
newPart.LinkNum = part.LinkNum;
- if (userExposed)
+// if (userExposed)
newPart.ParentID = dupe.m_rootPart.LocalId;
}
else
@@ -2379,10 +2359,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{
- // SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed));
- // give newpart a new local ID lettng old part keep same
- SceneObjectPart newpart = part.Copy(part.LocalId, OwnerID, GroupID, 0, userExposed);
- newpart.LocalId = m_scene.AllocateLocalId();
+ SceneObjectPart newpart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed);
+// SceneObjectPart newpart = part.Copy(part.LocalId, OwnerID, GroupID, 0, userExposed);
+// newpart.LocalId = m_scene.AllocateLocalId();
SetRootPart(newpart);
if (userExposed)
@@ -2601,8 +2580,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{
- SceneObjectPart newPart = part.Copy(part.LocalId, OwnerID, GroupID, m_parts.Count, userExposed);
- newPart.LocalId = m_scene.AllocateLocalId();
+ SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
+// SceneObjectPart newPart = part.Copy(part.LocalId, OwnerID, GroupID, m_parts.Count, userExposed);
+// newPart.LocalId = m_scene.AllocateLocalId();
AddPart(newPart);
--
cgit v1.1
From 139044fc79844b455574fd0be7baa1bab9bf78d9 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 26 Oct 2014 01:25:28 +0000
Subject: keep intransit flag even if deleted, dont set sog position if in
transit
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 79 +++++++++++-----------
1 file changed, 38 insertions(+), 41 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index dea8f3e..9f2a689 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -529,7 +529,7 @@ namespace OpenSim.Region.Framework.Scenes
set
{
Vector3 val = value;
-
+
if (Scene != null && !inTransit)
{
if (
@@ -552,54 +552,55 @@ namespace OpenSim.Region.Framework.Scenes
d.BeginInvoke(this, val, CrossAsyncCompleted, d);
return;
}
- }
- if (RootPart.GetStatusSandbox())
- {
- if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
+
+ if (RootPart.GetStatusSandbox())
{
- RootPart.ScriptSetPhysicsStatus(false);
-
- if (Scene != null)
- Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
- ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
-
- return;
- }
- }
+ if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
+ {
+ RootPart.ScriptSetPhysicsStatus(false);
- bool triggerScriptEvent = m_rootPart.GroupPosition != val;
- if (m_dupeInProgress || IsDeleted)
- triggerScriptEvent = false;
+ if (Scene != null)
+ Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
+ ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
- m_rootPart.GroupPosition = val;
+ return;
+ }
+ }
- // Restuff the new GroupPosition into each child SOP of the linkset.
- // this is needed because physics may not have linksets but just loose SOPs in world
+ bool triggerScriptEvent = m_rootPart.GroupPosition != val;
+ if (m_dupeInProgress || IsDeleted)
+ triggerScriptEvent = false;
- SceneObjectPart[] parts = m_parts.GetArray();
+ m_rootPart.GroupPosition = val;
- foreach (SceneObjectPart part in parts)
- {
- if (part != m_rootPart)
- part.GroupPosition = val;
- }
+ // Restuff the new GroupPosition into each child SOP of the linkset.
+ // this is needed because physics may not have linksets but just loose SOPs in world
- foreach (ScenePresence av in m_linkedAvatars)
- {
- av.sitSOGmoved();
- }
+ SceneObjectPart[] parts = m_parts.GetArray();
- // now that position is changed tell it to scripts
- if (triggerScriptEvent)
- {
foreach (SceneObjectPart part in parts)
{
- part.TriggerScriptChangedEvent(Changed.POSITION);
+ if (part != m_rootPart)
+ part.GroupPosition = val;
}
+
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ av.sitSOGmoved();
+ }
+
+ // now that position is changed tell it to scripts
+ if (triggerScriptEvent)
+ {
+ foreach (SceneObjectPart part in parts)
+ {
+ part.TriggerScriptChangedEvent(Changed.POSITION);
+ }
+ }
+
+ Scene.EventManager.TriggerParcelPrimCountTainted();
}
-
- Scene.EventManager.TriggerParcelPrimCountTainted();
}
}
@@ -751,11 +752,7 @@ namespace OpenSim.Region.Framework.Scenes
SOGCrossDelegate icon = (SOGCrossDelegate)iar.AsyncState;
SceneObjectGroup sog = icon.EndInvoke(iar);
- if (sog.IsDeleted)
- {
- sog.inTransit = false; // just in case...
- }
- else
+ if (!sog.IsDeleted)
{
SceneObjectPart rootp = sog.m_rootPart;
Vector3 oldp = rootp.GroupPosition;
--
cgit v1.1
From 6600282fe99fc1a3c7ff7b80f8aedbac8fe69015 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 26 Oct 2014 10:08:13 +0000
Subject: another try to prevent double crossing
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 98 ++++++++++------------
1 file changed, 46 insertions(+), 52 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9f2a689..b9b5621 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -530,77 +530,71 @@ namespace OpenSim.Region.Framework.Scenes
{
Vector3 val = value;
- if (Scene != null && !inTransit)
+ if (!IsAttachmentCheckFull() && !Scene.LoadingPrims &&
+ ( Scene.TestBorderCross(val, Cardinals.E) ||
+ Scene.TestBorderCross(val, Cardinals.W) ||
+ Scene.TestBorderCross(val, Cardinals.N) ||
+ Scene.TestBorderCross(val, Cardinals.S))
+ )
{
- if (
- // (Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E)
- // || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
- // || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N)
- // || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
- // Experimental change for better border crossings.
- // The commented out original lines above would, it seems, trigger
- // a border crossing a little early or late depending on which
- // direction the object was moving.
- (Scene.TestBorderCross(val, Cardinals.E)
- || Scene.TestBorderCross(val, Cardinals.W)
- || Scene.TestBorderCross(val, Cardinals.N)
- || Scene.TestBorderCross(val, Cardinals.S))
- && !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
+ lock (m_parts)
{
- inTransit = true;
- SOGCrossDelegate d = CrossAsync;
- d.BeginInvoke(this, val, CrossAsyncCompleted, d);
+ if (!inTransit)
+ {
+ inTransit = true;
+ SOGCrossDelegate d = CrossAsync;
+ d.BeginInvoke(this, val, CrossAsyncCompleted, d);
+ }
return;
}
+ }
-
- if (RootPart.GetStatusSandbox())
+ if (RootPart.GetStatusSandbox())
+ {
+ if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
{
- if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
- {
- RootPart.ScriptSetPhysicsStatus(false);
+ RootPart.ScriptSetPhysicsStatus(false);
- if (Scene != null)
- Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
- ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
+ if (Scene != null)
+ Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
+ ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
- return;
- }
+ return;
}
+ }
- bool triggerScriptEvent = m_rootPart.GroupPosition != val;
- if (m_dupeInProgress || IsDeleted)
- triggerScriptEvent = false;
+ bool triggerScriptEvent = m_rootPart.GroupPosition != val;
+ if (m_dupeInProgress || IsDeleted)
+ triggerScriptEvent = false;
- m_rootPart.GroupPosition = val;
+ m_rootPart.GroupPosition = val;
- // Restuff the new GroupPosition into each child SOP of the linkset.
- // this is needed because physics may not have linksets but just loose SOPs in world
+ // Restuff the new GroupPosition into each child SOP of the linkset.
+ // this is needed because physics may not have linksets but just loose SOPs in world
- SceneObjectPart[] parts = m_parts.GetArray();
+ SceneObjectPart[] parts = m_parts.GetArray();
- foreach (SceneObjectPart part in parts)
- {
- if (part != m_rootPart)
- part.GroupPosition = val;
- }
+ foreach (SceneObjectPart part in parts)
+ {
+ if (part != m_rootPart)
+ part.GroupPosition = val;
+ }
- foreach (ScenePresence av in m_linkedAvatars)
- {
- av.sitSOGmoved();
- }
+ foreach (ScenePresence av in m_linkedAvatars)
+ {
+ av.sitSOGmoved();
+ }
- // now that position is changed tell it to scripts
- if (triggerScriptEvent)
+ // now that position is changed tell it to scripts
+ if (triggerScriptEvent)
+ {
+ foreach (SceneObjectPart part in parts)
{
- foreach (SceneObjectPart part in parts)
- {
- part.TriggerScriptChangedEvent(Changed.POSITION);
- }
+ part.TriggerScriptChangedEvent(Changed.POSITION);
}
-
- Scene.EventManager.TriggerParcelPrimCountTainted();
}
+
+ Scene.EventManager.TriggerParcelPrimCountTainted();
}
}
--
cgit v1.1
From cfc8de096b969633775763051a7d9681b6f2ff77 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 26 Oct 2014 10:48:53 +0000
Subject: remove lock that did nothing, DEBUG disable
TriggerOnSceneObjectPreSave
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index b9b5621..f0d5d28 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -537,8 +537,6 @@ namespace OpenSim.Region.Framework.Scenes
Scene.TestBorderCross(val, Cardinals.S))
)
{
- lock (m_parts)
- {
if (!inTransit)
{
inTransit = true;
@@ -546,7 +544,6 @@ namespace OpenSim.Region.Framework.Scenes
d.BeginInvoke(this, val, CrossAsyncCompleted, d);
}
return;
- }
}
if (RootPart.GetStatusSandbox())
@@ -2191,7 +2188,9 @@ namespace OpenSim.Region.Framework.Scenes
HasGroupChanged = false;
HasGroupChangedDueToDelink = false;
- m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
+
+// DEBUG
+// m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
/*
backup_group.ForEachPart(delegate(SceneObjectPart part)
{
--
cgit v1.1
From b43ce909aa1bf8be0136b3b7325c9be84939db32 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 26 Oct 2014 11:28:24 +0000
Subject: Debug... ( restored TriggerOnSceneObjectPreSave)
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f0d5d28..25538de 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2187,20 +2187,16 @@ namespace OpenSim.Region.Framework.Scenes
backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem;
HasGroupChanged = false;
HasGroupChangedDueToDelink = false;
+// debug
+ if (RootPart.KeyframeMotion != null)
+ {
+ m_log.DebugFormat(
+ "[BACKUP]: test prim {0} {1}, intransit = {2}",
+ Name, UUID, inTransit);
+ }
+ m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
-// DEBUG
-// m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
-/*
- backup_group.ForEachPart(delegate(SceneObjectPart part)
- {
- if (part.KeyframeMotion != null)
- {
- part.KeyframeMotion = KeyframeMotion.FromData(backup_group, part.KeyframeMotion.Serialize());
-// part.KeyframeMotion.UpdateSceneObject(this);
- }
- });
-*/
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
backup_group.ForEachPart(delegate(SceneObjectPart part)
@@ -2262,6 +2258,8 @@ namespace OpenSim.Region.Framework.Scenes
dupe.m_isBackedUp = false;
dupe.m_parts = new MapAndArray();
+ dupe.inTransit = inTransit; // this shouldn't be needed TEST
+
// new group as no sitting avatars
dupe.m_linkedAvatars = new List();
dupe.m_sittingAvatars = new List();
--
cgit v1.1
From b07ea475bf0bce2bcd60d7444245e185af2e5740 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 26 Oct 2014 12:30:11 +0000
Subject: delete keyframes on temporary backup group
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++++++++
1 file changed, 8 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 25538de..01c38b9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2202,8 +2202,16 @@ namespace OpenSim.Region.Framework.Scenes
backup_group.ForEachPart(delegate(SceneObjectPart part)
{
part.Inventory.ProcessInventoryBackup(datastore);
+
+ // take the change to delete things
+ if(part.KeyframeMotion != null)
+ {
+ part.KeyframeMotion.Delete();
+ part.KeyframeMotion = null;
+ }
});
+
backup_group = null;
}
// else
--
cgit v1.1
From bc4d0179b31a3c8778477f97d618ba779638f3f0 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Sun, 26 Oct 2014 12:38:22 +0000
Subject: remove debug message
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 -------
1 file changed, 7 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 01c38b9..0e2e3c7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2187,13 +2187,6 @@ namespace OpenSim.Region.Framework.Scenes
backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem;
HasGroupChanged = false;
HasGroupChangedDueToDelink = false;
-// debug
- if (RootPart.KeyframeMotion != null)
- {
- m_log.DebugFormat(
- "[BACKUP]: test prim {0} {1}, intransit = {2}",
- Name, UUID, inTransit);
- }
m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
--
cgit v1.1
From 37a5eab0f5eb51204a3d6bc0bbaa40a2b9afc989 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 3 Nov 2014 00:03:53 +0000
Subject: BUG FIX prevent references to null scene (as happens on mesh
uploads)
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 27 ++++++++++++----------
1 file changed, 15 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0e2e3c7..9a2707b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -529,21 +529,21 @@ namespace OpenSim.Region.Framework.Scenes
set
{
Vector3 val = value;
-
- if (!IsAttachmentCheckFull() && !Scene.LoadingPrims &&
- ( Scene.TestBorderCross(val, Cardinals.E) ||
+ if (Scene != null && !IsAttachmentCheckFull()
+ && !Scene.LoadingPrims &&
+ (Scene.TestBorderCross(val, Cardinals.E) ||
Scene.TestBorderCross(val, Cardinals.W) ||
Scene.TestBorderCross(val, Cardinals.N) ||
Scene.TestBorderCross(val, Cardinals.S))
)
{
- if (!inTransit)
- {
- inTransit = true;
- SOGCrossDelegate d = CrossAsync;
- d.BeginInvoke(this, val, CrossAsyncCompleted, d);
- }
- return;
+ if (!inTransit)
+ {
+ inTransit = true;
+ SOGCrossDelegate d = CrossAsync;
+ d.BeginInvoke(this, val, CrossAsyncCompleted, d);
+ }
+ return;
}
if (RootPart.GetStatusSandbox())
@@ -582,6 +582,7 @@ namespace OpenSim.Region.Framework.Scenes
av.sitSOGmoved();
}
+
// now that position is changed tell it to scripts
if (triggerScriptEvent)
{
@@ -591,7 +592,9 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- Scene.EventManager.TriggerParcelPrimCountTainted();
+ if (Scene != null)
+ Scene.EventManager.TriggerParcelPrimCountTainted();
+
}
}
@@ -789,7 +792,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (agent.ParentUUID != UUID.Zero)
{
- agent.ClearControls();
+ agent.HandleForceReleaseControls(agent.ControllingClient,agent.UUID);
agent.ParentPart = null;
// agent.ParentPosition = Vector3.Zero;
// agent.ParentUUID = UUID.Zero;
--
cgit v1.1
From 6bebb9206cc0ec966f75ab52c76c66b4546d730f Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 19 Nov 2014 20:11:16 +0000
Subject: fix stopMoveToTarget in attachments case ( similar to core fix)
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9a2707b..89c7a1a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2468,12 +2468,23 @@ namespace OpenSim.Region.Framework.Scenes
public void stopMoveToTarget()
{
- PhysicsActor pa = RootPart.PhysActor;
+ if (IsAttachment)
+ {
+ ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
+ if (avatar != null)
+ {
+ avatar.ResetMoveToTarget();
+ }
+ }
+ else
+ {
+ PhysicsActor pa = RootPart.PhysActor;
- if (pa != null)
- pa.PIDActive = false;
+ if (pa != null)
+ pa.PIDActive = false;
- RootPart.ScheduleTerseUpdate(); // send a stop information
+ RootPart.ScheduleTerseUpdate(); // send a stop information
+ }
}
public void rotLookAt(Quaternion target, float strength, float damping)
--
cgit v1.1
From 9f18e3ba80a6469b7ff03c7cca595a0a3b999592 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Sun, 22 Mar 2015 21:53:02 -0700
Subject: Varregion: first cut at removing Border class checks for region
crossings. Added Scene.PositionIsInCurrentRegion(pos) to sense when new
position needs some crossing work. Many changes made to EntityTransferModule
to accomodate new crossing sense logic.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 89c7a1a..a99e469 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -529,12 +529,10 @@ namespace OpenSim.Region.Framework.Scenes
set
{
Vector3 val = value;
- if (Scene != null && !IsAttachmentCheckFull()
- && !Scene.LoadingPrims &&
- (Scene.TestBorderCross(val, Cardinals.E) ||
- Scene.TestBorderCross(val, Cardinals.W) ||
- Scene.TestBorderCross(val, Cardinals.N) ||
- Scene.TestBorderCross(val, Cardinals.S))
+ if (Scene != null
+ && Scene.PositionIsInCurrentRegion(val)
+ && !IsAttachmentCheckFull()
+ && !Scene.LoadingPrims
)
{
if (!inTransit)
--
cgit v1.1
From 07dead7dcb8b0f2a27a50748e4a460d9669903fc Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Sun, 29 Mar 2015 14:25:12 -0700
Subject: varregion: any conversions of use of Constants.RegionSize converted
into Util.cs routines to convert region coords to and from world coords or
handles.
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index a99e469..cb2f377 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -412,7 +412,7 @@ namespace OpenSim.Region.Framework.Scenes
{
get
{
- Vector3 minScale = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionSize);
+ Vector3 minScale = new Vector3(Constants.MaximumRegionSize, Constants.MaximumRegionSize, Constants.MaximumRegionSize);
Vector3 maxScale = Vector3.Zero;
Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
--
cgit v1.1
From d2776ec64504769d69b7f9e9c781b5c0a28b224d Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 19 Aug 2015 17:14:29 +0100
Subject: funny bug
---
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index cb2f377..1bb5854 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -530,7 +530,7 @@ namespace OpenSim.Region.Framework.Scenes
{
Vector3 val = value;
if (Scene != null
- && Scene.PositionIsInCurrentRegion(val)
+ && !Scene.PositionIsInCurrentRegion(val)
&& !IsAttachmentCheckFull()
&& !Scene.LoadingPrims
)
--
cgit v1.1