@ignore
(dt?: number)
| 655 | |
| 656 | /** @ignore */ |
| 657 | override update(dt?: number): boolean { |
| 658 | // update the camera position |
| 659 | this.updateTarget(dt); |
| 660 | |
| 661 | // update all active camera effects |
| 662 | if (this.cameraEffects.length > 0) { |
| 663 | for (const fx of this.cameraEffects) { |
| 664 | fx.update(dt ?? 0); |
| 665 | } |
| 666 | // remove completed effects |
| 667 | for (let i = this.cameraEffects.length - 1; i >= 0; i--) { |
| 668 | if (this.cameraEffects[i].isComplete) { |
| 669 | this.cameraEffects[i].destroy(); |
| 670 | this.cameraEffects.splice(i, 1); |
| 671 | } |
| 672 | } |
| 673 | this.isDirty = true; |
| 674 | } |
| 675 | |
| 676 | if (this.isDirty) { |
| 677 | //publish the corresponding message |
| 678 | emit(VIEWPORT_ONCHANGE, this.pos); |
| 679 | } |
| 680 | |
| 681 | if (!this.currentTransform.isIdentity()) { |
| 682 | this.invCurrentTransform.copy(this.currentTransform).invert(); |
| 683 | } else { |
| 684 | // reset to default |
| 685 | this.invCurrentTransform.identity(); |
| 686 | } |
| 687 | |
| 688 | return super.update(dt ?? 0); |
| 689 | } |
| 690 | |
| 691 | /** |
| 692 | * shake the camera |
no test coverage detected