예제 #1
0
        private void ProcessDisposedItems()
        {
            //Allow each controller to validate itself. this is where a controller can Dispose of itself if need be.
            for (int i = 0; i < controllerList.Count; i++)
            {
                controllerList[i].Validate();
            }

            //Allow each joint to validate itself. this is where a joint can Dispose of itself if need be.
            for (int i = 0; i < jointList.Count; i++)
            {
                jointList[i].Validate();
            }

            //Allow each spring to validate itself. this is where a joint can Dispose of itself if need be.
            for (int i = 0; i < springList.Count; i++)
            {
                springList[i].Validate();
            }

            int disposedGeomCount = geomList.RemoveDisposed();

            if (disposedGeomCount > 0)
            {
                _broadPhaseCollider.ProcessDisposedGeoms();
            }

            bodyList.RemoveDisposed();
            controllerList.RemoveDisposed();
            springList.RemoveDisposed();
            jointList.RemoveDisposed();

            //Remove all arbiters that contain 1 or more disposed rigid bodies.
            arbiterList.RemoveContainsDisposedBody(arbiterPool);
        }
예제 #2
0
        /// <summary>
        /// Processes the disposed controllers, joints, springs, bodies and cleans up the arbiter list.
        /// </summary>
        private void ProcessDisposedItems()
        {
            //Allow each controller to validate itself. this is where a controller can Dispose of itself if need be.
            for (int i = 0; i < ControllerList.Count; i++)
            {
                ControllerList[i].Validate();
            }

            //Allow each joint to validate itself. this is where a joint can Dispose of itself if need be.
            for (int i = 0; i < JointList.Count; i++)
            {
                JointList[i].Validate();
            }

            //Allow each spring to validate itself. this is where a spring can Dispose of itself if need be.
            for (int i = 0; i < SpringList.Count; i++)
            {
                SpringList[i].Validate();
            }

            _tempCount = GeomList.RemoveDisposed();

            if (_tempCount > 0)
            {
                _broadPhaseCollider.ProcessDisposedGeoms();
            }

            BodyList.RemoveDisposed();
            ControllerList.RemoveDisposed();
            SpringList.RemoveDisposed();
            JointList.RemoveDisposed();

            //Clean up the arbiterlist
            ArbiterList.CleanArbiterList(arbiterPool);
        }