Guard to prevent warm-up animation from overshooting start position when dropping frames
This commit is contained in:
13
package-lock.json
generated
13
package-lock.json
generated
@@ -5871,7 +5871,8 @@
|
|||||||
},
|
},
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"aproba": {
|
"aproba": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
@@ -6236,7 +6237,8 @@
|
|||||||
},
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"safer-buffer": {
|
"safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
@@ -6284,6 +6286,7 @@
|
|||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-regex": "^2.0.0"
|
"ansi-regex": "^2.0.0"
|
||||||
}
|
}
|
||||||
@@ -6322,11 +6325,13 @@
|
|||||||
},
|
},
|
||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"bundled": true
|
"bundled": true,
|
||||||
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -121,14 +121,18 @@ AFRAME.registerComponent('beat', {
|
|||||||
} else {
|
} else {
|
||||||
// Only check collisions when close.
|
// Only check collisions when close.
|
||||||
const collisionZThreshold = -4;
|
const collisionZThreshold = -4;
|
||||||
|
|
||||||
if (position.z > collisionZThreshold) { this.checkCollisions(); }
|
if (position.z > collisionZThreshold) { this.checkCollisions(); }
|
||||||
|
|
||||||
// Move.
|
// Move.
|
||||||
if (position.z < this.startPositionZ) {
|
if (position.z < this.startPositionZ) {
|
||||||
|
let newPositionZ = position.z + BEAT_WARMUP_SPEED * (timeDelta / 1000);
|
||||||
// Warm up / warp in.
|
// Warm up / warp in.
|
||||||
position.z += BEAT_WARMUP_SPEED * (timeDelta / 1000);
|
if (newPositionZ < this.startPositionZ) {
|
||||||
if (position.z >= this.startPositionZ) {
|
|
||||||
this.beams.newBeam(this.data.color, position);
|
this.beams.newBeam(this.data.color, position);
|
||||||
|
position.z = newPositionZ;
|
||||||
|
} else {
|
||||||
|
position.z = this.startPositionZ;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Standard moving.
|
// Standard moving.
|
||||||
|
|||||||
Reference in New Issue
Block a user