SetDestructionListener() public method

Register a destruction listener.
public SetDestructionListener ( DestructionListener listener ) : void
listener DestructionListener
return void
Example #1
0
		public Test()
		{
			_worldAABB = new AABB();
			_worldAABB.LowerBound.Set(-200.0f, -100.0f);
			_worldAABB.UpperBound.Set(200.0f, 200.0f);
			Vec2 gravity = new Vec2();
			gravity.Set(0.0f, -10.0f);
			bool doSleep = true;
			_world = new World(_worldAABB, gravity, doSleep);
			_bomb = null;
			_textLine = 30;
			_mouseJoint = null;
			_pointCount = 0;

			_destructionListener.test = this;
			_boundaryListener.test = this;
			//_contactListener.test = this;
			_world.SetDestructionListener(_destructionListener);
			_world.SetBoundaryListener(_boundaryListener);
			//_world.SetContactListener(_contactListener);
			_world.SetDebugDraw(_debugDraw);
		}
Example #2
0
        public Test()
        {
            Vec2 gravity = new Vec2();
            gravity.Set(0.0f, -10.0f);
            bool doSleep = true;
            _world = new World(gravity, doSleep);
            _bomb = null;
            _textLine = 30;
            _mouseJoint = null;
            _pointCount = 0;

            _destructionListener.test = this;
            _world.SetDestructionListener(_destructionListener);
            _world.SetContactListener(this);
            _world.SetDebugDraw(_debugDraw);

            _bombSpawning = false;

            _stepCount = 0;

            BodyDef bodyDef = new BodyDef();
            _groundBody = _world.CreateBody(bodyDef);
        }