llCreateLink() 공개 메소드

public llCreateLink ( string target, int parent ) : void
target string
parent int
리턴 void
예제 #1
0
        public void TestllCreateLink()
        {
            TestHelpers.InMethod();

            UUID ownerId = TestHelpers.ParseTail(0x1);

            SceneObjectGroup grp1 = SceneHelpers.CreateSceneObject(2, ownerId, "grp1-", 0x10);
            grp1.AbsolutePosition = new Vector3(10, 10, 10);
            m_scene.AddSceneObject(grp1);

            // FIXME: This should really be a script item (with accompanying script)
            TaskInventoryItem grp1Item
                = TaskInventoryHelpers.AddNotecard(
                    m_scene, grp1.RootPart, "ncItem", TestHelpers.ParseTail(0x800), TestHelpers.ParseTail(0x900), "Hello World!");
            grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;

            SceneObjectGroup grp2 = SceneHelpers.CreateSceneObject(2, ownerId, "grp2-", 0x20);
            grp2.AbsolutePosition = new Vector3(20, 20, 20);

            // <180,0,0>
            grp2.UpdateGroupRotationR(Quaternion.CreateFromEulers(180 * Utils.DEG_TO_RAD, 0, 0));

            m_scene.AddSceneObject(grp2);

            LSL_Api apiGrp1 = new LSL_Api();
            apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null);

            apiGrp1.llCreateLink(grp2.UUID.ToString(), ScriptBaseClass.TRUE);

            Assert.That(grp1.Parts.Length, Is.EqualTo(4));
            Assert.That(grp2.IsDeleted, Is.True);
        }