Implement and register this class with a b2World to provide debug drawing of physics entities in your game.
예제 #1
0
파일: World.cs 프로젝트: litdev1/LitDev
 public World(AABB worldAABB, Vec2 gravity, bool doSleep)
 {
     this._destructionListener = null;
     this._boundaryListener = null;
     this._contactFilter = WorldCallback.DefaultFilter;
     this._contactListener = null;
     this._debugDraw = null;
     this._bodyList = null;
     this._contactList = null;
     this._jointList = null;
     this._bodyCount = 0;
     this._contactCount = 0;
     this._jointCount = 0;
     this._warmStarting = true;
     this._continuousPhysics = true;
     this._allowSleep = doSleep;
     this._gravity = gravity;
     this._lock = false;
     this._inv_dt0 = 0f;
     this._contactManager = new ContactManager();
     this._contactManager._world = this;
     this._broadPhase = new BroadPhase(worldAABB, this._contactManager);
     BodyDef def = new BodyDef();
     this._groundBody = this.CreateBody(def);
 }
예제 #2
0
        /// <summary>
        /// Construct a world object.
        /// </summary>
        /// <param name="gravity">The world gravity vector.</param>
        /// <param name="doSleep">Improve performance by not simulating inactive bodies.</param>
        public World(Vec2 gravity, bool doSleep)
        {
            _destructionListener = null;
            _debugDraw = null;

            _bodyList = null;
            _jointList = null;

            _bodyCount = 0;
            _jointCount = 0;

            _warmStarting = true;
            _continuousPhysics = true;

            _allowSleep = doSleep;
            _gravity = gravity;

            _flags = 0;

            _inv_dt0 = 0.0f;

            _contactManager = new ContactManager();
        }
예제 #3
0
 /// <summary>
 /// Sets a drawing routine. Methods on the provided object are called-back to perform drawing on each update.
 /// </summary>
 /// <param name="debugDraw"></param>
 public void SetDebugDraw(DebugDraw debugDraw)
 {
     _world.SetDebugDraw(debugDraw);
 }
예제 #4
0
 /// <summary>
 /// Initialise debug drawing object (interface between Box2D world and openGL rendering).
 /// </summary>
 private void InitDebugDraw()
 {
     // Attach display window drawing routine to the box2d world.
     _debugDraw = new OpenGLDebugDraw();
     uint flags = 0;
     flags += (uint)DebugDraw.DrawFlags.Shape;
     //flags += (uint)DebugDraw.DrawFlags.Joint;
     flags += (uint)DebugDraw.DrawFlags.Controller;
     //flags += (uint)DebugDraw.DrawFlags.CoreShape;
     //flags += (uint)DebugDraw.DrawFlags.Aabb;
     //flags += (uint)DebugDraw.DrawFlags.Obb;
     //flags += (uint)DebugDraw.DrawFlags.Pair;
     //flags += (uint)DebugDraw.DrawFlags.CenterOfMass;
     _debugDraw.Flags = (DebugDraw.DrawFlags)flags;
 }
예제 #5
0
파일: World.cs 프로젝트: colgreen/box2dx
		/// <summary>
		/// Construct a world object.
		/// </summary>
		/// <param name="worldAABB">A bounding box that completely encompasses all your shapes.</param>
		/// <param name="gravity">The world gravity vector.</param>
		/// <param name="doSleep">Improve performance by not simulating inactive bodies.</param>
		public World(AABB worldAABB, Vec2 gravity, bool doSleep)
		{
			_destructionListener = null;
			_boundaryListener = null;
			_contactFilter = WorldCallback.DefaultFilter;
			_contactListener = null;
			_debugDraw = null;

			_bodyList = null;
			_contactList = null;
			_jointList = null;

			_bodyCount = 0;
			_contactCount = 0;
			_jointCount = 0;

			_warmStarting = true;
			_continuousPhysics = true;

			_allowSleep = doSleep;
			_gravity = gravity;

			_lock = false;

			_inv_dt0 = 0.0f;

			_contactManager = new ContactManager();
			_contactManager._world = this;
			_broadPhase = new BroadPhase(worldAABB, _contactManager);

			BodyDef bd = new BodyDef();
			_groundBody = CreateBody(bd);
		}
예제 #6
0
파일: World.cs 프로젝트: colgreen/box2dx
		/// <summary>
		/// Register a routine for debug drawing. The debug draw functions are called
		/// inside the World.Step method, so make sure your renderer is ready to
		/// consume draw commands when you call Step().
		/// </summary>
		/// <param name="debugDraw"></param>
		public void SetDebugDraw(DebugDraw debugDraw)
		{
			_debugDraw = debugDraw;
		}
예제 #7
0
파일: World.cs 프로젝트: litdev1/LitDev
 public void SetDebugDraw(DebugDraw debugDraw)
 {
     this._debugDraw = debugDraw;
 }
예제 #8
0
파일: World.cs 프로젝트: vb0067/LGame
 /// <summary>
 /// Register a routine for debug drawing. The debug draw functions are called
 /// inside the World.Step method, so make sure your renderer is ready to
 /// consume draw commands when you call Step().
 /// </summary>
 /// <param name="debugDraw"></param>
 public void SetDebugDraw(DebugDraw debugDraw)
 {
     _debugDraw = debugDraw;
 }
예제 #9
0
파일: DebugDraw.cs 프로젝트: litdev1/LitDev
 public void ClearFlags(DebugDraw.DrawFlags flags)
 {
     this._drawFlags &= ~flags;
 }
예제 #10
0
파일: DebugDraw.cs 프로젝트: litdev1/LitDev
 public void AppendFlags(DebugDraw.DrawFlags flags)
 {
     this._drawFlags |= flags;
 }