[LayaAir 1.0]laya1.0 绘制物理引擎?

body.CreateFixture(fixtureDef);
var debugDraw = new PDynamic.b2DebugDraw();
debugDraw.SetSprite(Laya.Render.canvas.getContext("2d"));
debugDraw.SetDrawScale(this.worldScale);
debugDraw.SetFillAlpha(0.5);
debugDraw.SetFlags(PDynamic.b2DebugDraw.e_shapeBit | PDynamic.b2DebugDraw.e_jointBit);
this.world.SetDebugDraw(debugDraw);
Laya.timer.loop(1000/60,this,this.updateWorld);

 
this.world.Step(1/30,10,10);
this.world.DrawDebugData();
this.world.ClearForces(); // 清除作用力
 
不知道有什么办法 可以绘制出来 看看效果....
已邀请:

Aar0n

赞同来自:

matterjs官方的demo 可以看看

要回复问题请先

商务合作
商务合作