SetRemoved() public method

public SetRemoved ( ) : void
return void
示例#1
0
        // Buffer a pair for removal.
        public void RemoveBufferedPair(int id1, int id2)
        {
            Box2DXDebug.Assert(id1 != PairManager.NullProxy && id2 != PairManager.NullProxy);
            Box2DXDebug.Assert(_pairBufferCount < Settings.MaxPairs);

            Pair pair = Find(id1, id2);

            if (pair == null)
            {
                // The pair never existed. This is legal (due to collision filtering).
                return;
            }

            // If this pair is not in the pair buffer ...
            if (pair.IsBuffered() == false)
            {
                // This must be an old pair.
                Box2DXDebug.Assert(pair.IsFinal() == true);

                pair.SetBuffered();
                _pairBuffer[_pairBufferCount].ProxyId1 = pair.ProxyId1;
                _pairBuffer[_pairBufferCount].ProxyId2 = pair.ProxyId2;
                ++_pairBufferCount;

                Box2DXDebug.Assert(_pairBufferCount <= _pairCount);
            }

            pair.SetRemoved();

            if (BroadPhase.IsValidate)
            {
                ValidateBuffer();
            }
        }
示例#2
0
        public void RemoveBufferedPair(int id1, int id2)
        {
            Box2DXDebug.Assert(id1 != (int)PairManager.NullProxy && id2 != (int)PairManager.NullProxy);
            Box2DXDebug.Assert(this._pairBufferCount < Settings.MaxPairs);
            Pair pair = this.Find(id1, id2);

            if (pair != null)
            {
                if (!pair.IsBuffered())
                {
                    Box2DXDebug.Assert(pair.IsFinal());
                    pair.SetBuffered();
                    this._pairBuffer[this._pairBufferCount].ProxyId1 = pair.ProxyId1;
                    this._pairBuffer[this._pairBufferCount].ProxyId2 = pair.ProxyId2;
                    this._pairBufferCount++;
                    Box2DXDebug.Assert(this._pairBufferCount <= this._pairCount);
                }
                pair.SetRemoved();
                if (BroadPhase.IsValidate)
                {
                    this.ValidateBuffer();
                }
            }
        }