Esempio n. 1
0
        /// <summary>   Constructs the interaction Engine. </summary>
        /// <param name="interactionEngine">        The interaction engine. </param>
        /// <param name="handConsumerType">         Type of the hand consumer. </param>
        /// <param name="interactionDataSource">    The interaction data source. </param>
        /// <param name="playbackFolder">           Pathname of the playback folder. </param>
        public static void Construct(out InteractionEngine interactionEngine, string handConsumerType, string interactionDataSource, Transform depthOcclusionTransform, string playbackFolder = "")
        {
            IPointCloudSource <PointXYZConfidence> pointCloudSource; //todo: maybe support other stuff?
            IPlaybackSource <PointCloudData <PointXYZConfidence> > pcdPlaybackSource;

            CreateSources(out pointCloudSource, out pcdPlaybackSource, handConsumerType, interactionDataSource, playbackFolder);
            interactionEngine = new InteractionEngine(pointCloudSource, handConsumerType, depthOcclusionTransform, pcdPlaybackSource);
        }
 public void Start()
 {
     if (m_logInRecordSesnorDataFolder)
     {
         _sensorDataRecorder = GameObject.Find("MetaCameraRig").GetComponent <RecordSensorData>();
         if (_sensorDataRecorder != null)
         {
             UnityEngine.Debug.LogError("cant find RecordsensorData");
         }
         m_loggingFolder = _sensorDataRecorder.GetRecordingPath();
     }
     if (m_loggingFolder == null)
     {
         UnityEngine.Debug.LogError("Logging Folder is null");
         return;
     }
     _pointCloudMetaData    = new PointCloudMetaData();
     _pointCloudDataLogging = new PointCloudDataLogging(m_loggingFolder);
     _interactionEngine     = metaContext.Get <InteractionEngine>();
 }
        private void ConstructDefaultInteractionEngine(MetaFactoryPackage package)
        {
            //todo: redundant and conflicting options possible. Needs to be refactored

            HandKernelSettings handSettignsGO    = GameObject.FindObjectOfType <HandKernelSettings>();
            InteractionEngine  interactionEngine = null;
            string             handkernelType    = handSettignsGO.handKernelType.ToString();

            if (!usingPlayback)
            {
                InteractionEngineFactory.Construct(out interactionEngine, handkernelType, "Sensors", _depthOcclusionTransform);
            }
            else
            {
                InteractionEngineFactory.Construct(out interactionEngine, handkernelType, "Playback", _depthOcclusionTransform, _playbackPath);
            }
            package.EventReceivers.Add(interactionEngine);

            // Add to context
            package.MetaContext.Add(interactionEngine);
        }