aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common
diff options
context:
space:
mode:
authorMelanie2011-03-27 21:22:31 +0100
committerMelanie2011-03-27 21:22:31 +0100
commitf25749f0259bdfe334f77ab049ac5f892135bbc6 (patch)
tree5fd38027cbe794a1da1d87009f9975d3792f085a /OpenSim/Tests/Common
parentDon't send a windlight profile to clients if windlight is not set for (diff)
parentAdd SignpostMarv to contributors (diff)
downloadopensim-SC_OLD-f25749f0259bdfe334f77ab049ac5f892135bbc6.zip
opensim-SC_OLD-f25749f0259bdfe334f77ab049ac5f892135bbc6.tar.gz
opensim-SC_OLD-f25749f0259bdfe334f77ab049ac5f892135bbc6.tar.bz2
opensim-SC_OLD-f25749f0259bdfe334f77ab049ac5f892135bbc6.tar.xz
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Tests/Common')
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs63
1 files changed, 59 insertions, 4 deletions
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index aa4b285..57850c1 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -454,9 +454,7 @@ namespace OpenSim.Tests.Common.Setup
454 /// <returns></returns> 454 /// <returns></returns>
455 public static SceneObjectPart AddSceneObject(Scene scene, string name) 455 public static SceneObjectPart AddSceneObject(Scene scene, string name)
456 { 456 {
457 SceneObjectPart part 457 SceneObjectPart part = CreateSceneObjectPart(name, UUID.Random(), UUID.Zero);
458 = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
459 part.Name = name;
460 458
461 //part.UpdatePrimFlags(false, false, true); 459 //part.UpdatePrimFlags(false, false, true);
462 //part.ObjectFlags |= (uint)PrimFlags.Phantom; 460 //part.ObjectFlags |= (uint)PrimFlags.Phantom;
@@ -465,5 +463,62 @@ namespace OpenSim.Tests.Common.Setup
465 463
466 return part; 464 return part;
467 } 465 }
466
467 /// <summary>
468 /// Create a scene object part.
469 /// </summary>
470 /// <param name="name"></param>
471 /// <param name="id"></param>
472 /// <param name="ownerId"></param>
473 /// <returns></returns>
474 public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId)
475 {
476 return new SceneObjectPart(
477 ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
478 { Name = name, UUID = id };
479 }
480
481 /// <summary>
482 /// Create a scene object but do not add it to the scene.
483 /// </summary>
484 /// <remarks>
485 /// UUID always starts at 00000000-0000-0000-0000-000000000001
486 /// </remarks>
487 /// <param name="parts">The number of parts that should be in the scene object</param>
488 /// <param name="ownerId"></param>
489 /// <returns></returns>
490 public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId)
491 {
492 return CreateSceneObject(parts, ownerId, 0x1);
493 }
494
495 /// <summary>
496 /// Create a scene object but do not add it to the scene.
497 /// </summary>
498 /// <param name="parts">The number of parts that should be in the scene object</param>
499 /// <param name="ownerId"></param>
500 /// <param name="uuidTail">
501 /// The hexadecimal last part of the UUID for parts created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
502 /// will be given to the root part, and incremented for each part thereafter.
503 /// </param>
504 /// <returns></returns>
505 public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, int uuidTail)
506 {
507 string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail);
508
509 SceneObjectGroup sog
510 = new SceneObjectGroup(
511 CreateSceneObjectPart("part0", new UUID(rawSogId), ownerId));
512
513 if (parts > 1)
514 for (int i = 1; i < parts; i++)
515 sog.AddPart(
516 CreateSceneObjectPart(
517 string.Format("obj{0}", i),
518 new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i)),
519 ownerId));
520
521 return sog;
522 }
468 } 523 }
469} 524} \ No newline at end of file