diff options
author | Justin Clark-Casey (justincc) | 2012-04-21 00:54:48 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-21 00:54:48 +0100 |
commit | 06552f217ebd9301fd487c788a13fd75d61a46de (patch) | |
tree | 7dba9e0c918dd53c7ce76eae6afa5602473601b1 /OpenSim | |
parent | If a physical prim is manually moved (e.g. by a user) then set the geometry p... (diff) | |
download | opensim-SC_OLD-06552f217ebd9301fd487c788a13fd75d61a46de.zip opensim-SC_OLD-06552f217ebd9301fd487c788a13fd75d61a46de.tar.gz opensim-SC_OLD-06552f217ebd9301fd487c788a13fd75d61a46de.tar.bz2 opensim-SC_OLD-06552f217ebd9301fd487c788a13fd75d61a46de.tar.xz |
Add TestSetPhysics() to SOP status tests
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs | 20 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 2 |
3 files changed, 27 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 046553b..d2cd37d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1706,6 +1706,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1706 | /// <param name="isNew"></param> | 1706 | /// <param name="isNew"></param> |
1707 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) | 1707 | public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) |
1708 | { | 1708 | { |
1709 | if (ParentGroup.Scene == null) | ||
1710 | return; | ||
1711 | |||
1709 | if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) | 1712 | if (!ParentGroup.Scene.PhysicalPrims && UsePhysics) |
1710 | return; | 1713 | return; |
1711 | 1714 | ||
@@ -4161,7 +4164,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4161 | // For now, we use the NINJA naming scheme for identifying joints. | 4164 | // For now, we use the NINJA naming scheme for identifying joints. |
4162 | // In the future, we can support other joint specification schemes such as a | 4165 | // In the future, we can support other joint specification schemes such as a |
4163 | // custom checkbox in the viewer GUI. | 4166 | // custom checkbox in the viewer GUI. |
4164 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4167 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4165 | { | 4168 | { |
4166 | string hingeString = "hingejoint"; | 4169 | string hingeString = "hingejoint"; |
4167 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); | 4170 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); |
@@ -4177,7 +4180,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4177 | // For now, we use the NINJA naming scheme for identifying joints. | 4180 | // For now, we use the NINJA naming scheme for identifying joints. |
4178 | // In the future, we can support other joint specification schemes such as a | 4181 | // In the future, we can support other joint specification schemes such as a |
4179 | // custom checkbox in the viewer GUI. | 4182 | // custom checkbox in the viewer GUI. |
4180 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4183 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4181 | { | 4184 | { |
4182 | string ballString = "balljoint"; | 4185 | string ballString = "balljoint"; |
4183 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); | 4186 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); |
@@ -4193,7 +4196,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4193 | // For now, we use the NINJA naming scheme for identifying joints. | 4196 | // For now, we use the NINJA naming scheme for identifying joints. |
4194 | // In the future, we can support other joint specification schemes such as a | 4197 | // In the future, we can support other joint specification schemes such as a |
4195 | // custom checkbox in the viewer GUI. | 4198 | // custom checkbox in the viewer GUI. |
4196 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4199 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4197 | { | 4200 | { |
4198 | return IsHingeJoint() || IsBallJoint(); | 4201 | return IsHingeJoint() || IsBallJoint(); |
4199 | } | 4202 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs index 2a342d5..16e8b63 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs | |||
@@ -62,5 +62,25 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
62 | 62 | ||
63 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); | 63 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); |
64 | } | 64 | } |
65 | |||
66 | [Test] | ||
67 | public void TestSetPhysics() | ||
68 | { | ||
69 | TestHelpers.InMethod(); | ||
70 | |||
71 | // Scene scene = SceneSetupHelpers.SetupScene(); | ||
72 | SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, UUID.Zero); | ||
73 | SceneObjectPart rootPart = so.RootPart; | ||
74 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); | ||
75 | |||
76 | so.ScriptSetPhysicsStatus(true); | ||
77 | |||
78 | // Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags); | ||
79 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics)); | ||
80 | |||
81 | so.ScriptSetPhysicsStatus(false); | ||
82 | |||
83 | Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); | ||
84 | } | ||
65 | } | 85 | } |
66 | } \ No newline at end of file | 86 | } \ No newline at end of file |
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index 318758d..7a6b1cf 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs | |||
@@ -153,7 +153,7 @@ namespace OpenSim.Tests.Common | |||
153 | PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); | 153 | PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager(); |
154 | physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); | 154 | physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll"); |
155 | testScene.PhysicsScene | 155 | testScene.PhysicsScene |
156 | = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test"); | 156 | = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test"); |
157 | 157 | ||
158 | testScene.RegionInfo.EstateSettings = new EstateSettings(); | 158 | testScene.RegionInfo.EstateSettings = new EstateSettings(); |
159 | testScene.LoginsDisabled = false; | 159 | testScene.LoginsDisabled = false; |