PhysicsDebug.js 833 B

123456789101112131415161718
  1. "atomic component";
  2. var __extends = (this && this.__extends) || function (d, b) {for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];function __() { this.constructor = d; };__.prototype = b.prototype;d.prototype = new __();};
  3. function $bind(n,u){if(null==u)return null;var e;return null==e&&(e=function(){return e.method.apply(e.scope,arguments)},e.scope=n,e.method=u),e};
  4. var PhysicsDebug = (function(_super) {
  5. __extends(PhysicsDebug, _super);
  6. function PhysicsDebug () {
  7. Atomic.JSComponent.call(this);
  8. };
  9. PhysicsDebug.prototype.start = function() {
  10. var debug = this.scene.getComponent("DebugRenderer");
  11. var world = this.scene.getComponent("PhysicsWorld2D");
  12. this.subscribeToEvent("PostRenderUpdate",function(_) {
  13. world.drawDebugGeometry();
  14. });
  15. };
  16. return PhysicsDebug;
  17. })(Atomic.JSComponent);
  18. module.exports = PhysicsDebug;