Adding a return value in boundary condition.
This commit is contained in:
parent
aafa528f03
commit
f39b7ae14a
@ -410,7 +410,9 @@ export class AbstractScatter extends Throwable {
|
|||||||
|
|
||||||
keepOnStage(velocity, collision = 0.5) {
|
keepOnStage(velocity, collision = 0.5) {
|
||||||
let stagePolygon = this.containerPolygon
|
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 polygon = this.polygon
|
||||||
let bounced = this.bouncing()
|
let bounced = this.bouncing()
|
||||||
if (bounced) {
|
if (bounced) {
|
||||||
|
Loading…
Reference in New Issue
Block a user