Skip to content

Commit 1650857

Browse files
committed
Removed debug tests
1 parent 370ccb6 commit 1650857

1 file changed

Lines changed: 11 additions & 39 deletions

File tree

src/input/Pointer.js

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,6 @@ var Pointer = new Class({
389389
* @since 3.10.0
390390
*/
391391
this.active = (id === 0) ? true : false;
392-
393-
this.deltaTime = 0;
394-
this.prevDeltaTime = Date.now();
395-
this.speed = 0;
396392
},
397393

398394
/**
@@ -420,7 +416,7 @@ var Pointer = new Class({
420416
* @private
421417
* @since 3.0.0
422418
*/
423-
reset: function (now)
419+
reset: function ()
424420
{
425421
this.dirty = false;
426422

@@ -430,40 +426,6 @@ var Pointer = new Class({
430426

431427
this.movementX = 0;
432428
this.movementY = 0;
433-
434-
this.deltaTime = now;
435-
436-
// this.velocity.x = 0;
437-
// this.velocity.y = 0;
438-
},
439-
440-
updateMotion: function ()
441-
{
442-
var x1 = this.position.x;
443-
var y1 = this.position.y;
444-
445-
var x2 = this.prevPosition.x;
446-
var y2 = this.prevPosition.y;
447-
448-
var deltaX = x1 - x2;
449-
var deltaY = y1 - y2;
450-
451-
this.velocity.x = deltaX / this.deltaTime || 0;
452-
this.velocity.y = deltaY / this.deltaTime || 0;
453-
this.speed = (Math.abs(this.velocity.x) > Math.abs(this.velocity.y)) ? this.velocity.x : this.velocity.y;
454-
455-
/*
456-
this.velocity.x = x1 - x2;
457-
this.velocity.y = y1 - y2;
458-
459-
this.angle = Math.atan2(y2 - y1, x2 - x1);
460-
*/
461-
462-
// Store previous position
463-
this.prevPosition.x = this.position.x;
464-
this.prevPosition.y = this.position.y;
465-
466-
this.prevDeltaTime = this.deltaTime;
467429
},
468430

469431
/**
@@ -566,6 +528,16 @@ var Pointer = new Class({
566528
// Sets the local x/y properties
567529
this.manager.transformPointer(this, event.pageX, event.pageY, true);
568530

531+
var x1 = this.position.x;
532+
var y1 = this.position.y;
533+
534+
var x2 = this.prevPosition.x;
535+
var y2 = this.prevPosition.y;
536+
537+
this.velocity.x = x1 - x2;
538+
this.velocity.y = y1 - y2;
539+
this.angle = Math.atan2(y2 - y1, x2 - x1);
540+
569541
if (this.manager.mouse.locked)
570542
{
571543
// Multiple DOM events may occur within one frame, but only one Phaser event will fire

0 commit comments

Comments
 (0)