本文整理汇总了C#中OpenSim.Tests.Common.SceneHelpers.AddSceneObject方法的典型用法代码示例。如果您正苦于以下问题:C# SceneHelpers.AddSceneObject方法的具体用法?C# SceneHelpers.AddSceneObject怎么用?C# SceneHelpers.AddSceneObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Tests.Common.SceneHelpers
的用法示例。
在下文中一共展示了SceneHelpers.AddSceneObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestResizeSceneObjectPart
public void TestResizeSceneObjectPart()
{
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
Scene scene = new SceneHelpers().SetupScene();
SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(2, UUID.Zero);
g1.RootPart.Scale = new Vector3(2, 3, 4);
g1.Parts[1].Scale = new Vector3(5, 6, 7);
scene.AddSceneObject(g1);
SceneObjectGroup g1Post = scene.GetSceneObjectGroup(g1.UUID);
g1Post.Parts[1].Resize(new Vector3(8, 9, 10));
SceneObjectGroup g1PostPost = scene.GetSceneObjectGroup(g1.UUID);
SceneObjectPart g1RootPart = g1PostPost.RootPart;
SceneObjectPart g1ChildPart = g1PostPost.Parts[1];
Assert.That(g1RootPart.Scale.X, Is.EqualTo(2));
Assert.That(g1RootPart.Scale.Y, Is.EqualTo(3));
Assert.That(g1RootPart.Scale.Z, Is.EqualTo(4));
Assert.That(g1ChildPart.Scale.X, Is.EqualTo(8));
Assert.That(g1ChildPart.Scale.Y, Is.EqualTo(9));
Assert.That(g1ChildPart.Scale.Z, Is.EqualTo(10));
}
示例2: TestLinkToSelf
public void TestLinkToSelf()
{
TestHelpers.InMethod();
UUID ownerId = TestHelpers.ParseTail(0x1);
int nParts = 3;
TestScene scene = new SceneHelpers().SetupScene();
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10);
scene.AddSceneObject(sog1);
scene.LinkObjects(ownerId, sog1.LocalId, new List<uint>() { sog1.Parts[1].LocalId });
// sog1.LinkToGroup(sog1);
Assert.That(sog1.Parts.Length, Is.EqualTo(nParts));
}
示例3: TestRezObjectFromInventoryItem
public void TestRezObjectFromInventoryItem()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
Scene scene = new SceneHelpers().SetupScene();
UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
SceneObjectPart sop1 = sog1.RootPart;
// Create an object embedded inside the first
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
TaskInventoryItem taskSceneObjectItem
= TaskInventoryHelpers.AddSceneObject(scene.AssetService, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
scene.AddSceneObject(sog1);
Vector3 rezPos = new Vector3(10, 10, 10);
Quaternion rezRot = new Quaternion(0.5f, 0.5f, 0.5f, 0.5f);
Vector3 rezVel = new Vector3(2, 2, 2);
scene.RezObject(sop1, taskSceneObjectItem, rezPos, rezRot, rezVel, 0);
SceneObjectGroup rezzedObject = scene.GetSceneObjectGroup("tso");
Assert.That(rezzedObject, Is.Not.Null);
Assert.That(rezzedObject.AbsolutePosition, Is.EqualTo(rezPos));
// Velocity doesn't get applied, probably because there is no physics in tests (yet)
// Assert.That(rezzedObject.Velocity, Is.EqualTo(rezVel));
Assert.That(rezzedObject.Velocity, Is.EqualTo(Vector3.Zero));
// Confusingly, this isn't the rezzedObject.Rotation
Assert.That(rezzedObject.RootPart.RotationOffset, Is.EqualTo(rezRot));
}