Beispiel #1
0
        public static void LateVisualize()
        {
            if (Simulated)
            {
                AccumulatedTime = Time.deltaTime;
            }
            else
            {
                AccumulatedTime += Time.deltaTime;
            }
            LerpTime = (float)(AccumulatedTime / PhysicsManager.FixedDeltaTime);
            for (int i = 0; i < DynamicSimObjects.PeakCount; i++)
            {
                LSBody b1 = DynamicSimObjects.innerArray[i];

                if (b1.IsNotNull())
                {
                    if (Simulated)
                    {
                        b1.SetVisuals();
                    }
                    b1.Visualize();
                }
            }

            if (Simulated)
            {
                Simulated = false;
            }
        }
Beispiel #2
0
        public static void Visualize()
        {
            float smoothDeltaTime = Mathf.Max(Time.unscaledDeltaTime, 1f / 256);

            LerpDampScaler = Mathf.Lerp(LerpDampScaler, (4f / 64) / smoothDeltaTime, Time.deltaTime);
            LerpDamping    = Time.unscaledDeltaTime * LerpDampScaler;
            LerpDamping   *= Time.timeScale;
            long curTicks = LockstepManager.Ticks;

            LerpTime  = (float)((curTicks - LastSimulateTicks) / (double)FixedDeltaTicks);
            LerpTime *= Time.timeScale;
            if (LerpTime <= 1f)
            {
                for (i = 0; i < PeakCount; i++)
                {
                    if (SimObjectExists[i])
                    {
                        b1 = SimObjects[i];
                        b1.Visualize();
                    }
                }
            }
            else
            {
                for (i = 0; i < PeakCount; i++)
                {
                    if (SimObjectExists[i])
                    {
                        SimObjects[i].LerpOverReset();
                    }
                }
            }
        }
        public static void Visualize()
        {
            LerpDamping = 1f;
            double curTime = LockstepManager.Seconds;

            AccumulatedTime += (curTime - LastTime) * Time.timeScale;
            LerpTime         = (float)(AccumulatedTime / FixedDeltaTime);
            if (LerpTime < 1f)
            {
                for (int i = 0; i < PeakCount; i++)
                {
                    if (SimObjectExists [i])
                    {
                        LSBody b1 = SimObjects [i];
                        b1.Visualize();
                    }
                }
            }
            else
            {
                AccumulatedTime    %= FixedDeltaTime;
                ExtrapolationAmount = LerpTime;
                LerpTime            = (float)(AccumulatedTime / FixedDeltaTime);

                if (Simulated)
                {
                    for (int i = 0; i < PeakCount; i++)
                    {
                        if (SimObjectExists [i])
                        {
                            LSBody b1 = SimObjects [i];
                            b1.LerpOverReset();

                            b1.SetVisuals();

                            b1.Visualize();
                        }
                    }
                    Simulated = false;
                }
                else
                {
                    for (int i = 0; i < PeakCount; i++)
                    {
                        if (SimObjectExists[i])
                        {
                            LSBody b1 = SimObjects[i];

                            b1.LerpOverReset();
                            b1.SetExtrapolatedVisuals();

                            b1.Visualize();
                        }
                    }
                }
            }
            LastTime = curTime;
        }
 public static void Visualize()
 {
     float smoothDeltaTime = Mathf.Max (Time.unscaledDeltaTime, 1f / 256);
     LerpDampScaler = Mathf.Lerp (LerpDampScaler, (4f / 64) / smoothDeltaTime, Time.deltaTime);
     LerpDamping = Time.unscaledDeltaTime * LerpDampScaler;
     LerpDamping *= Time.timeScale;
     long curTicks = LockstepManager.Ticks;
     LerpTime = (float)((curTicks - LastSimulateTicks) / (double)FixedDeltaTicks);
     LerpTime *= Time.timeScale;
     if (LerpTime <= 1f) {
         for (i = 0; i < PeakCount; i++)
         {
             if (SimObjectExists[i]) {
                 b1 = SimObjects[i];
                 b1.Visualize ();
             }
         }
     }
     else {
         for (i = 0; i < PeakCount; i++) {
             if (SimObjectExists[i]) {
                 SimObjects[i].LerpOverReset();
             }
         }
     }
 }