From ef4122213c440c55d32c097c08e52170f4b4346a Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Mon, 6 Aug 2012 15:35:40 +0100
Subject: enables configurable minimum sizes for physical & non-physical prims
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4c87639..cd75224 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2368,17 +2368,16 @@ namespace OpenSim.Region.Framework.Scenes
///
public void Resize(Vector3 scale)
{
- scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxNonphys);
- scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxNonphys);
- scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxNonphys);
+ scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X));
+ scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y));
+ scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z));
PhysicsActor pa = PhysActor;
-
if (pa != null && pa.IsPhysical)
{
- scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxPhys);
- scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxPhys);
- scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxPhys);
+ scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X));
+ scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y));
+ scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z));
}
// m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale);
--
cgit v1.1
From 57a98796693cdd34efefbc9235b5d0aa765db095 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Wed, 15 Aug 2012 16:39:00 -0700
Subject: Correct an exception report in SceneObjectPart so it outputs the
stack.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index cd75224..bd6369c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -733,7 +733,7 @@ namespace OpenSim.Region.Framework.Scenes
}
catch (Exception e)
{
- m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message);
+ m_log.ErrorFormat("[SCENEOBJECTPART]: GROUP POSITION. {0}", e);
}
}
--
cgit v1.1
From 466d684fbe26b4ea24a0003120d7a875fbbca037 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Wed, 1 Aug 2012 15:18:02 +0100
Subject: implemented
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 50 ++++++++++++++++++++++
1 file changed, 50 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index bd6369c..e84ab05 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4236,6 +4236,56 @@ namespace OpenSim.Region.Framework.Scenes
ScheduleFullUpdate();
}
+ public void UpdateSlice(float begin, float end)
+ {
+ if (end < begin)
+ {
+ float temp = begin;
+ begin = end;
+ end = temp;
+ }
+ end = Math.Min(1f, Math.Max(0f, end));
+ begin = Math.Min(Math.Min(1f, Math.Max(0f, begin)), end - 0.02f);
+ if (begin < 0.02f && end < 0.02f)
+ {
+ begin = 0f;
+ end = 0.02f;
+ }
+
+ ushort uBegin = (ushort)(50000.0 * begin);
+ ushort uEnd = (ushort)(50000.0 * (1f - end));
+ bool updatePossiblyNeeded = false;
+ if (GetPrimType() == PrimType.SPHERE)
+ {
+ if (m_shape.ProfileBegin != uBegin || m_shape.ProfileEnd != uEnd)
+ {
+ m_shape.ProfileBegin = uBegin;
+ m_shape.ProfileEnd = uEnd;
+ updatePossiblyNeeded = true;
+ }
+ }
+ else if (m_shape.PathBegin != uBegin || m_shape.PathEnd != uEnd)
+ {
+ m_shape.PathBegin = uBegin;
+ m_shape.PathEnd = uEnd;
+ updatePossiblyNeeded = true;
+ }
+
+ if (updatePossiblyNeeded && ParentGroup != null)
+ {
+ ParentGroup.HasGroupChanged = true;
+ }
+ if (updatePossiblyNeeded && PhysActor != null)
+ {
+ PhysActor.Shape = m_shape;
+ ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
+ }
+ if (updatePossiblyNeeded)
+ {
+ ScheduleFullUpdate();
+ }
+ }
+
///
/// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics
/// engine can use it.
--
cgit v1.1
From 7068fddd2fffe356869171ed67be473f7a701470 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Thu, 2 Aug 2012 09:28:32 +0100
Subject: fixing bug that get/set the wrong property for prim types other than
sphere & box
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index e84ab05..53b4f7e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4255,7 +4255,8 @@ namespace OpenSim.Region.Framework.Scenes
ushort uBegin = (ushort)(50000.0 * begin);
ushort uEnd = (ushort)(50000.0 * (1f - end));
bool updatePossiblyNeeded = false;
- if (GetPrimType() == PrimType.SPHERE)
+ PrimType primType = GetPrimType();
+ if (primType == PrimType.SPHERE || primType == PrimType.TORUS || primType == PrimType.TUBE || primType == PrimType.RING)
{
if (m_shape.ProfileBegin != uBegin || m_shape.ProfileEnd != uEnd)
{
--
cgit v1.1
From aee4353e9cf811bd66a17f292c6f17c9495831fc Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Fri, 17 Aug 2012 14:47:53 +0100
Subject: fix typo
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 53b4f7e..0535dcb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2858,7 +2858,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SetFaceColor(Vector3 color, int face)
{
// The only way to get a deep copy/ If we don't do this, we can
- // mever detect color changes further down.
+ // never detect color changes further down.
Byte[] buf = Shape.Textures.GetBytes();
Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length);
Color4 texcolor;
--
cgit v1.1
From b863a15a820be7c3b86b27ef24944d6a85fa5360 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Fri, 17 Aug 2012 15:09:52 +0100
Subject: single operation for PRIM_COLOR
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 49 ++++++++++++++++++++++
1 file changed, 49 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 0535dcb..6741e5e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2896,6 +2896,55 @@ namespace OpenSim.Region.Framework.Scenes
}
///
+ /// Set the color & alpha of prim faces
+ ///
+ ///
+ ///
+ ///
+ public void SetFaceColorAlpha(int face, Vector3 color, double alpha)
+ {
+ // The only way to get a deep copy/ If we don't do this, we can
+ // never detect color changes further down.
+ Byte[] buf = Shape.Textures.GetBytes();
+ Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length);
+ Color4 texcolor;
+ if (face >= 0 && face < GetNumberOfSides())
+ {
+ texcolor = tex.CreateFace((uint)face).RGBA;
+ texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
+ texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
+ texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
+ texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
+ tex.FaceTextures[face].RGBA = texcolor;
+ UpdateTextureEntry(tex.GetBytes());
+ return;
+ }
+ else if (face == ALL_SIDES)
+ {
+ for (uint i = 0; i < GetNumberOfSides(); i++)
+ {
+ if (tex.FaceTextures[i] != null)
+ {
+ texcolor = tex.FaceTextures[i].RGBA;
+ texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
+ texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
+ texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
+ texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
+ tex.FaceTextures[i].RGBA = texcolor;
+ }
+ texcolor = tex.DefaultTexture.RGBA;
+ texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
+ texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
+ texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
+ texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
+ tex.DefaultTexture.RGBA = texcolor;
+ }
+ UpdateTextureEntry(tex.GetBytes());
+ return;
+ }
+ }
+
+ ///
/// Get the number of sides that this part has.
///
///
--
cgit v1.1
From ede3b9ab07dc1ed4a51684b7257cbb4d76e9bdfd Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Mon, 20 Aug 2012 09:26:26 +0100
Subject: making use of implicit operators and Util.Clip handling of Vector3
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 47 ++++++++++++----------
1 file changed, 26 insertions(+), 21 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 6741e5e..098b2d9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2857,6 +2857,8 @@ namespace OpenSim.Region.Framework.Scenes
///
public void SetFaceColor(Vector3 color, int face)
{
+ Vector3 clippedColor = Util.Clip(color, 0.0f, 1.0f);
+
// The only way to get a deep copy/ If we don't do this, we can
// never detect color changes further down.
Byte[] buf = Shape.Textures.GetBytes();
@@ -2865,9 +2867,9 @@ namespace OpenSim.Region.Framework.Scenes
if (face >= 0 && face < GetNumberOfSides())
{
texcolor = tex.CreateFace((uint)face).RGBA;
- texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
- texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
- texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
+ texcolor.R = clippedColor.X;
+ texcolor.G = clippedColor.Y;
+ texcolor.B = clippedColor.Z;
tex.FaceTextures[face].RGBA = texcolor;
UpdateTextureEntry(tex.GetBytes());
return;
@@ -2879,15 +2881,15 @@ namespace OpenSim.Region.Framework.Scenes
if (tex.FaceTextures[i] != null)
{
texcolor = tex.FaceTextures[i].RGBA;
- texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
- texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
- texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
+ texcolor.R = clippedColor.X;
+ texcolor.G = clippedColor.Y;
+ texcolor.B = clippedColor.Z;
tex.FaceTextures[i].RGBA = texcolor;
}
texcolor = tex.DefaultTexture.RGBA;
- texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
- texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
- texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
+ texcolor.R = clippedColor.X;
+ texcolor.G = clippedColor.Y;
+ texcolor.B = clippedColor.Z;
tex.DefaultTexture.RGBA = texcolor;
}
UpdateTextureEntry(tex.GetBytes());
@@ -2903,6 +2905,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public void SetFaceColorAlpha(int face, Vector3 color, double alpha)
{
+ Vector3 clippedColor = Util.Clip(color, 0.0f, 1.0f);
+ float clippedAlpha = Util.Clip((float)alpha, 0.0f, 1.0f);
+
// The only way to get a deep copy/ If we don't do this, we can
// never detect color changes further down.
Byte[] buf = Shape.Textures.GetBytes();
@@ -2911,10 +2916,10 @@ namespace OpenSim.Region.Framework.Scenes
if (face >= 0 && face < GetNumberOfSides())
{
texcolor = tex.CreateFace((uint)face).RGBA;
- texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
- texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
- texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
- texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
+ texcolor.R = clippedColor.X;
+ texcolor.G = clippedColor.Y;
+ texcolor.B = clippedColor.Z;
+ texcolor.A = clippedAlpha;
tex.FaceTextures[face].RGBA = texcolor;
UpdateTextureEntry(tex.GetBytes());
return;
@@ -2926,17 +2931,17 @@ namespace OpenSim.Region.Framework.Scenes
if (tex.FaceTextures[i] != null)
{
texcolor = tex.FaceTextures[i].RGBA;
- texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
- texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
- texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
- texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
+ texcolor.R = clippedColor.X;
+ texcolor.G = clippedColor.Y;
+ texcolor.B = clippedColor.Z;
+ texcolor.A = clippedAlpha;
tex.FaceTextures[i].RGBA = texcolor;
}
texcolor = tex.DefaultTexture.RGBA;
- texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f);
- texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
- texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
- texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
+ texcolor.R = clippedColor.X;
+ texcolor.G = clippedColor.Y;
+ texcolor.B = clippedColor.Z;
+ texcolor.A = clippedAlpha;
tex.DefaultTexture.RGBA = texcolor;
}
UpdateTextureEntry(tex.GetBytes());
--
cgit v1.1
From 481c00f50a1961ac77e800d64a68e9c30a4b69de Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Mon, 20 Aug 2012 09:31:29 +0100
Subject: refactoring out SetFaceColor
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 67 +++++-----------------
1 file changed, 15 insertions(+), 52 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 098b2d9..2a9ee3a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2851,62 +2851,16 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Set the color of prim faces
- ///
- ///
- ///
- public void SetFaceColor(Vector3 color, int face)
- {
- Vector3 clippedColor = Util.Clip(color, 0.0f, 1.0f);
-
- // The only way to get a deep copy/ If we don't do this, we can
- // never detect color changes further down.
- Byte[] buf = Shape.Textures.GetBytes();
- Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length);
- Color4 texcolor;
- if (face >= 0 && face < GetNumberOfSides())
- {
- texcolor = tex.CreateFace((uint)face).RGBA;
- texcolor.R = clippedColor.X;
- texcolor.G = clippedColor.Y;
- texcolor.B = clippedColor.Z;
- tex.FaceTextures[face].RGBA = texcolor;
- UpdateTextureEntry(tex.GetBytes());
- return;
- }
- else if (face == ALL_SIDES)
- {
- for (uint i = 0; i < GetNumberOfSides(); i++)
- {
- if (tex.FaceTextures[i] != null)
- {
- texcolor = tex.FaceTextures[i].RGBA;
- texcolor.R = clippedColor.X;
- texcolor.G = clippedColor.Y;
- texcolor.B = clippedColor.Z;
- tex.FaceTextures[i].RGBA = texcolor;
- }
- texcolor = tex.DefaultTexture.RGBA;
- texcolor.R = clippedColor.X;
- texcolor.G = clippedColor.Y;
- texcolor.B = clippedColor.Z;
- tex.DefaultTexture.RGBA = texcolor;
- }
- UpdateTextureEntry(tex.GetBytes());
- return;
- }
- }
-
- ///
/// Set the color & alpha of prim faces
///
///
///
///
- public void SetFaceColorAlpha(int face, Vector3 color, double alpha)
+ public void SetFaceColorAlpha(int face, Vector3 color, double ?alpha)
{
Vector3 clippedColor = Util.Clip(color, 0.0f, 1.0f);
- float clippedAlpha = Util.Clip((float)alpha, 0.0f, 1.0f);
+ float clippedAlpha = alpha.HasValue ?
+ Util.Clip((float)alpha.Value, 0.0f, 1.0f) : 0;
// The only way to get a deep copy/ If we don't do this, we can
// never detect color changes further down.
@@ -2919,7 +2873,10 @@ namespace OpenSim.Region.Framework.Scenes
texcolor.R = clippedColor.X;
texcolor.G = clippedColor.Y;
texcolor.B = clippedColor.Z;
- texcolor.A = clippedAlpha;
+ if (alpha.HasValue)
+ {
+ texcolor.A = clippedAlpha;
+ }
tex.FaceTextures[face].RGBA = texcolor;
UpdateTextureEntry(tex.GetBytes());
return;
@@ -2934,14 +2891,20 @@ namespace OpenSim.Region.Framework.Scenes
texcolor.R = clippedColor.X;
texcolor.G = clippedColor.Y;
texcolor.B = clippedColor.Z;
- texcolor.A = clippedAlpha;
+ if (alpha.HasValue)
+ {
+ texcolor.A = clippedAlpha;
+ }
tex.FaceTextures[i].RGBA = texcolor;
}
texcolor = tex.DefaultTexture.RGBA;
texcolor.R = clippedColor.X;
texcolor.G = clippedColor.Y;
texcolor.B = clippedColor.Z;
- texcolor.A = clippedAlpha;
+ if (alpha.HasValue)
+ {
+ texcolor.A = clippedAlpha;
+ }
tex.DefaultTexture.RGBA = texcolor;
}
UpdateTextureEntry(tex.GetBytes());
--
cgit v1.1
From c55768466626336849c650349b335365c41359e5 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Fri, 24 Aug 2012 00:15:30 +0100
Subject: Fix bad child prim permissions that can make objects change perms
after rezzing
Port from Avination
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2a9ee3a..411dcc7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3890,6 +3890,27 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ public void ClonePermissions(SceneObjectPart source)
+ {
+ bool update = false;
+
+ if (BaseMask != source.BaseMask ||
+ OwnerMask != source.OwnerMask ||
+ GroupMask != source.GroupMask ||
+ EveryoneMask != source.EveryoneMask ||
+ NextOwnerMask != source.NextOwnerMask)
+ update = true;
+
+ BaseMask = source.BaseMask;
+ OwnerMask = source.OwnerMask;
+ GroupMask = source.GroupMask;
+ EveryoneMask = source.EveryoneMask;
+ NextOwnerMask = source.NextOwnerMask;
+
+ if (update)
+ SendFullUpdateToAllClients();
+ }
+
public bool IsHingeJoint()
{
// For now, we use the NINJA naming scheme for identifying joints.
--
cgit v1.1
From 90dd5844d64643246fb8bccf356614eb7e07d61c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 26 Sep 2012 21:28:43 +0100
Subject: Add basic undo/redo regression tests.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 411dcc7..63eb387 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3191,9 +3191,9 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- // m_log.DebugFormat(
- // "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}",
- // Name, LocalId, forGroup, m_undo.Count);
+// m_log.DebugFormat(
+// "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}",
+// Name, LocalId, forGroup, m_undo.Count);
if (ParentGroup.GetSceneMaxUndo() > 0)
{
@@ -3204,9 +3204,9 @@ namespace OpenSim.Region.Framework.Scenes
if (m_redo.Count > 0)
m_redo.Clear();
- // m_log.DebugFormat(
- // "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}",
- // Name, LocalId, forGroup, m_undo.Count);
+// m_log.DebugFormat(
+// "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}",
+// Name, LocalId, forGroup, m_undo.Count);
}
}
}
--
cgit v1.1
From 327320d1a7acbba969d26c281f92f64ce8ff365f Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 26 Sep 2012 22:49:44 +0100
Subject: Enforce existing 5 action hardcoded undo limit.
This was present in the code but not enforced, which led to a memory leak over time as part properties were changed, whether by viewer, script or another source.
This commit enforces that limit, which will soon become configurable.
Regression test for undo limit added
Should help with http://opensimulator.org/mantis/view.php?id=6279
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 59 ++++++++++++----------
1 file changed, 33 insertions(+), 26 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 63eb387..9e78242 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -266,8 +266,8 @@ namespace OpenSim.Region.Framework.Scenes
private string m_sitAnimation = "SIT";
private string m_text = String.Empty;
private string m_touchName = String.Empty;
- private readonly Stack m_undo = new Stack(5);
- private readonly Stack m_redo = new Stack(5);
+ private readonly List m_undo = new List(5);
+ private readonly List m_redo = new List(5);
private bool m_passTouches = false;
private bool m_passCollisions = false;
@@ -3176,7 +3176,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_undo.Count > 0)
{
- UndoState last = m_undo.Peek();
+ UndoState last = m_undo[m_undo.Count - 1];
if (last != null)
{
// TODO: May need to fix for group comparison
@@ -3199,7 +3199,10 @@ namespace OpenSim.Region.Framework.Scenes
{
UndoState nUndo = new UndoState(this, forGroup);
- m_undo.Push(nUndo);
+ m_undo.Add(nUndo);
+
+ if (m_undo.Count > ParentGroup.GetSceneMaxUndo())
+ m_undo.RemoveAt(0);
if (m_redo.Count > 0)
m_redo.Clear();
@@ -3245,21 +3248,24 @@ namespace OpenSim.Region.Framework.Scenes
if (m_undo.Count > 0)
{
- UndoState goback = m_undo.Pop();
+ UndoState goback = m_undo[m_undo.Count - 1];
+ m_undo.RemoveAt(m_undo.Count - 1);
- if (goback != null)
+ UndoState nUndo = null;
+
+ if (ParentGroup.GetSceneMaxUndo() > 0)
{
- UndoState nUndo = null;
-
- if (ParentGroup.GetSceneMaxUndo() > 0)
- {
- nUndo = new UndoState(this, goback.ForGroup);
- }
+ nUndo = new UndoState(this, goback.ForGroup);
+ }
+
+ goback.PlaybackState(this);
- goback.PlaybackState(this);
+ if (nUndo != null)
+ {
+ m_redo.Add(nUndo);
- if (nUndo != null)
- m_redo.Push(nUndo);
+ if (m_redo.Count > ParentGroup.GetSceneMaxUndo())
+ m_redo.RemoveAt(0);
}
}
@@ -3279,20 +3285,21 @@ namespace OpenSim.Region.Framework.Scenes
if (m_redo.Count > 0)
{
- UndoState gofwd = m_redo.Pop();
-
- if (gofwd != null)
+ UndoState gofwd = m_redo[m_redo.Count - 1];
+ m_redo.RemoveAt(m_redo.Count - 1);
+
+ if (ParentGroup.GetSceneMaxUndo() > 0)
{
- if (ParentGroup.GetSceneMaxUndo() > 0)
- {
- UndoState nUndo = new UndoState(this, gofwd.ForGroup);
-
- m_undo.Push(nUndo);
- }
-
- gofwd.PlayfwdState(this);
+ UndoState nUndo = new UndoState(this, gofwd.ForGroup);
+
+ m_undo.Add(nUndo);
+
+ if (m_undo.Count > ParentGroup.GetSceneMaxUndo())
+ m_undo.RemoveAt(0);
}
+ gofwd.PlayfwdState(this);
+
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Handled redo request for {0} {1}, stack size now {2}",
// Name, LocalId, m_redo.Count);
--
cgit v1.1
From 36e3123069fb7524d3872d095c0f54c155c55a28 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.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 9e78242..018e4fc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2368,16 +2368,20 @@ namespace OpenSim.Region.Framework.Scenes
///
public void Resize(Vector3 scale)
{
- scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X));
- scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y));
- scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z));
-
PhysicsActor pa = PhysActor;
- if (pa != null && pa.IsPhysical)
+
+ if (ParentGroup.Scene != null)
{
- scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X));
- scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y));
- scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z));
+ scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X));
+ scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y));
+ scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z));
+
+ if (pa != null && pa.IsPhysical)
+ {
+ scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X));
+ scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y));
+ scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z));
+ }
}
// m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale);
--
cgit v1.1
From 31c636f1e48db2a42950e2ec0e8c7eba2c16616c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 26 Sep 2012 23:25:50 +0100
Subject: refactor: Change control structures in SOP.StoreUndoState() to reduce
nesting.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 88 +++++++++++-----------
1 file changed, 43 insertions(+), 45 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 018e4fc..8710c3e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3170,64 +3170,62 @@ namespace OpenSim.Region.Framework.Scenes
public void StoreUndoState(bool forGroup)
{
- if (!Undoing)
+ if (Undoing)
{
- if (!IgnoreUndoUpdate)
+// m_log.DebugFormat(
+// "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
+ return;
+ }
+
+ if (IgnoreUndoUpdate)
+ {
+// m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId);
+ return;
+ }
+
+ if (ParentGroup == null)
+ return;
+
+ lock (m_undo)
+ {
+ if (m_undo.Count > 0)
{
- if (ParentGroup != null)
+ UndoState last = m_undo[m_undo.Count - 1];
+ if (last != null)
{
- lock (m_undo)
+ // TODO: May need to fix for group comparison
+ if (last.Compare(this))
{
- if (m_undo.Count > 0)
- {
- UndoState last = m_undo[m_undo.Count - 1];
- if (last != null)
- {
- // TODO: May need to fix for group comparison
- if (last.Compare(this))
- {
- // m_log.DebugFormat(
- // "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}",
- // Name, LocalId, m_undo.Count);
-
- return;
- }
- }
- }
-
+// m_log.DebugFormat(
+// "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}",
+// Name, LocalId, m_undo.Count);
+
+ return;
+ }
+ }
+ }
+
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}",
// Name, LocalId, forGroup, m_undo.Count);
-
- if (ParentGroup.GetSceneMaxUndo() > 0)
- {
- UndoState nUndo = new UndoState(this, forGroup);
-
- m_undo.Add(nUndo);
- if (m_undo.Count > ParentGroup.GetSceneMaxUndo())
- m_undo.RemoveAt(0);
-
- if (m_redo.Count > 0)
- m_redo.Clear();
-
+ if (ParentGroup.GetSceneMaxUndo() > 0)
+ {
+ UndoState nUndo = new UndoState(this, forGroup);
+
+ m_undo.Add(nUndo);
+
+ if (m_undo.Count > ParentGroup.GetSceneMaxUndo())
+ m_undo.RemoveAt(0);
+
+ if (m_redo.Count > 0)
+ m_redo.Clear();
+
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}",
// Name, LocalId, forGroup, m_undo.Count);
- }
- }
- }
}
-// else
-// {
-// m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId);
-// }
}
-// else
-// {
-// m_log.DebugFormat(
-// "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId);
-// }
}
///
--
cgit v1.1
From b9934fc4dbb1267409fa7264f3dd83a98959ea87 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 26 Sep 2012 23:31:10 +0100
Subject: Don't store undo states if a scene object is manipulated when it is
not in a scene.
Adds regression test for this.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 8710c3e..3d4bc3c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3170,6 +3170,9 @@ namespace OpenSim.Region.Framework.Scenes
public void StoreUndoState(bool forGroup)
{
+ if (ParentGroup == null || ParentGroup.Scene == null)
+ return;
+
if (Undoing)
{
// m_log.DebugFormat(
@@ -3183,9 +3186,6 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
- if (ParentGroup == null)
- return;
-
lock (m_undo)
{
if (m_undo.Count > 0)
--
cgit v1.1
From 2bf42f30af5030890b8e3ff5bb29074a1f0e9085 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 27 Sep 2012 00:12:34 +0100
Subject: Add MaxPrimsUndo config setting to [Startup] section of OpenSim.ini.
This controls how many undo steps the simulator will store for each prim.
Default is now 20 rather than 5 as it briefly was.
The default number could be increased through this is a memory tradeoff which will scale with the number of prims in the sim and level of activity.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 3d4bc3c..3f10b34 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3209,13 +3209,13 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}",
// Name, LocalId, forGroup, m_undo.Count);
- if (ParentGroup.GetSceneMaxUndo() > 0)
+ if (ParentGroup.Scene.MaxUndoCount > 0)
{
UndoState nUndo = new UndoState(this, forGroup);
m_undo.Add(nUndo);
- if (m_undo.Count > ParentGroup.GetSceneMaxUndo())
+ if (m_undo.Count > ParentGroup.Scene.MaxUndoCount)
m_undo.RemoveAt(0);
if (m_redo.Count > 0)
@@ -3255,7 +3255,7 @@ namespace OpenSim.Region.Framework.Scenes
UndoState nUndo = null;
- if (ParentGroup.GetSceneMaxUndo() > 0)
+ if (ParentGroup.Scene.MaxUndoCount > 0)
{
nUndo = new UndoState(this, goback.ForGroup);
}
@@ -3266,7 +3266,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_redo.Add(nUndo);
- if (m_redo.Count > ParentGroup.GetSceneMaxUndo())
+ if (m_redo.Count > ParentGroup.Scene.MaxUndoCount)
m_redo.RemoveAt(0);
}
}
@@ -3290,13 +3290,13 @@ namespace OpenSim.Region.Framework.Scenes
UndoState gofwd = m_redo[m_redo.Count - 1];
m_redo.RemoveAt(m_redo.Count - 1);
- if (ParentGroup.GetSceneMaxUndo() > 0)
+ if (ParentGroup.Scene.MaxUndoCount > 0)
{
UndoState nUndo = new UndoState(this, gofwd.ForGroup);
m_undo.Add(nUndo);
- if (m_undo.Count > ParentGroup.GetSceneMaxUndo())
+ if (m_undo.Count > ParentGroup.Scene.MaxUndoCount)
m_undo.RemoveAt(0);
}
--
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.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4af508e..44573eb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2972,16 +2972,20 @@ namespace OpenSim.Region.Framework.Scenes
///
public void Resize(Vector3 scale)
{
- scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X));
- scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y));
- scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z));
-
PhysicsActor pa = PhysActor;
- if (pa != null && pa.IsPhysical)
+
+ if (ParentGroup.Scene != null)
{
- scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X));
- scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y));
- scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z));
+ scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X));
+ scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y));
+ scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z));
+
+ if (pa != null && pa.IsPhysical)
+ {
+ scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X));
+ scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y));
+ scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z));
+ }
}
// m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale);
--
cgit v1.1
From 91ca3117cb35444e6b0e4300468959ed43c048c3 Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Fri, 5 Oct 2012 17:32:07 -0700
Subject: Add bool to TriggerSceneObjectPartUpdated where full = true indicates
a full update. There should be a better way to indicate which properties have
changed that is non LLUDP-centric
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 3f10b34..199526e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2465,7 +2465,7 @@ namespace OpenSim.Region.Framework.Scenes
// UUID, Name, TimeStampFull);
if (ParentGroup.Scene != null)
- ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
+ ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true);
}
///
@@ -2499,7 +2499,7 @@ namespace OpenSim.Region.Framework.Scenes
}
if (ParentGroup.Scene != null)
- ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
+ ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, false);
}
public void ScriptSetPhysicsStatus(bool UsePhysics)
--
cgit v1.1
From 7ab83f9eb22c5aaef3118ef45e4681503d6b93fc 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
Signed-off-by: Melanie
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 28 ++++++++++++----------
1 file changed, 16 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 199526e..58ef9f7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1014,9 +1014,9 @@ namespace OpenSim.Region.Framework.Scenes
{
actor.Size = m_shape.Scale;
- if (Shape.SculptEntry)
- CheckSculptAndLoad();
- else
+// if (Shape.SculptEntry)
+// CheckSculptAndLoad();
+// else
ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
}
}
@@ -1620,12 +1620,13 @@ namespace OpenSim.Region.Framework.Scenes
if (userExposed)
{
+/*
if (dupe.m_shape.SculptEntry && dupe.m_shape.SculptTexture != UUID.Zero)
{
ParentGroup.Scene.AssetService.Get(
dupe.m_shape.SculptTexture.ToString(), dupe, dupe.AssetReceived);
}
-
+*/
bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0);
dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
}
@@ -1643,6 +1644,7 @@ namespace OpenSim.Region.Framework.Scenes
/// ID of asset received
/// Register
///
+/*
protected void AssetReceived(string id, Object sender, AssetBase asset)
{
if (asset != null)
@@ -1652,7 +1654,7 @@ namespace OpenSim.Region.Framework.Scenes
"[SCENE OBJECT PART]: Part {0} {1} requested mesh/sculpt data for asset id {2} from asset service but received no data",
Name, UUID, id);
}
-
+*/
///
/// Do a physics property update for a NINJA joint.
///
@@ -1833,9 +1835,9 @@ namespace OpenSim.Region.Framework.Scenes
// If this part is a sculpt then delay the physics update until we've asynchronously loaded the
// mesh data.
- if (Shape.SculptEntry)
- CheckSculptAndLoad();
- else
+// if (Shape.SculptEntry)
+// CheckSculptAndLoad();
+// else
ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
}
}
@@ -2511,6 +2513,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Set sculpt and mesh data, and tell the physics engine to process the change.
///
/// The mesh itself.
+/*
public void SculptTextureCallback(AssetBase texture)
{
if (m_shape.SculptEntry)
@@ -2538,7 +2541,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+*/
///
/// Send a full update to the client for the given part
///
@@ -3783,7 +3786,7 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
{
m_shape.ReadInUpdateExtraParam(type, inUse, data);
-
+/*
if (type == 0x30)
{
if (m_shape.SculptEntry && m_shape.SculptTexture != UUID.Zero)
@@ -3791,7 +3794,7 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.Scene.AssetService.Get(m_shape.SculptTexture.ToString(), this, AssetReceived);
}
}
-
+*/
if (ParentGroup != null)
{
ParentGroup.HasGroupChanged = true;
@@ -4341,6 +4344,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()
{
// m_log.DebugFormat("Processing CheckSculptAndLoad for {0} {1}", Name, LocalId);
@@ -4366,7 +4370,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
-
+*/
///
/// Update the texture entry for this part.
///
--
cgit v1.1
From a2c93133be90822076e4e8d0b4096a83a30d80bd Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 18 Oct 2012 21:23:57 +0100
Subject: Remove extraneous calls to the now commented CheckSculptAndLoad
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 24 ----------------------
1 file changed, 24 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 58ef9f7..da2c069 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4028,14 +4028,6 @@ namespace OpenSim.Region.Framework.Scenes
if (!wasUsingPhysics)
{
DoPhysicsPropertyUpdate(UsePhysics, false);
-
- if (!ParentGroup.IsDeleted)
- {
- if (LocalId == ParentGroup.RootPart.LocalId)
- {
- ParentGroup.CheckSculptAndLoad();
- }
- }
}
}
else
@@ -4075,14 +4067,6 @@ namespace OpenSim.Region.Framework.Scenes
pa.SetMaterial(Material);
DoPhysicsPropertyUpdate(UsePhysics, true);
- if (!ParentGroup.IsDeleted)
- {
- if (LocalId == ParentGroup.RootPart.LocalId)
- {
- ParentGroup.CheckSculptAndLoad();
- }
- }
-
if (
((AggregateScriptEvents & scriptEvents.collision) != 0) ||
((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
@@ -4107,14 +4091,6 @@ namespace OpenSim.Region.Framework.Scenes
else // it already has a physical representation
{
DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim
-
- if (!ParentGroup.IsDeleted)
- {
- if (LocalId == ParentGroup.RootPart.LocalId)
- {
- ParentGroup.CheckSculptAndLoad();
- }
- }
}
}
--
cgit v1.1
From 32171708c3a29d2bb989b5638dc7536c6e4ecf3c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 10 Oct 2012 01:37:59 +0100
Subject: normalize quaternion.Slerp outputs
Signed-off-by: Melanie
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index da2c069..27ef4c9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4584,6 +4584,7 @@ namespace OpenSim.Region.Framework.Scenes
}
Quaternion rot = Quaternion.Slerp(RotationOffset,APIDTarget,1.0f/(float)m_APIDIterations);
+ rot.Normalize();
UpdateRotation(rot);
m_APIDIterations--;
--
cgit v1.1
From b42cfe49a2f4e95687eb76381ed911515ef2e3b2 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Fri, 5 Oct 2012 14:37:01 +0100
Subject: Replacing double-if block in SceneObjectPart.SendSound with Util.Clip
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 27ef4c9..a539eff 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2684,10 +2684,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster)
{
- if (volume > 1)
- volume = 1;
- if (volume < 0)
- volume = 0;
+ volume = Util.Clip((float)volume, 0, 1);
UUID ownerID = OwnerID;
UUID objectID = ParentGroup.RootPart.UUID;
--
cgit v1.1
From f4fe8763ad4f4cb85ff38eb65f1138baee74ece1 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Fri, 5 Oct 2012 14:37:55 +0100
Subject: Changing the logic order in the TaskInventory iterator of
ScenObjectPart.SendSound, since we can currently have non-unique object
inventory names so we should check the asset type first.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index a539eff..681feea 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2701,7 +2701,7 @@ namespace OpenSim.Region.Framework.Scenes
{
foreach (KeyValuePair item in TaskInventory)
{
- if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
+ if (item.Value.Type == (int)AssetType.Sound && item.Value.Name == sound)
{
soundID = item.Value.ItemID;
break;
--
cgit v1.1
From 32db725dd770a52d02f86cf8a1274f68178d6844 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Fri, 5 Oct 2012 14:39:06 +0100
Subject: SceneObjectPart.SendSound can exit early if a sound module was not
found.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 681feea..3a39da0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2684,6 +2684,10 @@ namespace OpenSim.Region.Framework.Scenes
///
public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster)
{
+ ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface();
+ if(soundModule == null)
+ return;
+
volume = Util.Clip((float)volume, 0, 1);
UUID ownerID = OwnerID;
@@ -2713,9 +2717,6 @@ namespace OpenSim.Region.Framework.Scenes
if (soundID == UUID.Zero)
return;
- ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface();
- if (soundModule != null)
- {
if (useMaster)
{
if (isMaster)
@@ -2761,7 +2762,6 @@ namespace OpenSim.Region.Framework.Scenes
else
soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
}
- }
}
///
--
cgit v1.1
From 1c618843b836c4e9ad8ae685d2f49836e32d8b08 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Fri, 5 Oct 2012 14:39:23 +0100
Subject: formatting changes to SceneObjectPart.SendSound; consistent
indentation
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 68 +++++++++++-----------
1 file changed, 34 insertions(+), 34 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 3a39da0..b333a1a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2717,51 +2717,51 @@ namespace OpenSim.Region.Framework.Scenes
if (soundID == UUID.Zero)
return;
- if (useMaster)
+ if (useMaster)
+ {
+ if (isMaster)
{
- if (isMaster)
+ if (triggered)
+ soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
+ else
+ soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
+ ParentGroup.PlaySoundMasterPrim = this;
+ ownerID = OwnerID;
+ objectID = ParentGroup.RootPart.UUID;
+ parentID = ParentGroup.UUID;
+ position = AbsolutePosition; // region local
+ regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle;
+ if (triggered)
+ soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
+ else
+ soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
+ foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims)
{
+ ownerID = prim.OwnerID;
+ objectID = prim.ParentGroup.RootPart.UUID;
+ parentID = prim.ParentGroup.UUID;
+ position = prim.AbsolutePosition; // region local
+ regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle;
if (triggered)
soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
else
soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
- ParentGroup.PlaySoundMasterPrim = this;
- ownerID = OwnerID;
- objectID = ParentGroup.RootPart.UUID;
- parentID = ParentGroup.UUID;
- position = AbsolutePosition; // region local
- regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle;
- if (triggered)
- soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
- else
- soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
- foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims)
- {
- ownerID = prim.OwnerID;
- objectID = prim.ParentGroup.RootPart.UUID;
- parentID = prim.ParentGroup.UUID;
- position = prim.AbsolutePosition; // region local
- regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle;
- if (triggered)
- soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
- else
- soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
- }
- ParentGroup.PlaySoundSlavePrims.Clear();
- ParentGroup.PlaySoundMasterPrim = null;
- }
- else
- {
- ParentGroup.PlaySoundSlavePrims.Add(this);
}
+ ParentGroup.PlaySoundSlavePrims.Clear();
+ ParentGroup.PlaySoundMasterPrim = null;
}
else
{
- if (triggered)
- soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
- else
- soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
+ ParentGroup.PlaySoundSlavePrims.Add(this);
}
+ }
+ else
+ {
+ if (triggered)
+ soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
+ else
+ soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
+ }
}
///
--
cgit v1.1
From a68e2fe1692a7611c58f774ac5b94c4298343433 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Fri, 5 Oct 2012 15:16:30 +0100
Subject: transposing preload sound onto sound module
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 31 ----------------------
1 file changed, 31 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b333a1a..48615de 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2287,37 +2287,6 @@ namespace OpenSim.Region.Framework.Scenes
ScheduleTerseUpdate();
}
- public void PreloadSound(string sound)
- {
- // UUID ownerID = OwnerID;
- UUID objectID = ParentGroup.RootPart.UUID;
- UUID soundID = UUID.Zero;
-
- if (!UUID.TryParse(sound, out soundID))
- {
- //Trys to fetch sound id from prim's inventory.
- //Prim's inventory doesn't support non script items yet
-
- lock (TaskInventory)
- {
- foreach (KeyValuePair item in TaskInventory)
- {
- if (item.Value.Name == sound)
- {
- soundID = item.Value.ItemID;
- break;
- }
- }
- }
- }
-
- ParentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
- {
- if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100))
- sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
- });
- }
-
public void RemFlag(PrimFlags flag)
{
// PrimFlags prevflag = Flags;
--
cgit v1.1
From 22693304fb3cfbb8d073c48affd2e56453dd2b2f Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Mon, 15 Oct 2012 14:05:17 +0100
Subject: removing superfluous lines from SceneObjectPart.SendSound
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 8 --------
1 file changed, 8 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 48615de..681c725 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2695,11 +2695,6 @@ namespace OpenSim.Region.Framework.Scenes
else
soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
ParentGroup.PlaySoundMasterPrim = this;
- ownerID = OwnerID;
- objectID = ParentGroup.RootPart.UUID;
- parentID = ParentGroup.UUID;
- position = AbsolutePosition; // region local
- regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle;
if (triggered)
soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
else
@@ -2707,10 +2702,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims)
{
ownerID = prim.OwnerID;
- objectID = prim.ParentGroup.RootPart.UUID;
- parentID = prim.ParentGroup.UUID;
position = prim.AbsolutePosition; // region local
- regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle;
if (triggered)
soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
else
--
cgit v1.1
From 57940087d125cf817d1d2492145dc224439434ad Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Mon, 15 Oct 2012 15:09:45 +0100
Subject: Factoring out a superfluous local variable & repeated assignment in
SceneObjectPart.SendSound as linksets are only meant to have a single owner
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 681c725..240cfa5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2659,7 +2659,6 @@ namespace OpenSim.Region.Framework.Scenes
volume = Util.Clip((float)volume, 0, 1);
- UUID ownerID = OwnerID;
UUID objectID = ParentGroup.RootPart.UUID;
UUID parentID = ParentGroup.UUID;
@@ -2691,22 +2690,21 @@ namespace OpenSim.Region.Framework.Scenes
if (isMaster)
{
if (triggered)
- soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
+ soundModule.TriggerSound(soundID, OwnerID, objectID, parentID, volume, position, regionHandle, radius);
else
- soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
+ soundModule.PlayAttachedSound(soundID, OwnerID, objectID, volume, position, flags, radius);
ParentGroup.PlaySoundMasterPrim = this;
if (triggered)
- soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
+ soundModule.TriggerSound(soundID, OwnerID, objectID, parentID, volume, position, regionHandle, radius);
else
- soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
+ soundModule.PlayAttachedSound(soundID, OwnerID, objectID, volume, position, flags, radius);
foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims)
{
- ownerID = prim.OwnerID;
position = prim.AbsolutePosition; // region local
if (triggered)
- soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
+ soundModule.TriggerSound(soundID, OwnerID, objectID, parentID, volume, position, regionHandle, radius);
else
- soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
+ soundModule.PlayAttachedSound(soundID, OwnerID, objectID, volume, position, flags, radius);
}
ParentGroup.PlaySoundSlavePrims.Clear();
ParentGroup.PlaySoundMasterPrim = null;
@@ -2719,9 +2717,9 @@ namespace OpenSim.Region.Framework.Scenes
else
{
if (triggered)
- soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius);
+ soundModule.TriggerSound(soundID, OwnerID, objectID, parentID, volume, position, regionHandle, radius);
else
- soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius);
+ soundModule.PlayAttachedSound(soundID, OwnerID, objectID, volume, position, flags, radius);
}
}
--
cgit v1.1
From af39af1cc407b88d6d2838acff09de77d4a4335d Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Mon, 15 Oct 2012 16:11:26 +0100
Subject: fixing a bug in SceneObjectPart.SendSound where sounds would always
come from the root prim rather than the source prim
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 240cfa5..5da4207 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2659,7 +2659,6 @@ namespace OpenSim.Region.Framework.Scenes
volume = Util.Clip((float)volume, 0, 1);
- UUID objectID = ParentGroup.RootPart.UUID;
UUID parentID = ParentGroup.UUID;
UUID soundID = UUID.Zero;
@@ -2690,21 +2689,21 @@ namespace OpenSim.Region.Framework.Scenes
if (isMaster)
{
if (triggered)
- soundModule.TriggerSound(soundID, OwnerID, objectID, parentID, volume, position, regionHandle, radius);
+ soundModule.TriggerSound(soundID, OwnerID, UUID, parentID, volume, position, regionHandle, radius);
else
- soundModule.PlayAttachedSound(soundID, OwnerID, objectID, volume, position, flags, radius);
+ soundModule.PlayAttachedSound(soundID, OwnerID, UUID, volume, position, flags, radius);
ParentGroup.PlaySoundMasterPrim = this;
if (triggered)
- soundModule.TriggerSound(soundID, OwnerID, objectID, parentID, volume, position, regionHandle, radius);
+ soundModule.TriggerSound(soundID, OwnerID, UUID, parentID, volume, position, regionHandle, radius);
else
- soundModule.PlayAttachedSound(soundID, OwnerID, objectID, volume, position, flags, radius);
+ soundModule.PlayAttachedSound(soundID, OwnerID, UUID, volume, position, flags, radius);
foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims)
{
position = prim.AbsolutePosition; // region local
if (triggered)
- soundModule.TriggerSound(soundID, OwnerID, objectID, parentID, volume, position, regionHandle, radius);
+ soundModule.TriggerSound(soundID, OwnerID, prim.UUID, parentID, volume, position, regionHandle, radius);
else
- soundModule.PlayAttachedSound(soundID, OwnerID, objectID, volume, position, flags, radius);
+ soundModule.PlayAttachedSound(soundID, OwnerID, prim.UUID, volume, position, flags, radius);
}
ParentGroup.PlaySoundSlavePrims.Clear();
ParentGroup.PlaySoundMasterPrim = null;
@@ -2717,9 +2716,9 @@ namespace OpenSim.Region.Framework.Scenes
else
{
if (triggered)
- soundModule.TriggerSound(soundID, OwnerID, objectID, parentID, volume, position, regionHandle, radius);
+ soundModule.TriggerSound(soundID, OwnerID, UUID, parentID, volume, position, regionHandle, radius);
else
- soundModule.PlayAttachedSound(soundID, OwnerID, objectID, volume, position, flags, radius);
+ soundModule.PlayAttachedSound(soundID, OwnerID, UUID, volume, position, flags, radius);
}
}
--
cgit v1.1
From 5abcecc7356bf58c479a7cff86581131a6ab3c9e Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Tue, 16 Oct 2012 12:24:33 +0100
Subject: moving SendSound from SceneObjectPart to ISoundModule
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 88 +++-------------------
1 file changed, 9 insertions(+), 79 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 5da4207..cbb92b2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2239,7 +2239,15 @@ namespace OpenSim.Region.Framework.Scenes
// play the sound.
if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f)
- SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0, 0, false, false);
+ {
+ ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface();
+ if (soundModule != null)
+ {
+ soundModule.SendSound(UUID, CollisionSound.ToString(),
+ CollisionSoundVolume, true, (byte)0, 0, false,
+ false);
+ }
+ }
SendCollisionEvent(scriptEvents.collision_start, startedColliders, ParentGroup.Scene.EventManager.TriggerScriptCollidingStart);
SendCollisionEvent(scriptEvents.collision , m_lastColliders , ParentGroup.Scene.EventManager.TriggerScriptColliding);
@@ -2645,84 +2653,6 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Trigger or play an attached sound in this part's inventory.
- ///
- ///
- ///
- ///
- ///
- public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster)
- {
- ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface();
- if(soundModule == null)
- return;
-
- volume = Util.Clip((float)volume, 0, 1);
-
- UUID parentID = ParentGroup.UUID;
-
- UUID soundID = UUID.Zero;
- Vector3 position = AbsolutePosition; // region local
- ulong regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle;
-
- if (!UUID.TryParse(sound, out soundID))
- {
- // search sound file from inventory
- lock (TaskInventory)
- {
- foreach (KeyValuePair item in TaskInventory)
- {
- if (item.Value.Type == (int)AssetType.Sound && item.Value.Name == sound)
- {
- soundID = item.Value.ItemID;
- break;
- }
- }
- }
- }
-
- if (soundID == UUID.Zero)
- return;
-
- if (useMaster)
- {
- if (isMaster)
- {
- if (triggered)
- soundModule.TriggerSound(soundID, OwnerID, UUID, parentID, volume, position, regionHandle, radius);
- else
- soundModule.PlayAttachedSound(soundID, OwnerID, UUID, volume, position, flags, radius);
- ParentGroup.PlaySoundMasterPrim = this;
- if (triggered)
- soundModule.TriggerSound(soundID, OwnerID, UUID, parentID, volume, position, regionHandle, radius);
- else
- soundModule.PlayAttachedSound(soundID, OwnerID, UUID, volume, position, flags, radius);
- foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims)
- {
- position = prim.AbsolutePosition; // region local
- if (triggered)
- soundModule.TriggerSound(soundID, OwnerID, prim.UUID, parentID, volume, position, regionHandle, radius);
- else
- soundModule.PlayAttachedSound(soundID, OwnerID, prim.UUID, volume, position, flags, radius);
- }
- ParentGroup.PlaySoundSlavePrims.Clear();
- ParentGroup.PlaySoundMasterPrim = null;
- }
- else
- {
- ParentGroup.PlaySoundSlavePrims.Add(this);
- }
- }
- else
- {
- if (triggered)
- soundModule.TriggerSound(soundID, OwnerID, UUID, parentID, volume, position, regionHandle, radius);
- else
- soundModule.PlayAttachedSound(soundID, OwnerID, UUID, volume, position, flags, radius);
- }
- }
-
- ///
/// Send a terse update to all clients
///
public void SendTerseUpdateToAllClients()
--
cgit v1.1
From c5af16aef82e2bdf2f4d877a231180e00a8893a6 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Tue, 16 Oct 2012 12:40:21 +0100
Subject: shuffling code around so that the interface for
ISoundModule.SendSound() specifies a UUID rather than a string
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index cbb92b2..f79ac96 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2243,7 +2243,7 @@ namespace OpenSim.Region.Framework.Scenes
ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface();
if (soundModule != null)
{
- soundModule.SendSound(UUID, CollisionSound.ToString(),
+ soundModule.SendSound(UUID, CollisionSound,
CollisionSoundVolume, true, (byte)0, 0, false,
false);
}
--
cgit v1.1
From d15d71a7efd2e1d3510111cbc9e617fc113fc29c Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 30 Oct 2012 01:28:03 +0000
Subject: Put back the collision sound shim into SOP
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b7f4291..5714fdd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2864,6 +2864,35 @@ namespace OpenSim.Region.Framework.Scenes
SendLandCollisionEvent(scriptEvents.land_collision_end, ParentGroup.Scene.EventManager.TriggerScriptLandCollidingEnd);
}
+ // The Collision sounds code calls this
+ public void SendCollisionSound(UUID soundID, double volume, Vector3 position)
+ {
+ if (soundID == UUID.Zero)
+ return;
+
+ ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface();
+ if (soundModule == null)
+ return;
+
+ if (volume > 1)
+ volume = 1;
+ if (volume < 0)
+ volume = 0;
+
+ int now = Util.EnvironmentTickCount();
+ if(Util.EnvironmentTickCountSubtract(now,LastColSoundSentTime) <200)
+ return;
+
+ LastColSoundSentTime = now;
+
+ UUID ownerID = OwnerID;
+ UUID objectID = ParentGroup.RootPart.UUID;
+ UUID parentID = ParentGroup.UUID;
+ ulong regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle;
+
+ soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, 0 );
+ }
+
public void PhysicsOutOfBounds(Vector3 pos)
{
m_log.Error("[PHYSICS]: Physical Object went out of bounds.");
--
cgit v1.1
From 5328808b1825ef7d73809c8ddd67542ee05bf575 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Tue, 30 Oct 2012 21:19:00 +0100
Subject: Make sure we're not accessing a physics scene if we're not in one
yet.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 49b771f..165dd85 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -813,7 +813,7 @@ namespace OpenSim.Region.Framework.Scenes
actor.Orientation = GetWorldRotation();
// Tell the physics engines that this prim changed.
- if (ParentGroup.Scene != null)
+ if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null)
ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
}
--
cgit v1.1