Mercurial > projects > openmelee
comparison ship.d @ 14:af1e8620f027
fixed steering
author | zzzzrrr <mason.green@gmail.com> |
---|---|
date | Mon, 23 Mar 2009 14:06:47 -0400 |
parents | e1004697cae1 |
children | 8e6a9e390cba |
comparison
equal
deleted
inserted
replaced
13:e1004697cae1 | 14:af1e8620f027 |
---|---|
79 this.world = world; | 79 this.world = world; |
80 shapes = new ShapeList; | 80 shapes = new ShapeList; |
81 } | 81 } |
82 | 82 |
83 void thrust() { | 83 void thrust() { |
84 | |
85 rBody.force += engineForce.rotate(rBody.angle); | 84 rBody.force += engineForce.rotate(rBody.angle); |
86 } | 85 } |
87 | 86 |
88 void turnLeft() { | 87 void turnLeft() { |
89 | 88 |
95 | 94 |
96 rBody.torque += bzCross(rightTurnPoint.rotate(rBody.angle), | 95 rBody.torque += bzCross(rightTurnPoint.rotate(rBody.angle), |
97 turnForce.rotate(rBody.angle)); | 96 turnForce.rotate(rBody.angle)); |
98 } | 97 } |
99 | 98 |
100 void setGravity() { | 99 void setPlanetGravity() { |
101 float minRadius = 0.1; | 100 float minRadius = 0.1; |
102 float maxRadius = 10; | 101 float maxRadius = 10; |
103 float strength = 3.5; | 102 float strength = 3.5; |
104 bzVec2 center = bzVec2(0,0); | 103 bzVec2 center = bzVec2(0,0); |
105 auto attractor = new bzAttractor(rBody, center, strength, minRadius, maxRadius); | 104 auto attractor = new bzAttractor(rBody, center, strength, minRadius, maxRadius); |