Skip to content

Commit

Permalink
cap deceleration to dt
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdickinson committed Feb 18, 2013
1 parent f8f36c9 commit aba124e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -72,7 +72,7 @@ proto.tick = function(dt) {
world_desired.z = 0

if(!this.resting.x) {
acceleration.x /= 8
acceleration.x /= 8 * dt
acceleration.x += forces.x * dt

velocity.x += acceleration.x * dt
Expand All @@ -87,7 +87,7 @@ proto.tick = function(dt) {
acceleration.x = velocity.x = 0
}
if(!this.resting.y) {
acceleration.y /= 8
acceleration.y /= 8 * dt
acceleration.y += forces.y * dt

velocity.y += acceleration.y * dt
Expand All @@ -102,7 +102,7 @@ proto.tick = function(dt) {
acceleration.y = velocity.y = 0
}
if(!this.resting.z) {
acceleration.z /= 8
acceleration.z /= 8 * dt
acceleration.z += forces.z * dt

velocity.z += acceleration.z * dt
Expand Down

0 comments on commit aba124e

Please sign in to comment.