tick: function () {
this._updatePivots();
- var THRUST = 5;
+ var THRUST = 3.5;
/* var DRAG_FREE = 0.01;
var DRAG_OPEN = 0.5;
var DRAG_LOCK = 1;
this.body.body.ApplyForceToCenter(leftThrust);
this.body.body.ApplyForceToCenter(rightThrust);
- var cleft = Math.cos(leftAngle);
- var cright = Math.cos(rightAngle);
- var sleft = Math.sin(leftAngle);
- var sright = Math.sin(rightAngle);
-
- var ax = thrust * (cleft - cright);
- var ay = thrust * (sright + sleft);
-
/*
var v = this.body.linearVelocity;
var drag = this.up ? DRAG_OPEN : this.free ? DRAG_FREE : DRAG_LOCK;
ax += CORRECTION * (cleft - cright) * v.y * v.y * Math.sign(v.y);
*/
- this.body.ApplyForce(new b2Vec2(ax, ay), this.body.position);
-
this._updateTransforms();
},
dfn.maxMotorTorque = 100.0;
dfn.motorSpeed = 0.1;
dfn.enableMotor = true;
- dfn.enableLimit = true;
return Box2D.castObject(world.CreateJoint(dfn), Box2D.b2RevoluteJoint);
}
var rightJoint = pinJoint(world, right.body, body.body, [0.1, 5.15]);
this.player.addChildren(leftWing, rightWing);
this.entity0.addChild(this.player);
- leftJoint.SetLimits(0, Math.PI / 2);
- rightJoint.SetLimits(-Math.PI / 2, 0);
var ground = new yuu.E(
new BodyC(bodyFromLine(world, [-100, 0], [100, 0])),