|
@@ -69,6 +69,7 @@ export class Ball extends Entity
|
69
|
69
|
this._mesh = null;
|
70
|
70
|
this._lastTrigger = '';
|
71
|
71
|
this._collisionFlags = 0;
|
|
72
|
+ this._locked = false;
|
72
|
73
|
}
|
73
|
74
|
|
74
|
75
|
/**
|
|
@@ -126,6 +127,9 @@ export class Ball extends Entity
|
126
|
127
|
impostor.setLinearVelocity(BABYLON.Vector3.Zero());
|
127
|
128
|
impostor.mass = 0; // disable gravity
|
128
|
129
|
|
|
130
|
+ if(this._locked)
|
|
131
|
+ return;
|
|
132
|
+
|
129
|
133
|
if(ar.pointers.length > 0) {
|
130
|
134
|
const pointer = ar.pointers[0];
|
131
|
135
|
const position = ar.session.viewport.convertToPixels(pointer.position, pointer.tracker.space);
|
|
@@ -428,6 +432,14 @@ export class Ball extends Entity
|
428
|
432
|
case 'netready':
|
429
|
433
|
event.detail.entity.setBall(this._mesh);
|
430
|
434
|
break;
|
|
435
|
+
|
|
436
|
+ case 'gameover':
|
|
437
|
+ this._locked = true;
|
|
438
|
+ break;
|
|
439
|
+
|
|
440
|
+ case 'restarted':
|
|
441
|
+ this._locked = false;
|
|
442
|
+ break;
|
431
|
443
|
}
|
432
|
444
|
}
|
433
|
445
|
}
|