void UpdateWorld()
        {
            nextWorldUpdate = Time.time + 1.0f / worldUpdateFrequency;
            //if (worldObjects.Count == 0) return;

            ObjectUpdate[] objectUpdates = new ObjectUpdate[worldObjects.Count];
            int            objectIdx     = 0;

            foreach (KeyValuePair <string, VJoint> kvp in worldObjects)
            {
                objectUpdates[objectIdx] = new ObjectUpdate {
                    objectId  = kvp.Key,
                    transform = kvp.Value.GetTransformArray()
                };
                objectIdx++;
            }

            middleware.Send(JsonUtility.ToJson(new WorldObjectUpdate {
                msgType  = AUPROT.MSGTYPE_WORLDOBJECTUPDATE,
                nObjects = worldObjects.Count,
                objects  = objectUpdates
            }));
        }
Ejemplo n.º 2
0
        private void RequestClip(string clipId, int part)
        {
            if (debounceRetransmit == null)
            {
                debounceRetransmit = new Dictionary <string, float>();
            }
            string hash = clipId + part;

            if (debounceRetransmit.ContainsKey(hash) && debounceRetransmit[hash] + retransmitInterval > Time.time)
            {
                return;
            }
            debounceRetransmit[hash] = Time.time;
            StreamingClipRetransmitRequestJSON req = new StreamingClipRetransmitRequestJSON(clipId, part);

            middleware.Send(new MSG(JsonUtility.ToJson(req)));
        }
Ejemplo n.º 3
0
 public void Send(string data)
 {
     middleware.Send(new MSG(data));
 }