Exemple #1
0
        // This method should undo anything that was done by the loadWorld and afterLoadProcessing
        // methods, and return to a state where loadWorld can safely be called again.
        public void clear()
        {
            if (m_world != null)
            {
                Console.WriteLine("Deleting Box2D world");
                m_world = null;
            }

            if (m_debugDraw != null)
                m_debugDraw = null;

            //m_world = NULL;
            //m_mouseJoint = NULL;
            // m_mouseJointGroundBody = null;
        }
Exemple #2
0
        public Mouse()
        {
            //m_destructionListener = new DestructionListener();
            m_debugDraw = new CCBox2dDraw("fonts/arial-16");

            b2Vec2 gravity = new b2Vec2();
            gravity.Set(500, 500);
           
            m_world = new b2World(gravity);

            
            m_world.SetAllowSleeping(false);
            m_world.SetContinuousPhysics(true);


            m_world.SetDebugDraw(m_debugDraw);
            m_debugDraw.AppendFlags(b2DrawFlags.e_shapeBit | b2DrawFlags.e_aabbBit | b2DrawFlags.e_centerOfMassBit | b2DrawFlags.e_jointBit | b2DrawFlags.e_pairBit);

            m_world.SetContinuousPhysics(true);
            m_world.SetWarmStarting(true);
        }
Exemple #3
0
        public Test()
        {
            m_destructionListener = new DestructionListener();
            m_debugDraw = new CCBox2dDraw("fonts/arial-12");

            b2Vec2 gravity = new b2Vec2();
            gravity.Set(0.0f, -10.0f);
            m_world = new b2World(gravity);
            m_bomb = null;
            m_textLine = 30;
            m_mouseJoint = null;
            m_pointCount = 0;

            m_destructionListener.test = this;
            m_world.SetDestructionListener(m_destructionListener);
            m_world.SetContactListener(this);
            m_world.SetDebugDraw(m_debugDraw);
            m_world.SetContinuousPhysics(true);
            m_world.SetWarmStarting(true);

            m_bombSpawning = false;

            m_stepCount = 0;

            b2BodyDef bodyDef = new b2BodyDef();
            m_groundBody = m_world.CreateBody(bodyDef);
        }
Exemple #4
0
		void EnableDebugMode()
		{
			CCBox2dDraw debugDraw = new CCBox2dDraw("fonts/arial-12");
			world.SetDebugDraw(debugDraw);
			debugDraw.AppendFlags(b2DrawFlags.e_shapeBit);

		}