Esempio n. 1
0
        void IModuleMarsUpdate.OnMarsUpdate()
        {
            m_QueryBackend.SyncNeedsAcquireSet();

            switch (m_State)
            {
            case AcquireCycleState.UpdatesOnly:
                RunMatchUpdates();
                return;

            case AcquireCycleState.RunningSets:
            {
                GroupPipeline.OnUpdate();
                if (GroupPipeline.IsReadyForTraitDataBufferSync)
                {
                    m_Database.StopUpdateBuffering();
                }

                /*
                 *  We call RunMatchUpdates() after the check for buffering, so that on the
                 *  same frame we stop buffering, update checks can cause any events that need to happen because
                 *  of buffered data changes. This will be the frame immediately before acquire events.
                 *
                 *  We previously stopped buffering on the same frame as acquire handling, immediately after it.
                 *  We also relied on the update check the frame after acquire for query changes to propagate.
                 *  In comparison, this method has 2 less frames of latency between
                 *  buffering a change and the change's effect on proxies.
                 */
                RunMatchUpdates();

                if (!GroupPipeline.CurrentlyActive)
                {
                    m_State = AcquireCycleState.RunningStandalone;
                    StandalonePipeline.StartCycle();
                }

                break;
            }

            case AcquireCycleState.RunningStandalone:
                StandalonePipeline.OnUpdate();
                if (StandalonePipeline.IsReadyForTraitDataBufferSync)
                {
                    m_Database.StopUpdateBuffering();
                }

                RunMatchUpdates();
                if (!StandalonePipeline.CurrentlyActive)
                {
                    m_State = AcquireCycleState.UpdatesOnly;
                    OnSceneEvaluationComplete?.Invoke();
                }

                break;
            }
        }
Esempio n. 2
0
        void IModule.UnloadModule()
        {
            if (StandalonePipeline != null)
            {
                Pose IdentityPoseMethod(Pose p) => p;

                StandalonePipeline.ResultFillStage.Transformation.applyOffsetToPose  = IdentityPoseMethod;
                GroupPipeline.MemberResultFillStage.Transformation.applyOffsetToPose = IdentityPoseMethod;
#if UNITY_EDITOR
                EditorOnlyEvents.onTemporalSimulationStart -= StandalonePipeline.ClearData;
#endif
                StandalonePipeline.ClearData();
            }

            GroupPipeline?.Clear();

            StandalonePipeline = null;
            GroupPipeline      = null;
        }
Esempio n. 3
0
 public void Clear()
 {
     StandalonePipeline.ClearData();
     GroupPipeline.Clear();
 }
Esempio n. 4
0
 internal void StartCycle()
 {
     // we run the set pipeline first, and after it's done the standalone one gets run
     m_State = AcquireCycleState.RunningSets;
     GroupPipeline.StartCycle();
 }