[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(); // 清除作用力
不知道有什么办法 可以绘制出来 看看效果....
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(); // 清除作用力
不知道有什么办法 可以绘制出来 看看效果....
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Aar0n
赞同来自: