Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Should tilt the drone correctly when moving left/right front/back

the direction it's moving should be tilted down like in real life.
drone going left, left hand side is lowered
drone going forward, front is lowered.
etc.
  • Loading branch information...
commit e6e64dc2a0cf79585486f987838f5782a9e80632 1 parent 1bfae59
@raldred raldred authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 index.js
View
4 index.js
@@ -282,11 +282,11 @@ Drone.prototype._handlePCMD = function(dt, drone, cmd) {
// todo: figure auto leveling out
// when it hits 0, it doesnt level for some reason
- rot.rotation.x = anim(dt, rot.rotation.x, frontBack/2);
+ rot.rotation.x = anim(dt, rot.rotation.x, -frontBack/2);
if (frontBack !== 0) drone.velocity.z = frontBack * tilt;
else if (!this._animating) rot.rotation.x = 0;
- rot.rotation.z = anim(dt, rot.rotation.z, leftRight/2);
+ rot.rotation.z = anim(dt, rot.rotation.z, -leftRight/2);
if (leftRight !== 0) drone.velocity.x = -leftRight * tilt;
else if (!this._animating) rot.rotation.z = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.