Esempio n. 1
0
        void InsertEntityNotificationHandler(simengine.InsertSimulationEntity ins)
        {
            _entity = (simengine.DepthCameraEntity)ins.Body;
            _entity.ServiceContract = Contract.Identifier;

            try
            {
                _entity.Register(_raycastResults);
            }
            catch (Exception ex)
            {
                LogError(ex);
            }

            if (_rayCastQueue == null)
            {
                _rayCastQueue = new DispatcherQueue(_entity.EntityState.Name + "depthNotifications",
                                                    TaskQueue.Dispatcher,
                                                    TaskExecutionPolicy.ConstrainQueueDepthDiscardTasks,
                                                    1);
                // attach handler to raycast results port
                _rayCastQueue.Enqueue(Arbiter.ReceiveWithIterator(false, _raycastResults, RaycastResultsHandler));
            }
        }
Esempio n. 2
0
 void DeleteEntityNotificationHandler(simengine.DeleteSimulationEntity del)
 {
     _entity = null;
 }