| 695 | } |
| 696 | |
| 697 | _update() { |
| 698 | // reset model view and apply initial camera transform |
| 699 | // (containing only look at info; no projection). |
| 700 | this.states.setValue("uModelMatrix", this.states.uModelMatrix.clone()); |
| 701 | this.states.uModelMatrix.reset(); |
| 702 | this.states.setValue("uViewMatrix", this.states.uViewMatrix.clone()); |
| 703 | this.states.uViewMatrix.set(this.states.curCamera.cameraMatrix); |
| 704 | |
| 705 | // reset light data for new frame. |
| 706 | |
| 707 | this.states.setValue("ambientLightColors", []); |
| 708 | this.states.setValue("specularColors", [1, 1, 1]); |
| 709 | |
| 710 | this.states.setValue("directionalLightDirections", []); |
| 711 | this.states.setValue("directionalLightDiffuseColors", []); |
| 712 | this.states.setValue("directionalLightSpecularColors", []); |
| 713 | |
| 714 | this.states.setValue("pointLightPositions", []); |
| 715 | this.states.setValue("pointLightDiffuseColors", []); |
| 716 | this.states.setValue("pointLightSpecularColors", []); |
| 717 | |
| 718 | this.states.setValue("spotLightPositions", []); |
| 719 | this.states.setValue("spotLightDirections", []); |
| 720 | this.states.setValue("spotLightDiffuseColors", []); |
| 721 | this.states.setValue("spotLightSpecularColors", []); |
| 722 | this.states.setValue("spotLightAngle", []); |
| 723 | this.states.setValue("spotLightConc", []); |
| 724 | |
| 725 | this.states.setValue("enableLighting", false); |
| 726 | |
| 727 | //reset tint value for new frame |
| 728 | this.states.setValue("tint", new Color([1,1,1,1])); |
| 729 | |
| 730 | //Clear depth every frame |
| 731 | this._resetBuffersBeforeDraw(); |
| 732 | } |
| 733 | |
| 734 | background(...args) { |
| 735 | const a0 = args[0]; |