当前位置: 首页>>代码示例>>C#>>正文


C# Primitive.CreateFace方法代码示例

本文整理汇总了C#中OpenMetaverse.Primitive.CreateFace方法的典型用法代码示例。如果您正苦于以下问题:C# Primitive.CreateFace方法的具体用法?C# Primitive.CreateFace怎么用?C# Primitive.CreateFace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenMetaverse.Primitive的用法示例。


在下文中一共展示了Primitive.CreateFace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CaptureAppearanceSettings

        private void CaptureAppearanceSettings(IClientAPI remoteClient, Primitive.TextureEntry textureEntry, byte[] visualParams, Vector3 avSize, WearableCacheItem[] cacheItems)
        {
            int maxCacheitemsLoop = cacheItems.Length;
            if (maxCacheitemsLoop > AvatarWearable.MAX_WEARABLES)
            {
                maxCacheitemsLoop = AvatarWearable.MAX_WEARABLES;
                m_log.WarnFormat("[CACHEDBAKES]: Too Many Cache items Provided {0}, the max is {1}.  Truncating!", cacheItems.Length, AvatarWearable.MAX_WEARABLES);
            }

            m_BakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>();
            if (cacheItems.Length > 0)
            {
//                m_log.Debug("[Cacheitems]: " + cacheItems.Length);
//                for (int iter = 0; iter < maxCacheitemsLoop; iter++)
//                {
//                    m_log.Debug("[Cacheitems] {" + iter + "/" + cacheItems[iter].TextureIndex + "}: c-" + cacheItems[iter].CacheId + ", t-" +
//                                      cacheItems[iter].TextureID);
//                }
               
                ScenePresence p = null;
                if (m_scene.TryGetScenePresence(remoteClient.AgentId, out p))
                {

                    WearableCacheItem[] existingitems = p.Appearance.WearableCacheItems;
                    if (existingitems == null)
                    {
                        if (m_BakedTextureModule != null)
                        {
                            WearableCacheItem[] savedcache = null;
                            try
                            {
                                if (p.Appearance.WearableCacheItemsDirty)
                                {
                                    savedcache = m_BakedTextureModule.Get(p.UUID);
                                    p.Appearance.WearableCacheItems = savedcache;
                                    p.Appearance.WearableCacheItemsDirty = false;
                                }

                            }
                            /*
                             * The following Catch types DO NOT WORK with m_BakedTextureModule.Get
                             * it jumps to the General Packet Exception Handler if you don't catch Exception!
                             * 
                            catch (System.Net.Sockets.SocketException)
                            {
                                cacheItems = null;
                            }
                            catch (WebException)
                            {
                                cacheItems = null;
                            }
                            catch (InvalidOperationException)
                            {
                                cacheItems = null;
                            } */
                            catch (Exception)
                            {
                               // The service logs a sufficient error message.
                            }
                            

                            if (savedcache != null)
                                existingitems = savedcache;
                        }
                    }
                    // Existing items null means it's a fully new appearance
                    if (existingitems == null)
                    {

                        for (int i = 0; i < maxCacheitemsLoop; i++)
                        {
                            if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex)
                            {
                                Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex];
                                if (face == null)
                                {
                                    textureEntry.CreateFace(cacheItems[i].TextureIndex);
                                    textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID =
                                        AppearanceManager.DEFAULT_AVATAR_TEXTURE;
                                    continue;
                                }
                                cacheItems[i].TextureID =face.TextureID;
                                if (m_scene.AssetService != null)
                                    cacheItems[i].TextureAsset =
                                        m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString());
                            }
                            else
                            {
                                m_log.WarnFormat("[CACHEDBAKES]: Invalid Texture Index Provided, Texture doesn't exist or hasn't been uploaded yet {0}, the max is {1}.  Skipping!", cacheItems[i].TextureIndex, textureEntry.FaceTextures.Length);
                            }


                        }
                    }
                    else


                    {
                        // for each uploaded baked texture
                        for (int i = 0; i < maxCacheitemsLoop; i++)
//.........这里部分代码省略.........
开发者ID:RadaSangOn,项目名称:workCore2,代码行数:101,代码来源:UploadBakedTextureModule.cs


注:本文中的OpenMetaverse.Primitive.CreateFace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。