Fix vertical drag in gracefulControls.js

This commit is contained in:
Ryan Huffman 2014-08-14 23:08:07 -07:00
parent a685bbe541
commit 3b60621e78

View file

@ -141,6 +141,9 @@ function update(dt) {
velocity.z = Math.max(-MAX_SPEED, Math.min(MAX_SPEED, velocity.z));
var v = Quat.rotate(MyAvatar.headOrientation, velocity);
if (velocityVertical == 0) {
targetVelocityVertical -= (velocityVertical * DRAG_COEFFICIENT * dt);
}
velocityVertical += targetVelocityVertical;
velocityVertical = Math.max(-MAX_SPEED, Math.min(MAX_SPEED, velocityVertical));
v.y += velocityVertical;