diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 39 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 60 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 109 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | 2 |
6 files changed, 192 insertions, 42 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 57fcf51..2499460 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -103,8 +103,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
103 | /// </summary> | 103 | /// </summary> |
104 | public bool CollidablePrims { get; private set; } | 104 | public bool CollidablePrims { get; private set; } |
105 | 105 | ||
106 | /// <summary> | ||
107 | /// Minimum value of the size of a non-physical prim in each axis | ||
108 | /// </summary> | ||
109 | public float m_minNonphys = 0.01f; | ||
110 | |||
111 | /// <summary> | ||
112 | /// Maximum value of the size of a non-physical prim in each axis | ||
113 | /// </summary> | ||
106 | public float m_maxNonphys = 256; | 114 | public float m_maxNonphys = 256; |
115 | |||
116 | /// <summary> | ||
117 | /// Minimum value of the size of a physical prim in each axis | ||
118 | /// </summary> | ||
119 | public float m_minPhys = 0.01f; | ||
120 | |||
121 | /// <summary> | ||
122 | /// Maximum value of the size of a physical prim in each axis | ||
123 | /// </summary> | ||
107 | public float m_maxPhys = 10; | 124 | public float m_maxPhys = 10; |
125 | |||
108 | public bool m_clampPrimSize; | 126 | public bool m_clampPrimSize; |
109 | public bool m_trustBinaries; | 127 | public bool m_trustBinaries; |
110 | public bool m_allowScriptCrossings; | 128 | public bool m_allowScriptCrossings; |
@@ -746,12 +764,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
746 | PhysicalPrims = startupConfig.GetBoolean("physical_prim", true); | 764 | PhysicalPrims = startupConfig.GetBoolean("physical_prim", true); |
747 | CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); | 765 | CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); |
748 | 766 | ||
767 | m_minNonphys = startupConfig.GetFloat("NonphysicalPrimMin", m_minNonphys); | ||
768 | if (RegionInfo.NonphysPrimMin > 0) | ||
769 | { | ||
770 | m_minNonphys = RegionInfo.NonphysPrimMin; | ||
771 | } | ||
772 | |||
749 | m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys); | 773 | m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys); |
750 | if (RegionInfo.NonphysPrimMax > 0) | 774 | if (RegionInfo.NonphysPrimMax > 0) |
751 | { | 775 | { |
752 | m_maxNonphys = RegionInfo.NonphysPrimMax; | 776 | m_maxNonphys = RegionInfo.NonphysPrimMax; |
753 | } | 777 | } |
754 | 778 | ||
779 | m_minPhys = startupConfig.GetFloat("PhysicalPrimMin", m_minPhys); | ||
780 | if (RegionInfo.PhysPrimMin > 0) | ||
781 | { | ||
782 | m_minPhys = RegionInfo.PhysPrimMin; | ||
783 | } | ||
784 | |||
755 | m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys); | 785 | m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys); |
756 | 786 | ||
757 | if (RegionInfo.PhysPrimMax > 0) | 787 | if (RegionInfo.PhysPrimMax > 0) |
@@ -4310,15 +4340,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
4310 | /// Tell a single agent to disconnect from the region. | 4340 | /// Tell a single agent to disconnect from the region. |
4311 | /// </summary> | 4341 | /// </summary> |
4312 | /// <param name="agentID"></param> | 4342 | /// <param name="agentID"></param> |
4313 | /// <param name="childOnly"></param> | 4343 | /// <param name="force"> |
4314 | public bool IncomingCloseAgent(UUID agentID, bool childOnly) | 4344 | /// Force the agent to close even if it might be in the middle of some other operation. You do not want to |
4345 | /// force unless you are absolutely sure that the agent is dead and a normal close is not working. | ||
4346 | /// </param> | ||
4347 | public bool IncomingCloseAgent(UUID agentID, bool force) | ||
4315 | { | 4348 | { |
4316 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); | 4349 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); |
4317 | 4350 | ||
4318 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); | 4351 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); |
4319 | if (presence != null) | 4352 | if (presence != null) |
4320 | { | 4353 | { |
4321 | presence.ControllingClient.Close(); | 4354 | presence.ControllingClient.Close(true, force); |
4322 | return true; | 4355 | return true; |
4323 | } | 4356 | } |
4324 | 4357 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index e29b2c1..fa66858 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -421,12 +421,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
421 | { | 421 | { |
422 | Vector3 scale = part.Shape.Scale; | 422 | Vector3 scale = part.Shape.Scale; |
423 | 423 | ||
424 | if (scale.X > m_parentScene.m_maxNonphys) | 424 | scale.X = Math.Max(m_parentScene.m_minNonphys, Math.Min(m_parentScene.m_maxNonphys, scale.X)); |
425 | scale.X = m_parentScene.m_maxNonphys; | 425 | scale.Y = Math.Max(m_parentScene.m_minNonphys, Math.Min(m_parentScene.m_maxNonphys, scale.Y)); |
426 | if (scale.Y > m_parentScene.m_maxNonphys) | 426 | scale.Z = Math.Max(m_parentScene.m_minNonphys, Math.Min(m_parentScene.m_maxNonphys, scale.Z)); |
427 | scale.Y = m_parentScene.m_maxNonphys; | ||
428 | if (scale.Z > m_parentScene.m_maxNonphys) | ||
429 | scale.Z = m_parentScene.m_maxNonphys; | ||
430 | 427 | ||
431 | part.Shape.Scale = scale; | 428 | part.Shape.Scale = scale; |
432 | } | 429 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index eee53d7..fcb1571 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3450,17 +3450,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3450 | /// <param name="scale"></param> | 3450 | /// <param name="scale"></param> |
3451 | public void GroupResize(Vector3 scale) | 3451 | public void GroupResize(Vector3 scale) |
3452 | { | 3452 | { |
3453 | scale.X = Math.Min(scale.X, Scene.m_maxNonphys); | 3453 | scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X)); |
3454 | scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); | 3454 | scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y)); |
3455 | scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); | 3455 | scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z)); |
3456 | 3456 | ||
3457 | PhysicsActor pa = m_rootPart.PhysActor; | 3457 | PhysicsActor pa = m_rootPart.PhysActor; |
3458 | 3458 | ||
3459 | if (pa != null && pa.IsPhysical) | 3459 | if (pa != null && pa.IsPhysical) |
3460 | { | 3460 | { |
3461 | scale.X = Math.Min(scale.X, Scene.m_maxPhys); | 3461 | scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X)); |
3462 | scale.Y = Math.Min(scale.Y, Scene.m_maxPhys); | 3462 | scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y)); |
3463 | scale.Z = Math.Min(scale.Z, Scene.m_maxPhys); | 3463 | scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z)); |
3464 | } | 3464 | } |
3465 | 3465 | ||
3466 | float x = (scale.X / RootPart.Scale.X); | 3466 | float x = (scale.X / RootPart.Scale.X); |
@@ -3491,6 +3491,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3491 | y *= a; | 3491 | y *= a; |
3492 | z *= a; | 3492 | z *= a; |
3493 | } | 3493 | } |
3494 | else if (oldSize.X * x < m_scene.m_minPhys) | ||
3495 | { | ||
3496 | f = m_scene.m_minPhys / oldSize.X; | ||
3497 | a = f / x; | ||
3498 | x *= a; | ||
3499 | y *= a; | ||
3500 | z *= a; | ||
3501 | } | ||
3494 | 3502 | ||
3495 | if (oldSize.Y * y > m_scene.m_maxPhys) | 3503 | if (oldSize.Y * y > m_scene.m_maxPhys) |
3496 | { | 3504 | { |
@@ -3500,6 +3508,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3500 | y *= a; | 3508 | y *= a; |
3501 | z *= a; | 3509 | z *= a; |
3502 | } | 3510 | } |
3511 | else if (oldSize.Y * y < m_scene.m_minPhys) | ||
3512 | { | ||
3513 | f = m_scene.m_minPhys / oldSize.Y; | ||
3514 | a = f / y; | ||
3515 | x *= a; | ||
3516 | y *= a; | ||
3517 | z *= a; | ||
3518 | } | ||
3503 | 3519 | ||
3504 | if (oldSize.Z * z > m_scene.m_maxPhys) | 3520 | if (oldSize.Z * z > m_scene.m_maxPhys) |
3505 | { | 3521 | { |
@@ -3509,6 +3525,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3509 | y *= a; | 3525 | y *= a; |
3510 | z *= a; | 3526 | z *= a; |
3511 | } | 3527 | } |
3528 | else if (oldSize.Z * z < m_scene.m_minPhys) | ||
3529 | { | ||
3530 | f = m_scene.m_minPhys / oldSize.Z; | ||
3531 | a = f / z; | ||
3532 | x *= a; | ||
3533 | y *= a; | ||
3534 | z *= a; | ||
3535 | } | ||
3512 | } | 3536 | } |
3513 | else | 3537 | else |
3514 | { | 3538 | { |
@@ -3520,6 +3544,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3520 | y *= a; | 3544 | y *= a; |
3521 | z *= a; | 3545 | z *= a; |
3522 | } | 3546 | } |
3547 | else if (oldSize.X * x < m_scene.m_minNonphys) | ||
3548 | { | ||
3549 | f = m_scene.m_minNonphys / oldSize.X; | ||
3550 | a = f / x; | ||
3551 | x *= a; | ||
3552 | y *= a; | ||
3553 | z *= a; | ||
3554 | } | ||
3523 | 3555 | ||
3524 | if (oldSize.Y * y > m_scene.m_maxNonphys) | 3556 | if (oldSize.Y * y > m_scene.m_maxNonphys) |
3525 | { | 3557 | { |
@@ -3529,6 +3561,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3529 | y *= a; | 3561 | y *= a; |
3530 | z *= a; | 3562 | z *= a; |
3531 | } | 3563 | } |
3564 | else if (oldSize.Y * y < m_scene.m_minNonphys) | ||
3565 | { | ||
3566 | f = m_scene.m_minNonphys / oldSize.Y; | ||
3567 | a = f / y; | ||
3568 | x *= a; | ||
3569 | y *= a; | ||
3570 | z *= a; | ||
3571 | } | ||
3532 | 3572 | ||
3533 | if (oldSize.Z * z > m_scene.m_maxNonphys) | 3573 | if (oldSize.Z * z > m_scene.m_maxNonphys) |
3534 | { | 3574 | { |
@@ -3538,6 +3578,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3538 | y *= a; | 3578 | y *= a; |
3539 | z *= a; | 3579 | z *= a; |
3540 | } | 3580 | } |
3581 | else if (oldSize.Z * z < m_scene.m_minNonphys) | ||
3582 | { | ||
3583 | f = m_scene.m_minNonphys / oldSize.Z; | ||
3584 | a = f / z; | ||
3585 | x *= a; | ||
3586 | y *= a; | ||
3587 | z *= a; | ||
3588 | } | ||
3541 | } | 3589 | } |
3542 | } | 3590 | } |
3543 | } | 3591 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ed626d0..4ed3413 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -790,7 +790,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
790 | } | 790 | } |
791 | catch (Exception e) | 791 | catch (Exception e) |
792 | { | 792 | { |
793 | m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); | 793 | m_log.ErrorFormat("[SCENEOBJECTPART]: GROUP POSITION. {0}", e); |
794 | } | 794 | } |
795 | } | 795 | } |
796 | } | 796 | } |
@@ -2969,17 +2969,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2969 | /// <param name="scale"></param> | 2969 | /// <param name="scale"></param> |
2970 | public void Resize(Vector3 scale) | 2970 | public void Resize(Vector3 scale) |
2971 | { | 2971 | { |
2972 | scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxNonphys); | 2972 | scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X)); |
2973 | scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxNonphys); | 2973 | scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y)); |
2974 | scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxNonphys); | 2974 | scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z)); |
2975 | 2975 | ||
2976 | PhysicsActor pa = PhysActor; | 2976 | PhysicsActor pa = PhysActor; |
2977 | |||
2978 | if (pa != null && pa.IsPhysical) | 2977 | if (pa != null && pa.IsPhysical) |
2979 | { | 2978 | { |
2980 | scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxPhys); | 2979 | scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X)); |
2981 | scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxPhys); | 2980 | scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y)); |
2982 | scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxPhys); | 2981 | scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z)); |
2983 | } | 2982 | } |
2984 | 2983 | ||
2985 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); | 2984 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); |
@@ -3561,23 +3560,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
3561 | } | 3560 | } |
3562 | 3561 | ||
3563 | /// <summary> | 3562 | /// <summary> |
3564 | /// Set the color of prim faces | 3563 | /// Set the color & alpha of prim faces |
3565 | /// </summary> | 3564 | /// </summary> |
3566 | /// <param name="color"></param> | ||
3567 | /// <param name="face"></param> | 3565 | /// <param name="face"></param> |
3568 | public void SetFaceColor(Vector3 color, int face) | 3566 | /// <param name="color"></param> |
3567 | /// <param name="alpha"></param> | ||
3568 | public void SetFaceColorAlpha(int face, Vector3 color, double ?alpha) | ||
3569 | { | 3569 | { |
3570 | Vector3 clippedColor = Util.Clip(color, 0.0f, 1.0f); | ||
3571 | float clippedAlpha = alpha.HasValue ? | ||
3572 | Util.Clip((float)alpha.Value, 0.0f, 1.0f) : 0; | ||
3573 | |||
3570 | // The only way to get a deep copy/ If we don't do this, we can | 3574 | // The only way to get a deep copy/ If we don't do this, we can |
3571 | // mever detect color changes further down. | 3575 | // never detect color changes further down. |
3572 | Byte[] buf = Shape.Textures.GetBytes(); | 3576 | Byte[] buf = Shape.Textures.GetBytes(); |
3573 | Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length); | 3577 | Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length); |
3574 | Color4 texcolor; | 3578 | Color4 texcolor; |
3575 | if (face >= 0 && face < GetNumberOfSides()) | 3579 | if (face >= 0 && face < GetNumberOfSides()) |
3576 | { | 3580 | { |
3577 | texcolor = tex.CreateFace((uint)face).RGBA; | 3581 | texcolor = tex.CreateFace((uint)face).RGBA; |
3578 | texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); | 3582 | texcolor.R = clippedColor.X; |
3579 | texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); | 3583 | texcolor.G = clippedColor.Y; |
3580 | texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); | 3584 | texcolor.B = clippedColor.Z; |
3585 | if (alpha.HasValue) | ||
3586 | { | ||
3587 | texcolor.A = clippedAlpha; | ||
3588 | } | ||
3581 | tex.FaceTextures[face].RGBA = texcolor; | 3589 | tex.FaceTextures[face].RGBA = texcolor; |
3582 | UpdateTextureEntry(tex.GetBytes()); | 3590 | UpdateTextureEntry(tex.GetBytes()); |
3583 | return; | 3591 | return; |
@@ -3589,15 +3597,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
3589 | if (tex.FaceTextures[i] != null) | 3597 | if (tex.FaceTextures[i] != null) |
3590 | { | 3598 | { |
3591 | texcolor = tex.FaceTextures[i].RGBA; | 3599 | texcolor = tex.FaceTextures[i].RGBA; |
3592 | texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); | 3600 | texcolor.R = clippedColor.X; |
3593 | texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); | 3601 | texcolor.G = clippedColor.Y; |
3594 | texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); | 3602 | texcolor.B = clippedColor.Z; |
3603 | if (alpha.HasValue) | ||
3604 | { | ||
3605 | texcolor.A = clippedAlpha; | ||
3606 | } | ||
3595 | tex.FaceTextures[i].RGBA = texcolor; | 3607 | tex.FaceTextures[i].RGBA = texcolor; |
3596 | } | 3608 | } |
3597 | texcolor = tex.DefaultTexture.RGBA; | 3609 | texcolor = tex.DefaultTexture.RGBA; |
3598 | texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); | 3610 | texcolor.R = clippedColor.X; |
3599 | texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); | 3611 | texcolor.G = clippedColor.Y; |
3600 | texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); | 3612 | texcolor.B = clippedColor.Z; |
3613 | if (alpha.HasValue) | ||
3614 | { | ||
3615 | texcolor.A = clippedAlpha; | ||
3616 | } | ||
3601 | tex.DefaultTexture.RGBA = texcolor; | 3617 | tex.DefaultTexture.RGBA = texcolor; |
3602 | } | 3618 | } |
3603 | UpdateTextureEntry(tex.GetBytes()); | 3619 | UpdateTextureEntry(tex.GetBytes()); |
@@ -4885,6 +4901,57 @@ namespace OpenSim.Region.Framework.Scenes | |||
4885 | ScheduleFullUpdate(); | 4901 | ScheduleFullUpdate(); |
4886 | } | 4902 | } |
4887 | 4903 | ||
4904 | public void UpdateSlice(float begin, float end) | ||
4905 | { | ||
4906 | if (end < begin) | ||
4907 | { | ||
4908 | float temp = begin; | ||
4909 | begin = end; | ||
4910 | end = temp; | ||
4911 | } | ||
4912 | end = Math.Min(1f, Math.Max(0f, end)); | ||
4913 | begin = Math.Min(Math.Min(1f, Math.Max(0f, begin)), end - 0.02f); | ||
4914 | if (begin < 0.02f && end < 0.02f) | ||
4915 | { | ||
4916 | begin = 0f; | ||
4917 | end = 0.02f; | ||
4918 | } | ||
4919 | |||
4920 | ushort uBegin = (ushort)(50000.0 * begin); | ||
4921 | ushort uEnd = (ushort)(50000.0 * (1f - end)); | ||
4922 | bool updatePossiblyNeeded = false; | ||
4923 | PrimType primType = GetPrimType(); | ||
4924 | if (primType == PrimType.SPHERE || primType == PrimType.TORUS || primType == PrimType.TUBE || primType == PrimType.RING) | ||
4925 | { | ||
4926 | if (m_shape.ProfileBegin != uBegin || m_shape.ProfileEnd != uEnd) | ||
4927 | { | ||
4928 | m_shape.ProfileBegin = uBegin; | ||
4929 | m_shape.ProfileEnd = uEnd; | ||
4930 | updatePossiblyNeeded = true; | ||
4931 | } | ||
4932 | } | ||
4933 | else if (m_shape.PathBegin != uBegin || m_shape.PathEnd != uEnd) | ||
4934 | { | ||
4935 | m_shape.PathBegin = uBegin; | ||
4936 | m_shape.PathEnd = uEnd; | ||
4937 | updatePossiblyNeeded = true; | ||
4938 | } | ||
4939 | |||
4940 | if (updatePossiblyNeeded && ParentGroup != null) | ||
4941 | { | ||
4942 | ParentGroup.HasGroupChanged = true; | ||
4943 | } | ||
4944 | if (updatePossiblyNeeded && PhysActor != null) | ||
4945 | { | ||
4946 | PhysActor.Shape = m_shape; | ||
4947 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | ||
4948 | } | ||
4949 | if (updatePossiblyNeeded) | ||
4950 | { | ||
4951 | ScheduleFullUpdate(); | ||
4952 | } | ||
4953 | } | ||
4954 | |||
4888 | /// <summary> | 4955 | /// <summary> |
4889 | /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics | 4956 | /// If the part is a sculpt/mesh, retrieve the mesh data and reinsert it into the shape so that the physics |
4890 | /// engine can use it. | 4957 | /// engine can use it. |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 47b2ead..cfd4a51 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1527,17 +1527,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
1527 | bool DCFlagKeyPressed = false; | 1527 | bool DCFlagKeyPressed = false; |
1528 | Vector3 agent_control_v3 = Vector3.Zero; | 1528 | Vector3 agent_control_v3 = Vector3.Zero; |
1529 | 1529 | ||
1530 | bool oldflying = Flying; | 1530 | bool newFlying = actor.Flying; |
1531 | 1531 | ||
1532 | if (ForceFly) | 1532 | if (ForceFly) |
1533 | actor.Flying = true; | 1533 | newFlying = true; |
1534 | else if (FlyDisabled) | 1534 | else if (FlyDisabled) |
1535 | actor.Flying = false; | 1535 | newFlying = false; |
1536 | else | 1536 | else |
1537 | actor.Flying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | 1537 | newFlying = ((flags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); |
1538 | 1538 | ||
1539 | if (actor.Flying != oldflying) | 1539 | if (actor.Flying != newFlying) |
1540 | { | ||
1541 | // Note: ScenePresence.Flying is actually fetched from the physical actor | ||
1542 | // so setting PhysActor.Flying here also sets the ScenePresence's value. | ||
1543 | actor.Flying = newFlying; | ||
1540 | update_movementflag = true; | 1544 | update_movementflag = true; |
1545 | } | ||
1541 | 1546 | ||
1542 | if (ParentID == 0) | 1547 | if (ParentID == 0) |
1543 | { | 1548 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index 5758869..5faf131 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
141 | TestScene scene = new SceneHelpers().SetupScene(); | 141 | TestScene scene = new SceneHelpers().SetupScene(); |
142 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); | 142 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); |
143 | 143 | ||
144 | scene.IncomingCloseAgent(sp.UUID); | 144 | scene.IncomingCloseAgent(sp.UUID, false); |
145 | 145 | ||
146 | Assert.That(scene.GetScenePresence(sp.UUID), Is.Null); | 146 | Assert.That(scene.GetScenePresence(sp.UUID), Is.Null); |
147 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null); | 147 | Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null); |