Compare commits

...

1 Commits

Author SHA1 Message Date
Clément Pasteau
12637f942c wip 2021-12-23 09:19:34 +01:00

View File

@@ -1365,6 +1365,7 @@ namespace gdjs {
}
applyImpulse(impulseX, impulseY, positionX, positionY) {
// If there is no body, set a new one
if (this._body === null) {
this.createBody();
@@ -1373,6 +1374,13 @@ namespace gdjs {
// Wake up the object
this._body.SetAwake(true);
console.log('ahem')
console.log(positionX, positionY);
console.log(this.b2Vec2Sec(
positionX * this._sharedData.invScaleX,
positionY * this._sharedData.invScaleY
))
// Apply the impulse
this._body.ApplyLinearImpulse(
this.b2Vec2(impulseX, impulseY),
@@ -1392,6 +1400,13 @@ namespace gdjs {
// Wake up the object
this._body.SetAwake(true);
console.log('ahem')
console.log(positionX, positionY);
console.log(this.b2Vec2Sec(
positionX * this._sharedData.invScaleX,
positionY * this._sharedData.invScaleY
))
// Apply the impulse
angle = gdjs.toRad(angle);
this._body.ApplyLinearImpulse(