Ejemplo n.º 1
0
        public void TextureEntry()
        {
            LLObject.TextureEntry     te   = new LLObject.TextureEntry(LLUUID.Random());
            LLObject.TextureEntryFace face = te.CreateFace(0);
            face.Bump       = Bumpiness.Concrete;
            face.Fullbright = true;
            face.MediaFlags = true;
            face.OffsetU    = 0.5f;
            face.OffsetV    = -0.5f;
            face.RepeatU    = 3.0f;
            face.RepeatV    = 4.0f;
            face.RGBA       = new LLColor(0f, 0.25f, 0.75f, 1f);
            face.Rotation   = 1.5f;
            face.Shiny      = Shininess.Medium;
            face.TexMapType = MappingType.Planar;
            face.TextureID  = LLUUID.Random();

            byte[] teBytes = te.ToBytes();

            LLObject.TextureEntry te2 = new LLObject.TextureEntry(teBytes, 0, teBytes.Length);

            byte[] teBytes2 = te2.ToBytes();

            Assert.IsTrue(teBytes.Length == teBytes2.Length);

            for (int i = 0; i < teBytes.Length; i++)
            {
                Assert.IsTrue(teBytes[i] == teBytes2[i], "Byte " + i + " is not equal");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates the TextureEntry and Appearance Param structures with the data from an asset wearable.
        /// Called once for each weable asset.
        /// </summary>
        /// <param name="wearableAsset"></param>
        protected void UpdateAgentTextureEntryAndAppearanceParams(AssetWearable wearableAsset)
        {
            try
            {
                foreach (KeyValuePair <uint, LLUUID> texture in wearableAsset.Textures)
                {
                    AgentTextureEntry.CreateFace(texture.Key).TextureID = texture.Value;
                }

                lock (AgentAppearanceParams)
                {
                    foreach (KeyValuePair <int, float> kvp in wearableAsset.Parameters)
                    {
                        AgentAppearanceParams[kvp.Key] = kvp.Value;
                    }
                }
            }
            catch (Exception e)
            {
                Client.Log(e.ToString() + Environment.NewLine + wearableAsset.AssetDataToString(), Helpers.LogLevel.Error);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// TextureEntry must have it's face textures in a specific order for avatars.
        /// Should be called at least once before sending an AgentSetAppearance packet.
        /// </summary>
        protected void UpdateAgentTextureEntryOrder()
        {
            // Correct the order of the textures
            foreach (uint faceid in AgentTextureEntry.FaceTextures.Keys)
            {
                if (faceid > 18)
                {
                    Client.Log("Unknown order for FaceID: " + faceid + Environment.NewLine +
                               "Your wearables define a face that we don't know the order of.  Please " +
                               "capture a AgentSetAppearance packet for your current outfit and submit to " +
                               "[email protected], thanks!", Helpers.LogLevel.Info);
                    break;
                }
            }

            //Re-order texture faces to match Linden Labs internal data structure.
            LLObject.TextureEntry te2 = new LLObject.TextureEntry(AgentTextureEntry.DefaultTexture.TextureID);
            te2.CreateFace(18).TextureID = AgentTextureEntry.GetFace(18).TextureID;
            te2.CreateFace(17).TextureID = AgentTextureEntry.GetFace(17).TextureID;
            te2.CreateFace(16).TextureID = AgentTextureEntry.GetFace(16).TextureID;
            te2.CreateFace(15).TextureID = AgentTextureEntry.GetFace(15).TextureID;
            te2.CreateFace(14).TextureID = AgentTextureEntry.GetFace(14).TextureID;
            te2.CreateFace(13).TextureID = AgentTextureEntry.GetFace(13).TextureID;
            te2.CreateFace(12).TextureID = AgentTextureEntry.GetFace(12).TextureID;
            // I wonder if shoes are somewhere in here?
            te2.CreateFace(7).TextureID = AgentTextureEntry.GetFace(7).TextureID;
            te2.CreateFace(6).TextureID = AgentTextureEntry.GetFace(6).TextureID;
            te2.CreateFace(5).TextureID = AgentTextureEntry.GetFace(5).TextureID;
            te2.CreateFace(4).TextureID = AgentTextureEntry.GetFace(4).TextureID;
            te2.CreateFace(3).TextureID = AgentTextureEntry.GetFace(3).TextureID;
            te2.CreateFace(2).TextureID = AgentTextureEntry.GetFace(2).TextureID;
            te2.CreateFace(1).TextureID = AgentTextureEntry.GetFace(1).TextureID;
            te2.CreateFace(0).TextureID = AgentTextureEntry.GetFace(0).TextureID;

            AgentTextureEntry = te2;
        }