Exemplo n.º 1
0
        public bool UpdateCollisionGeometry()
        {
            // Release the collider when no longer needed
            if (!NeedsCollider)
            {
                stateManager.SetColliderBuilt();
                ChunkColliderGeometryHandler.Reset();
                return(false);
            }

            // Build collision geometry only if there is enough time
            if (!Globals.GeometryBudget.HasTimeBudget)
            {
                return(false);
            }

            // Build collider if necessary
            if (stateManager.IsStateCompleted(ChunkStates.CurrStateBuildCollider))
            {
                Profiler.BeginSample("UpdateCollisionGeometry");
                Globals.GeometryBudget.StartMeasurement();

                stateManager.SetColliderBuilt();
                ChunkColliderGeometryHandler.Commit();

                Globals.GeometryBudget.StopMeasurement();
                Profiler.EndSample();
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        private void Reset()
        {
            stateManager.Reset();
            blocks.Reset();
            logic.Reset();

            GeometryHandler.Reset();
            ChunkColliderGeometryHandler.Reset();

            NeedsCollider = false;
        }
Exemplo n.º 3
0
        private void Reset()
        {
            NeedApplyStructure           = true;
            MaxPendingStructureListIndex = 0;

            stateManager.Reset();
            blocks.Reset();
            if (logic != null)
            {
                logic.Reset();
            }

            GeometryHandler.Reset();
            ChunkColliderGeometryHandler.Reset();

            m_needsCollider = false;
        }
Exemplo n.º 4
0
        public bool UpdateCollisionGeometry()
        {
            // Release the collider when no longer needed
            if (!NeedsCollider)
            {
                stateManager.SetColliderBuilt();
                ChunkColliderGeometryHandler.Reset();
                return(false);
            }

            // Build collider if necessary
            if (stateManager.IsStateCompleted(ChunkState.BuildCollider))
            {
                stateManager.SetColliderBuilt();
                ChunkColliderGeometryHandler.Commit();
                return(true);
            }

            return(false);
        }