Adding a return value in boundary condition.

This commit is contained in:
Uwe Oestermeier 2019-05-31 15:32:13 +02:00
parent aafa528f03
commit f39b7ae14a
1 changed files with 3 additions and 1 deletions

View File

@ -410,7 +410,9 @@ export class AbstractScatter extends Throwable {
keepOnStage(velocity, collision = 0.5) {
let stagePolygon = this.containerPolygon
if (!stagePolygon) return
// UO: since keepOnStage is called in nextVelocity we need to
// ensure a return value
if (!stagePolygon) return { x: 0, y: 0}
let polygon = this.polygon
let bounced = this.bouncing()
if (bounced) {