コード例 #1
0
        public void Update(IServerContext serverContext, IUpdateContext updateContext)
        {
            if (serverContext.World != _currentServerWorld || _shadowWorld == null)
            {
                if (_shadowWorld != null)
                {
                    _shadowWorld.Dispose();
                }

                _shadowWorld        = _physicsFactory.CreateShadowWorld();
                _currentServerWorld = serverContext.World;
            }

            using (_profiler.Measure("phys-step"))
            {
                _shadowWorld.Update(serverContext, updateContext);
            }
        }
コード例 #2
0
        public void Update(IGameContext gameContext, IUpdateContext updateContext)
        {
            if (gameContext.World == null)
            {
                return;
            }

            if (gameContext.World != _currentWorld || _shadowWorld == null)
            {
                if (_shadowWorld != null)
                {
                    _shadowWorld.Dispose();
                }

                _shadowWorld  = _physicsFactory.CreateShadowWorld();
                _currentWorld = gameContext.World;
            }

            using (_profiler.Measure("phys-step"))
            {
                _shadowWorld.Update(gameContext, updateContext);
            }
        }