IEnumerator SendEventsToClients() { lock (eventList.SyncRoot) { foreach (EventData e in eventList) { // Send Omicron events to display client // Note we're doing this before coordinate conversion since display clients will do that calculation if (CAVE2.IsMaster()) { //getReal3D.RpcManager.call("AddStringEvent", OmicronConnectorClient.EventDataToString(e)); // Commented out because risk of double events - use CAVE2.SendMessage to sync actions instead } // -zPos -xRot -yRot for Omicron->Unity coordinate conversion if (e.serviceType == EventBase.ServiceType.ServiceTypeMocap || e.serviceType == EventBase.ServiceType.ServiceTypeWand) { e.posz = -e.posz; e.orx = -e.orx; e.ory = -e.ory; } foreach (OmicronEventClient c in omicronClients) { if (c == null) continue; EventBase.ServiceType eType = e.serviceType; EventBase.ServiceType clientType = c.GetClientType(); if (!c.IsFlaggedForRemoval() && (clientType == EventBase.ServiceType.ServiceTypeAny || eType == clientType)) { //c.BroadcastMessage("OnEvent", e, SendMessageOptions.DontRequireReceiver); //CAVE2.SendMessage(c.gameObject.name, "OnEvent", e); c.OnEvent(e); } } } // Clear the list (TODO: probably should set the Processed flag instead and cleanup elsewhere) eventList.Clear(); } yield return null; }
IEnumerator SendEventsToClients() { lock (eventList.SyncRoot) { foreach (EventData e in eventList) { // -zPos -xRot -yRot for Omicron->Unity coordinate conversion e.posz = -e.posz; e.orx = -e.orx; e.ory = -e.ory; foreach (OmicronEventClient c in omicronClients) { if (c == null) continue; EventBase.ServiceType eType = e.serviceType; EventBase.ServiceType clientType = c.GetClientType(); if (!c.IsFlaggedForRemoval() && (clientType == EventBase.ServiceType.ServiceTypeAny || eType == clientType)) { //c.BroadcastMessage("OnEvent", e, SendMessageOptions.DontRequireReceiver); c.OnEvent(e); } } #if USING_GETREAL3D if(getReal3D.Cluster.isMaster) { // TODO: Breaks in getReal 3.3.3 //getReal3D.RpcManager.call ("AddStringEvent", OmicronConnectorClient.EventDataToString(e)); } #endif } // Clear the list (TODO: probably should set the Processed flag instead and cleanup elsewhere) eventList.Clear(); } yield return null; }
// bool buttonsChanged; public void SetAsWand() { defaultType = EventBase.ServiceType.ServiceTypeWand; }