示例#1
0
        private void ObjectLoadedHandler(AssetPrim linkset, long bytesRead, long totalBytes)
        {
            if (m_primMesher == null)
            {
                return;
            }

            // Get the root prim
            LLPrimitive parent = LLUtil.PrimObjectToLLPrim(linkset.Parent, m_scene, m_primMesher);

            // Get the child prims and sort them by link order
            SortedList <int, LLPrimitive> children = new SortedList <int, LLPrimitive>(linkset.Children.Count);

            for (int i = 0; i < linkset.Children.Count; i++)
            {
                children.Add(linkset.Children[i].LinkNumber, LLUtil.PrimObjectToLLPrim(linkset.Children[i], m_scene, m_primMesher));
            }

            // Set the child prims as children of the root, in order
            foreach (LLPrimitive child in children.Values)
            {
                child.SetParent(parent, false, false);
            }

            // Send updates for everything
            m_scene.EntityAddOrUpdate(this, parent, UpdateFlags.FullUpdate, 0);
            foreach (LLPrimitive child in children.Values)
            {
                m_scene.EntityAddOrUpdate(this, child, UpdateFlags.FullUpdate, 0);
            }

            PrintProgress(bytesRead, totalBytes);
        }