Esempio n. 1
0
        private void FixedUpdate()
        {
            ObiProfiler.EnableProfiler();

            Physics.autoSimulation = !substepUnityPhysics;

            BeginStep(Time.fixedDeltaTime);

            float substepDelta = Time.fixedDeltaTime / (float)substeps;

            // Divide the step into multiple smaller substeps:
            for (int i = 0; i < substeps; ++i)
            {
                // Simulate Obi:
                Substep(substepDelta);

                // Simulate Unity physics:
                if (substepUnityPhysics)
                {
                    Physics.Simulate(substepDelta);
                }
            }

            EndStep(substepDelta);

            ObiProfiler.DisableProfiler();

            accumulatedTime -= Time.fixedDeltaTime;
        }
Esempio n. 2
0
        private void Update()
        {
            ObiProfiler.EnableProfiler();
            Interpolate(Time.fixedDeltaTime, accumulatedTime);
            ObiProfiler.DisableProfiler();

            accumulatedTime += Time.deltaTime;
        }
Esempio n. 3
0
        private void FixedUpdate()
        {
            ObiProfiler.EnableProfiler();

            BeginStep(Time.fixedDeltaTime);

            float substepDelta = Time.fixedDeltaTime / (float)substeps;

            // Divide the step into multiple smaller substeps:
            for (int i = 0; i < substeps; ++i)
            {
                Substep(Time.fixedDeltaTime, substepDelta, substeps - i);
            }

            EndStep(substepDelta);

            ObiProfiler.DisableProfiler();

            accumulatedTime -= Time.fixedDeltaTime;
        }