add ship rendering and damping
This commit is contained in:
parent
05ad81ed8d
commit
80bd84230d
22 changed files with 66 additions and 6 deletions
|
@ -25,6 +25,8 @@ class Physics {
|
|||
bodyDef.active = true;
|
||||
bodyDef.linearVelocity = new b2Vec2(body.xvel / s || 0, body.yvel / s || 0);
|
||||
bodyDef.angularVelocity = body.rvel || 0;
|
||||
bodyDef.linearDamping = 0.001;
|
||||
bodyDef.angularDamping = 0.001;
|
||||
bodyDef.type = body.type == 'static' ?
|
||||
Box2D.b2BodyType.b2_staticBody : Box2D.b2BodyType.b2_dynamicBody;
|
||||
if (body.player) bodyDef.allowSleep = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue