clear() public static method

removes all colliders from the SpatialHash
public static clear ( ) : void
return void
Example #1
0
        internal void end()
        {
            _didSceneBegin = false;

            for (var i = 0; i < _renderers.length; i++)
            {
                _renderers.buffer[i].unload();
            }

            for (var i = 0; i < _postProcessors.length; i++)
            {
                _postProcessors.buffer[i].unload();
            }

            Core.emitter.removeObserver(CoreEvents.GraphicsDeviceReset, onGraphicsDeviceReset);
            entities.removeAllEntities();

            camera = null;
            content.Dispose();
            _sceneRenderTarget.Dispose();
            Physics.clear();

            if (_destinationRenderTarget != null)
            {
                _destinationRenderTarget.Dispose();
            }

            if (entityProcessors != null)
            {
                entityProcessors.end();
            }

            unload();
        }
Example #2
0
        internal void end()
        {
            _didSceneBegin = false;


            Core.emitter.removeObserver(CoreEvents.GraphicsDeviceReset, onGraphicsDeviceReset);

            Physics.clear();
        }
Example #3
0
        internal void end()
        {
            _didSceneBegin = false;

            // we kill Renderers and PostProcessors first since they rely on Entities
            for (var i = 0; i < _renderers.length; i++)
            {
                _renderers.buffer[i].unload();
            }

            for (var i = 0; i < _postProcessors.length; i++)
            {
                _postProcessors.buffer[i]._isAttachedToScene = false;
                _postProcessors.buffer[i].unload();
            }

            // now we can remove the Entities and finally the SceneComponents
            Core.emitter.removeObserver(CoreEvents.GraphicsDeviceReset, onGraphicsDeviceReset);
            entities.removeAllEntities();

            for (var i = 0; i < _sceneComponents.length; i++)
            {
                _sceneComponents.buffer[i].onRemovedFromScene();
            }
            _sceneComponents.clear();

            camera = null;
            content.Dispose();
            _sceneRenderTarget.Dispose();
            Physics.clear();

            if (_destinationRenderTarget != null)
            {
                _destinationRenderTarget.Dispose();
            }

            if (entityProcessors != null)
            {
                entityProcessors.end();
            }

            unload();
        }