Package com.ngt.jopenmetaverse.shared.structureddata

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


                mesh[0].Prim = prim;
                mesh[0].Profile.Faces = new ArrayList<ProfileFace>();
                mesh[0].Profile.Positions = new ArrayList<Vector3>();
                mesh[0].Path.Points = new ArrayList<PathPoint>();

                OSD facesOSD = null;

                switch (LOD)
                {
                    default:
                    case Highest:
                        facesOSD = MeshData.get("high_lod");
                        break;

                    case High:
                        facesOSD = MeshData.get("medium_lod");
                        break;

                    case Medium:
                        facesOSD = MeshData.get("low_lod");
                        break;

                    case Low:
                        facesOSD = MeshData.get("lowest_lod");
                        break;
                }

                if (facesOSD == null || !(facesOSD instanceof OSDArray))
                {
                    return false;
                }

                OSDArray decodedMeshOsdArray = (OSDArray)facesOSD;

                for (int faceNr = 0; faceNr < decodedMeshOsdArray.count(); faceNr++)
                {
                    OSD subMeshOsd = decodedMeshOsdArray.get(faceNr);

                    // Decode each individual face
                    if (subMeshOsd instanceof OSDMap)
                    {
                        Face oface = new Face();
View Full Code Here


        OSDArray mediaData = new OSDArray(FaceMedia.length);

        for (int i = 0; i < FaceMedia.length; i++)
        {
          if (FaceMedia[i] == null)
            mediaData.add(new OSD());
          else
            mediaData.add(FaceMedia[i].GetOSD());
        }

        map.put("object_media_data", mediaData);
View Full Code Here

        OSDArray mediaData = new OSDArray(FaceMedia.length);

        for (int i = 0; i < FaceMedia.length; i++)
        {
          if (FaceMedia[i] == null)
            mediaData.add(new OSD());
          else
            mediaData.add(FaceMedia[i].GetOSD());
        }

        map.put("object_media_data", mediaData);
View Full Code Here

  public class LoginCompletedObserver extends  EventObserver<CapsHttpRequestCompletedArg>
  {
    public void handleEvent(Observable arg0, CapsHttpRequestCompletedArg arg1) {
      //      System.out.println("RequestCompletedObserver called ...");
      CapsHttpRequestCompletedArg rcha = (CapsHttpRequestCompletedArg) arg1;
      OSD osd =  null;
      if(rcha.getError() == null)
      {
        osd = rcha.getResult();

      }
View Full Code Here

          OSDMap map = new OSDMap(fields.length);
         
          for (int i = 0; i < fields.length; i++)
          {
            Field field = fields[i];
            OSD osd = OSD.SerializeMembers(field.get(packet));
              map.put(field.getName(), osd);
          }
          return map;
     
  //    OSDMap map = new OSDMap();
View Full Code Here

      if (error == null)
      {
        if (result != null && result.getType().equals(OSDType.Map))
        {
          OSDMap map = (OSDMap)result;
          OSD osd;

          LoginResponseData data = new LoginResponseData();
          data.Parse(map);

//          data.getMap(data);
         
          if ((osd = map.get("login")) !=null)
          {
            boolean loginSuccess = osd.asBoolean();
            boolean redirect = (osd.asString().equals("indeterminate"));

            if (redirect)
            {
              // Login redirected
View Full Code Here

      Document doc = dBuilder.parse(xmlData);

      //Get the root name
      Element root = doc.getDocumentElement();

      OSD ret = ParseLLSDXmlRoot(root);

      return ret;
    }
    catch(Exception e)
    {
      JLogger.error("Error in parsing xml: " + Utils.getExceptionStackTraceAsString(e));
      e.printStackTrace();
      return new OSD();
    }
  }
View Full Code Here

  {
    if (reader.getNodeType() != Node.ELEMENT_NODE || !reader.getNodeName().equals("llsd"))
      throw new OSDException("Expected an element llsd");
   
    NodeList nodeList = reader.getChildNodes();
    OSD ret = new OSD();
   
    for(int i = 0; i < nodeList.getLength(); i++)
    {
      if(nodeList.item(i).getNodeType() == Node.ELEMENT_NODE)
      {
View Full Code Here

  {
    if (reader.getNodeType() != Node.ELEMENT_NODE)
      throw new OSDException("Expected an element");

    String type = reader.getNodeName();
    OSD ret;

    ////System.out.println("Parsing Element..." + type);
   
    if(type.equals("undef"))
    {
      if (!reader.hasChildNodes())
      {
        return new OSD();
      }
      ret = new OSD();
    }
    else if(type.equals("boolean"))
    {
      if (!reader.hasChildNodes())
      {
View Full Code Here

        public static OSD DeserializeLLSDBinary(byte[] binaryData) throws IOException, OSDException
        {
//            //System.out.println( Utils.bytesToHexString(binaryData, "Input"));
          ByteArrayInputStream stream = new ByteArrayInputStream(binaryData);
//          //System.out.println(Utils.bytesToHexString(binaryData, "binaryData"));
            OSD osd = DeserializeLLSDBinary(stream);
            stream.close();
            return osd;
        }
View Full Code Here

TOP

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

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.