Package com.ngt.jopenmetaverse.shared.structureddata

Examples of com.ngt.jopenmetaverse.shared.structureddata.OSDMap


  }

  public static Permissions FromOSD(OSD llsd)
  {
    Permissions permissions = new Permissions();
    OSDMap map =  (OSDMap) llsd;

    if (map != null)
    {
      permissions.BaseMask = PermissionMask.get(map.get("base_mask").asLong());
      permissions.EveryoneMask = PermissionMask.get(map.get("everyone_mask").asLong());
      permissions.GroupMask = PermissionMask.get(map.get("group_mask").asLong());
      permissions.NextOwnerMask = PermissionMask.get(map.get("next_owner_mask").asLong());
      permissions.OwnerMask = PermissionMask.get(map.get("owner_mask").asLong());
    }

    return permissions;
  }
View Full Code Here


                return data;
            }

            public OSD GetOSD()
            {
                OSDMap map = new OSDMap();

                map.put("face", OSD.FromInteger((int)Face));
                map.put("flags", OSD.FromInteger((int)TextureAnimMode.getIndex(Flags)));
                map.put("length", OSD.FromReal(Length));
                map.put("rate", OSD.FromReal(Rate));
                map.put("size_x", OSD.FromInteger((int)SizeX));
                map.put("size_y", OSD.FromInteger((int)SizeY));
                map.put("start", OSD.FromReal(Start));

                return map;
            }
View Full Code Here

            }

            public static TextureAnimation FromOSD(OSD osd)
            {
                TextureAnimation anim = new TextureAnimation();
                OSDMap map = (OSDMap) osd;

                if (map != null)
                {
                    anim.Face = map.get("face").asLong();
                    anim.Flags = TextureAnimMode.get(map.get("flags").asLong());
                    anim.Length = (float)map.get("length").asReal();
                    anim.Rate = (float)map.get("rate").asReal();
                    anim.SizeX = map.get("size_x").asLong();
                    anim.SizeY = map.get("size_y").asLong();
                    anim.Start = (float)map.get("start").asReal();
                }

                return anim;
            }
View Full Code Here

            return data;
        }

        public OSD GetOSD()
        {
            OSDMap map = new OSDMap();

            map.put("color", OSD.FromColor4(Color));
            map.put("intensity", OSD.FromReal(Intensity));
            map.put("radius", OSD.FromReal(Radius));
            map.put("cutoff", OSD.FromReal(Cutoff));
            map.put("falloff", OSD.FromReal(Falloff));

            return map;
        }
View Full Code Here

        {
            LightData light = new LightData();

            if (osd.getType() == OSDType.Map)
            {
                OSDMap map = (OSDMap)osd;

                light.Color = map.get("color").asColor4();
                light.Intensity = (float)map.get("intensity").asReal();
                light.Radius = (float)map.get("radius").asReal();
                light.Cutoff = (float)map.get("cutoff").asReal();
                light.Falloff = (float)map.get("falloff").asReal();
            }

            return light;
        }
View Full Code Here

        {
            PhysicsProperties ret = new PhysicsProperties();

            if (osd instanceof OSDMap)
            {
                OSDMap map = (OSDMap)osd;
                ret.LocalID = map.get("LocalID").asLong();
                ret.Density = (float)map.get("Density").asReal();
                ret.Friction = (float)map.get("Friction").asReal();
                ret.GravityMultiplier = (float)map.get("GravityMultiplier").asReal();
                ret.Restitution = (float)map.get("Restitution").asReal();
                ret.PhysicsShapeType = EnumsPrimitive.PhysicsShapeType.get((byte)map.get("PhysicsShapeType").asInteger());
            }

            return ret;
        }
View Full Code Here

        /// Serializes PhysicsProperties to OSD
        /// </summary>
        /// <returns>OSDMap with serialized PhysicsProperties data</returns>
        public OSD GetOSD()
        {
            OSDMap map = new OSDMap(6);
            map.put("LocalID",OSD.FromLong(LocalID));
            map.put("Density",OSD.FromReal(Density));
            map.put("Friction",OSD.FromReal(Friction));
            map.put("GravityMultiplier",OSD.FromReal(GravityMultiplier));
            map.put("Restitution",OSD.FromReal(Restitution));
            map.put("PhysicsShapeType",OSD.FromInteger((int)PhysicsShapeType.getIndex()));
            return map;
        }
View Full Code Here

                    hasAttribute = TextureAttributes.None.getIndex();
            }

            public OSD GetOSD(int faceNumber)
            {
                OSDMap tex = new OSDMap(10);
                if (faceNumber >= 0) tex.put("face_number", OSD.FromInteger(faceNumber));
                tex.put("colors",  OSD.FromColor4(getRGBA()));
                tex.put("scales", OSD.FromReal(getRepeatU()));
                tex.put("scalet",  OSD.FromReal(getRepeatV()));
                tex.put("offsets",  OSD.FromReal(getOffsetU()));
                tex.put("offsett",  OSD.FromReal(getOffsetV()));
                tex.put("imagerot", OSD.FromReal(getRotation()));
                tex.put("bump", OSD.FromInteger((int)getBump().getIndex()));
                tex.put("shiny",  OSD.FromInteger((int)getShiny().getIndex()));
                tex.put("fullbright", OSD.FromBoolean(getFullbright()));
                tex.put("media_flags", OSD.FromInteger(getMediaFlags() ? 1 : 0));
                tex.put("mapping", OSD.FromInteger((int)getTexMapType().getIndex()));
                tex.put("glow", OSD.FromReal(getGlow()));

                if (!getTextureID().equals(TextureEntry.WHITE_TEXTURE))
                    tex.put("imageid",  OSD.FromUUID(getTextureID()));
                else
                    tex.put("imageid", OSD.FromUUID(UUID.Zero));

                return tex;
            }
View Full Code Here

                return tex;
            }

            public static TextureEntryFace FromOSD(OSD osd, TextureEntryFace defaultFace, int[] faceNumber)
            {
                OSDMap map = (OSDMap)osd;

                TextureEntryFace face = new TextureEntryFace(defaultFace);
                faceNumber[0] = (map.containsKey("face_number")) ? map.get("face_number").asInteger() : -1;
                Color4 rgba = face.getRGBA();
                rgba = ((OSDArray)map.get("colors")).asColor4();
                face.setRGBA(rgba);
                face.setRepeatU((float)map.get("scales").asReal());
                face.setRepeatV((float)map.get("scalet").asReal());
                face.setOffsetU((float)map.get("offsets").asReal());
                face.setOffsetV((float)map.get("offsett").asReal());
                face.setRotation((float)map.get("imagerot").asReal());
                face.setBump(Bumpiness.get((byte)map.get("bump").asInteger()));
                face.setShiny(Shininess.get((byte)map.get("shiny").asInteger()));
                face.setFullbright(map.get("fullbright").asBoolean());
                face.setMediaFlags(map.get("media_flags").asBoolean());
                face.setTexMapType(MappingType.get((byte)map.get("mapping").asInteger()));
                face.setGlow((float)map.get("glow").asReal());
                face.setTextureID(map.get("imageid").asUUID());

                return face;
            }
View Full Code Here

            public static TextureEntry FromOSD(OSD osd)
            {
                if (osd.getType() == OSDType.Array)
                {
                    OSDArray array = (OSDArray)osd;
                    OSDMap faceSD;

                    if (array.count() > 0)
                    {
                        int[] faceNumber = new int[1];
                        faceSD = (OSDMap)array.get(0);
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.structureddata.OSDMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.