@@ -1844,6 +1844,8 @@ class Camera {
18441844 _cam . projMatrix = this . projMatrix . copy ( ) ;
18451845 _cam . yScale = this . yScale ;
18461846
1847+ _cam . cameraType = this . cameraType ;
1848+
18471849 return _cam ;
18481850 }
18491851
@@ -2945,15 +2947,18 @@ function camera(p5, fn){
29452947 p5 . Camera = Camera ;
29462948
29472949 RendererGL . prototype . camera = function ( ...args ) {
2950+ this . states . setValue ( 'curCamera' , this . states . curCamera . clone ( ) ) ;
29482951 this . states . curCamera . camera ( ...args ) ;
29492952 } ;
29502953
29512954 RendererGL . prototype . perspective = function ( ...args ) {
2955+ this . states . setValue ( 'curCamera' , this . states . curCamera . clone ( ) ) ;
29522956 this . states . curCamera . perspective ( ...args ) ;
29532957 } ;
29542958
29552959 RendererGL . prototype . linePerspective = function ( enable ) {
29562960 if ( enable !== undefined ) {
2961+ this . states . setValue ( 'curCamera' , this . states . curCamera . clone ( ) ) ;
29572962 // Set the line perspective if enable is provided
29582963 this . states . curCamera . useLinePerspective = enable ;
29592964 } else {
@@ -2963,10 +2968,12 @@ function camera(p5, fn){
29632968 } ;
29642969
29652970 RendererGL . prototype . ortho = function ( ...args ) {
2971+ this . states . setValue ( 'curCamera' , this . states . curCamera . clone ( ) ) ;
29662972 this . states . curCamera . ortho ( ...args ) ;
29672973 } ;
29682974
29692975 RendererGL . prototype . frustum = function ( ...args ) {
2976+ this . states . setValue ( 'curCamera' , this . states . curCamera . clone ( ) ) ;
29702977 this . states . curCamera . frustum ( ...args ) ;
29712978 } ;
29722979
0 commit comments