improve grappling hook physics and rendering

This commit is contained in:
Asraelite 2016-03-27 02:22:49 +01:00
parent 4753f879e5
commit 663305bd23
11 changed files with 129 additions and 55 deletions

View file

@ -9,11 +9,23 @@ class Rope extends Copula {
}
get length() {
return this.b2joint.GetMaxLength();
//return this.b2joint.GetMaxLength();
return 8;
}
set length(len) {
this.b2joint.SetMaxLength(len);
//this.b2joint.SetMaxLength(len);
}
packFull() {
return {
type: 'rope',
length: this.length,
bodyA: this.bodyA.id,
bodyB: this.bodyB.id,
posA: this.pointA,
posB: this.pointB
};
}
}