public static TextureEntryFace FromLLSD(LLSD llsd, TextureEntryFace defaultFace, out int faceNumber) { LLSDMap map = (LLSDMap)llsd; TextureEntryFace face = new TextureEntryFace(defaultFace); faceNumber = (map.ContainsKey("face_number")) ? map["face_number"].AsInteger() : -1; LLColor rgba = face.RGBA; rgba.FromLLSD(map["colors"]); face.RGBA = rgba; face.RepeatU = (float)map["scales"].AsReal(); face.RepeatV = (float)map["scalet"].AsReal(); face.OffsetU = (float)map["offsets"].AsReal(); face.OffsetV = (float)map["offsett"].AsReal(); face.Rotation = (float)map["imagerot"].AsReal(); face.Bump = (Bumpiness)map["bump"].AsInteger(); face.Shiny = (Shininess)map["shiny"].AsInteger(); face.Fullbright = map["fullbright"].AsBoolean(); face.MediaFlags = map["media_flags"].AsBoolean(); face.TexMapType = (MappingType)map["mapping"].AsInteger(); face.Glow = (float)map["glow"].AsReal(); face.TextureID = map["imageid"].AsUUID(); return(face); }
public static LightData FromLLSD(LLSD llsd) { LightData light = new LightData(); if (llsd.Type == LLSDType.Map) { LLSDMap map = (LLSDMap)llsd; light.Color = LLColor.FromLLSD(map["color"]); light.Intensity = (float)map["intensity"].AsReal(); light.Radius = (float)map["radius"].AsReal(); light.Cutoff = (float)map["cutoff"].AsReal(); light.Falloff = (float)map["falloff"].AsReal(); } return(light); }