aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
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
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')
-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
-rw-r--r--OpenSim/Tests/Common/Setup/AssetHelpers.cs20
4 files changed, 66 insertions, 5 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 {
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
index d572249..aa55bcd 100644
--- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
@@ -56,10 +56,24 @@ namespace OpenSim.Tests.Common
56 AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); 56 AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
57 scene.AssetService.Store(asset); 57 scene.AssetService.Store(asset);
58 return asset; 58 return asset;
59 } 59 }
60
61 /// <summary>
62 /// Create an asset from the given object.
63 /// </summary>
64 /// <param name="assetUuidTail">
65 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
66 /// will be used.
67 /// </param>
68 /// <param name="sog"></param>
69 /// <returns></returns>
70 public static AssetBase CreateAsset(int assetUuidTail, SceneObjectGroup sog)
71 {
72 return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), sog);
73 }
60 74
61 /// <summary> 75 /// <summary>
62 /// Create an asset from the given scene object. 76 /// Create an asset from the given object.
63 /// </summary> 77 /// </summary>
64 /// <param name="assetUuid"></param> 78 /// <param name="assetUuid"></param>
65 /// <param name="sog"></param> 79 /// <param name="sog"></param>
@@ -76,7 +90,7 @@ namespace OpenSim.Tests.Common
76 /// <summary> 90 /// <summary>
77 /// Create an asset from the given scene object. 91 /// Create an asset from the given scene object.
78 /// </summary> 92 /// </summary>
79 /// <param name="assetUuidTailZ"> 93 /// <param name="assetUuidTail">
80 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}" 94 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
81 /// will be used. 95 /// will be used.
82 /// </param> 96 /// </param>