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
ファイル: World.cs プロジェクト: rbrother/seikkailulaakso
        /// <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
ファイル: SimulationWorld.cs プロジェクト: colgreen/sharpneat
 /// <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;
 }