aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-05-20 23:22:27 +0100
committerJustin Clark-Casey (justincc)2011-05-20 23:22:27 +0100
commit7ed419217fc63f7a01c13a7c3320e97edd6bb1b6 (patch)
tree103b12378cd343109eeb4a9e933def63dff77168 /OpenSim/Region
parentImplement llGetLinKNumberOfSides(). (diff)
downloadopensim-SC_OLD-7ed419217fc63f7a01c13a7c3320e97edd6bb1b6.zip
opensim-SC_OLD-7ed419217fc63f7a01c13a7c3320e97edd6bb1b6.tar.gz
opensim-SC_OLD-7ed419217fc63f7a01c13a7c3320e97edd6bb1b6.tar.bz2
opensim-SC_OLD-7ed419217fc63f7a01c13a7c3320e97edd6bb1b6.tar.xz
add test for rezzing an object from a prim item
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs45
3 files changed, 49 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 9df7340..0722cee 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1971,8 +1971,9 @@ namespace OpenSim.Region.Framework.Scenes
1971 /// <summary> 1971 /// <summary>
1972 /// Add a newly created object to the scene. 1972 /// Add a newly created object to the scene.
1973 /// </summary> 1973 /// </summary>
1974 /// 1974 /// <remarks>
1975 /// This method does not send updates to the client - callers need to handle this themselves. 1975 /// This method does not send updates to the client - callers need to handle this themselves.
1976 /// </remarks>
1976 /// <param name="sceneObject"></param> 1977 /// <param name="sceneObject"></param>
1977 /// <param name="attachToBackup"></param> 1978 /// <param name="attachToBackup"></param>
1978 /// <param name="pos">Position of the object</param> 1979 /// <param name="pos">Position of the object</param>
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index fc31b65..14b587f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -344,6 +344,9 @@ namespace OpenSim.Region.Framework.Scenes
344 /// Add an object to the scene. This will both update the scene, and send information about the 344 /// Add an object to the scene. This will both update the scene, and send information about the
345 /// new object to all clients interested in the scene. 345 /// new object to all clients interested in the scene.
346 /// </summary> 346 /// </summary>
347 /// <remarks>
348 /// The object's stored position, rotation and velocity are used.
349 /// </remarks>
347 /// <param name="sceneObject"></param> 350 /// <param name="sceneObject"></param>
348 /// <param name="attachToBackup"> 351 /// <param name="attachToBackup">
349 /// If true, the object is made persistent into the scene. 352 /// If true, the object is made persistent into the scene.
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 2aef4b0..73f66cb 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -90,11 +90,54 @@ namespace OpenSim.Region.Framework.Tests
90 90
91 return ncItem; 91 return ncItem;
92 } 92 }
93 93
94 [Test]
95 public void TestRezObjectFromInventoryItem()
96 {
97 TestHelper.InMethod();
98// log4net.Config.XmlConfigurator.Configure();
99
100 Scene scene = SceneSetupHelpers.SetupScene();
101 UserAccount user1 = CreateUser(scene);
102 SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
103 SceneObjectPart sop1 = sog1.RootPart;
104
105 // Create an object embedded inside the first
106 UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
107
108 SceneObjectGroup taskSceneObject = SceneSetupHelpers.CreateSceneObject(1, UUID.Zero);
109 AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
110 scene.AssetService.Store(taskSceneObjectAsset);
111 TaskInventoryItem taskSceneObjectItem
112 = new TaskInventoryItem
113 { Name = "tso", AssetID = taskSceneObjectAsset.FullID, ItemID = taskSceneObjectItemId,
114 Type = (int)AssetType.Object, InvType = (int)InventoryType.Object };
115 sop1.Inventory.AddInventoryItem(taskSceneObjectItem, true);
116
117 scene.AddSceneObject(sog1);
118
119 Vector3 rezPos = new Vector3(10, 10, 10);
120 Quaternion rezRot = new Quaternion(0.5f, 0.5f, 0.5f, 0.5f);
121 Vector3 rezVel = new Vector3(2, 2, 2);
122
123 scene.RezObject(sop1, taskSceneObjectItem, rezPos, rezRot, rezVel, 0);
124
125 SceneObjectPart rezzedObjectPart = scene.GetSceneObjectPart("tso");
126
127 Assert.That(rezzedObjectPart, Is.Not.Null);
128 Assert.That(rezzedObjectPart.AbsolutePosition, Is.EqualTo(rezPos));
129 Assert.That(rezzedObjectPart.RotationOffset, Is.EqualTo(rezRot));
130
131 // Velocity isn't being set, possibly because we have no physics
132 //Assert.That(rezzedObjectPart.Velocity, Is.EqualTo(rezVel));
133 }
134
94 /// <summary> 135 /// <summary>
95 /// Test MoveTaskInventoryItem where the item has no parent folder assigned. 136 /// Test MoveTaskInventoryItem where the item has no parent folder assigned.
96 /// </summary> 137 /// </summary>
138 /// <remarks>
97 /// This should place it in the most suitable user folder. 139 /// This should place it in the most suitable user folder.
140 /// </remarks>
98 [Test] 141 [Test]
99 public void TestMoveTaskInventoryItem() 142 public void TestMoveTaskInventoryItem()
100 { 143 {