diff options
Diffstat (limited to 'OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs')
-rw-r--r-- | OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 69 |
1 files changed, 65 insertions, 4 deletions
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index aa4b285..709dd78 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,68 @@ 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"> | ||
499 | /// The number of parts that should be in the scene object | ||
500 | /// </param> | ||
501 | /// <param name="ownerId"></param> | ||
502 | /// <param name="partNamePrefix"> | ||
503 | /// The prefix to be given to part names. This will be suffixed with "Part<part no>" | ||
504 | /// (e.g. mynamePart0 for the root part) | ||
505 | /// </param> | ||
506 | /// <param name="uuidTail"> | ||
507 | /// The hexadecimal last part of the UUID for parts created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}" | ||
508 | /// will be given to the root part, and incremented for each part thereafter. | ||
509 | /// </param> | ||
510 | /// <returns></returns> | ||
511 | public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, string partNamePrefix, int uuidTail) | ||
512 | { | ||
513 | string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail); | ||
514 | |||
515 | SceneObjectGroup sog | ||
516 | = new SceneObjectGroup( | ||
517 | CreateSceneObjectPart(string.Format("{0}Part0", partNamePrefix), new UUID(rawSogId), ownerId)); | ||
518 | |||
519 | if (parts > 1) | ||
520 | for (int i = 1; i < parts; i++) | ||
521 | sog.AddPart( | ||
522 | CreateSceneObjectPart( | ||
523 | string.Format("{0}Part{1}", partNamePrefix, i), | ||
524 | new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i)), | ||
525 | ownerId)); | ||
526 | |||
527 | return sog; | ||
528 | } | ||
468 | } | 529 | } |
469 | } | 530 | } \ No newline at end of file |