コード例 #1
0
ファイル: Prims.cs プロジェクト: mdickson/opensim-libs
            public static FlexibleData FromLLSD(LLSD llsd)
            {
                FlexibleData flex = new FlexibleData();

                if (llsd.Type == LLSDType.Map)
                {
                    LLSDMap map = (LLSDMap)llsd;

                    flex.Softness = map["simulate_lod"].AsInteger();
                    flex.Gravity  = (float)map["gravity"].AsReal();
                    flex.Drag     = (float)map["air_friction"].AsReal();
                    flex.Wind     = (float)map["wind_sensitivity"].AsReal();
                    flex.Tension  = (float)map["tension"].AsReal();
                    flex.Force    = LLVector3.FromLLSD(map["user_force"]);
                }

                return(flex);
            }
コード例 #2
0
ファイル: Login.cs プロジェクト: chrbayer84/SLAgentCSServer
        public static LLVector3 ParseLLVector3(string key, LLSDMap reply)
        {
            LLSD llsd;

            if (reply.TryGetValue(key, out llsd))
            {
                if (llsd.Type == LLSDType.Array)
                {
                    LLVector3 vec = new LLVector3();
                    vec.FromLLSD(llsd);
                    return(vec);
                }
                else if (llsd.Type == LLSDType.String)
                {
                    LLSDArray array = (LLSDArray)LLSDParser.DeserializeNotation(llsd.AsString());
                    LLVector3 vec   = new LLVector3();
                    vec.FromLLSD(array);
                    return(vec);
                }
            }

            return(LLVector3.Zero);
        }
コード例 #3
0
ファイル: Login.cs プロジェクト: RavenB/gridsearch
        public static LLVector3 ParseLLVector3(string key, LLSDMap reply)
        {
            LLSD llsd;
            if (reply.TryGetValue(key, out llsd))
            {
                if (llsd.Type == LLSDType.Array)
                {
                    LLVector3 vec = new LLVector3();
                    vec.FromLLSD(llsd);
                    return vec;
                }
                else if (llsd.Type == LLSDType.String)
                {
                    LLSDArray array = (LLSDArray)LLSDParser.DeserializeNotation(llsd.AsString());
                    LLVector3 vec = new LLVector3();
                    vec.FromLLSD(array);
                    return vec;
                }
            }

            return LLVector3.Zero;
        }
コード例 #4
0
ファイル: Prims.cs プロジェクト: mdickson/opensim-libs
        public static Primitive FromLLSD(LLSD llsd)
        {
            Primitive prim = new Primitive();

            LLObject.ObjectData data = new ObjectData();

            LLSDMap map     = (LLSDMap)llsd;
            LLSDMap volume  = (LLSDMap)map["volume"];
            LLSDMap path    = (LLSDMap)volume["path"];
            LLSDMap profile = (LLSDMap)volume["profile"];

            #region Path/Profile

            data.PathBegin        = (float)path["begin"].AsReal();
            data.PathCurve        = (PathCurve)path["curve"].AsInteger();
            data.PathEnd          = (float)path["end"].AsReal();
            data.PathRadiusOffset = (float)path["radius_offset"].AsReal();
            data.PathRevolutions  = (float)path["revolutions"].AsReal();
            data.PathScaleX       = (float)path["scale_x"].AsReal();
            data.PathScaleY       = (float)path["scale_y"].AsReal();
            data.PathShearX       = (float)path["shear_x"].AsReal();
            data.PathShearY       = (float)path["shear_y"].AsReal();
            data.PathSkew         = (float)path["skew"].AsReal();
            data.PathTaperX       = (float)path["taper_x"].AsReal();
            data.PathTaperY       = (float)path["taper_y"].AsReal();
            data.PathTwist        = path["twist"].AsInteger();
            data.PathTwistBegin   = path["twist_begin"].AsInteger();

            data.ProfileBegin  = (float)profile["begin"].AsReal();
            data.ProfileCurve  = (ProfileCurve)profile["curve"].AsInteger();
            data.ProfileHole   = (HoleType)profile["hole"].AsInteger();
            data.ProfileEnd    = (float)profile["end"].AsReal();
            data.ProfileHollow = (float)profile["hollow"].AsReal();

            #endregion Path/Profile

            prim.Data = data;

            if (map["phantom"].AsBoolean())
            {
                prim.Flags |= ObjectFlags.Phantom;
            }

            if (map["physical"].AsBoolean())
            {
                prim.Flags |= ObjectFlags.Physics;
            }

            if (map["shadows"].AsBoolean())
            {
                prim.Flags |= ObjectFlags.CastShadows;
            }

            prim.ParentID = (uint)map["parentid"].AsInteger();
            prim.Position = LLVector3.FromLLSD(map["position"]);
            prim.Rotation = LLQuaternion.FromLLSD(map["rotation"]);
            prim.Scale    = LLVector3.FromLLSD(map["scale"]);
            prim.Flexible = FlexibleData.FromLLSD(map["flexible"]);
            prim.Light    = LightData.FromLLSD(map["light"]);
            prim.Sculpt   = SculptData.FromLLSD(map["sculpt"]);
            prim.Textures = TextureEntry.FromLLSD(map["textures"]);

            return(prim);
        }