本文整理汇总了C#中OpenSim.Tests.Common.SceneHelpers.RezObject方法的典型用法代码示例。如果您正苦于以下问题:C# SceneHelpers.RezObject方法的具体用法?C# SceneHelpers.RezObject怎么用?C# SceneHelpers.RezObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Tests.Common.SceneHelpers
的用法示例。
在下文中一共展示了SceneHelpers.RezObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}