Mercurial > projects > openmelee
diff main.d @ 14:af1e8620f027
fixed steering
author | zzzzrrr <mason.green@gmail.com> |
---|---|
date | Mon, 23 Mar 2009 14:06:47 -0400 |
parents | e1004697cae1 |
children | 8e6a9e390cba |
line wrap: on
line diff
--- a/main.d Mon Mar 23 08:02:23 2009 -0400 +++ b/main.d Mon Mar 23 14:06:47 2009 -0400 @@ -77,20 +77,20 @@ StopWatch timer; jobHub.addRepeatableJob( { - // Update AI - ai.move(whut.ship1); // Update physics whut.world.step(timeStep, settings.velocityIterations, settings.positionIterations); + // Update AI + ai.move(whut.ship1); }, ITERS_PER_SECOND); bool running = true; jobHub.addPreFrameJob( { + whut.ship1.limitVelocity(); + whut.ship2.limitVelocity(); whut.ship1.updateState(); whut.ship2.updateState(); - whut.ship1.limitVelocity(); - whut.ship2.limitVelocity(); }); jobHub.addPostFrameJob( { @@ -115,7 +115,7 @@ vec2 p2 = vec2.from(whut.ship2.rBody.position); vec2 distance = p1 - p2; float d = distance.length; - whut.zoom = bzClamp(1/d*1000, 5, 50); + whut.zoom = bzClamp(1/d*1000, 2, 50); whut.viewCenter = p1 - (distance * 0.5f); }