mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 02:16:51 +02:00
Fix vertical drag in gracefulControls.js
This commit is contained in:
parent
a685bbe541
commit
3b60621e78
1 changed files with 3 additions and 0 deletions
|
@ -141,6 +141,9 @@ function update(dt) {
|
||||||
velocity.z = Math.max(-MAX_SPEED, Math.min(MAX_SPEED, velocity.z));
|
velocity.z = Math.max(-MAX_SPEED, Math.min(MAX_SPEED, velocity.z));
|
||||||
var v = Quat.rotate(MyAvatar.headOrientation, velocity);
|
var v = Quat.rotate(MyAvatar.headOrientation, velocity);
|
||||||
|
|
||||||
|
if (velocityVertical == 0) {
|
||||||
|
targetVelocityVertical -= (velocityVertical * DRAG_COEFFICIENT * dt);
|
||||||
|
}
|
||||||
velocityVertical += targetVelocityVertical;
|
velocityVertical += targetVelocityVertical;
|
||||||
velocityVertical = Math.max(-MAX_SPEED, Math.min(MAX_SPEED, velocityVertical));
|
velocityVertical = Math.max(-MAX_SPEED, Math.min(MAX_SPEED, velocityVertical));
|
||||||
v.y += velocityVertical;
|
v.y += velocityVertical;
|
||||||
|
|
Loading…
Reference in a new issue