Fixed throwing problems with 2+ pointers
This commit is contained in:
+3
-1
@@ -127,7 +127,9 @@ class Throwable {
|
||||
this.lastframe = t
|
||||
if (dt > 0) {
|
||||
// Avoid division by zero errors later on
|
||||
let velocity = { t: t, dt: dt, dx: delta.x, dy: delta.y }
|
||||
// and consider the number of involved pointers sind addVelocity will be called by the
|
||||
// onMove events
|
||||
let velocity = { t: t, dt: dt, dx: delta.x / delta.number, dy: delta.y / delta.number}
|
||||
this.velocities.push(velocity)
|
||||
while (this.velocities.length > buffer) {
|
||||
this.velocities.shift()
|
||||
|
||||
Reference in New Issue
Block a user