@@ -126,7 +126,7 @@ export default async () => {
126126 state . gltf = gltf ;
127127 const defaultScene = state . gltf . scene ;
128128 state . sceneIndex = defaultScene === undefined ? 0 : defaultScene ;
129- state . cameraIndex = undefined ;
129+ state . cameraNodeIndex = undefined ;
130130
131131 if ( state . gltf . scenes . length != 0 ) {
132132 if ( state . sceneIndex > state . gltf . scenes . length - 1 ) {
@@ -171,7 +171,7 @@ export default async () => {
171171 . then ( ( gltf ) => {
172172 state . gltf = gltf ;
173173 state . sceneIndex = 0 ;
174- state . cameraIndex = undefined ;
174+ state . cameraNodeIndex = undefined ;
175175
176176 uiModel . exitLoadingState ( ) ;
177177 redraw = true ;
@@ -200,7 +200,7 @@ export default async () => {
200200 const sceneChangedObservable = uiModel . scene . pipe (
201201 map ( ( sceneIndex ) => {
202202 state . sceneIndex = sceneIndex ;
203- state . cameraIndex = undefined ;
203+ state . cameraNodeIndex = undefined ;
204204 const scene = state . gltf . scenes [ state . sceneIndex ] ;
205205 if ( scene !== undefined ) {
206206 scene . applyTransformHierarchy ( state . gltf ) ;
@@ -218,9 +218,9 @@ export default async () => {
218218 const cameraExportChangedObservable = uiModel . cameraValuesExport . pipe (
219219 map ( ( ) => {
220220 const camera =
221- state . cameraIndex === undefined
221+ state . cameraNodeIndex === undefined
222222 ? state . userCamera
223- : state . gltf . cameras [ state . cameraIndex ] ;
223+ : state . gltf . cameras [ state . cameraNodeIndex ] ;
224224 return camera . getDescription ( state . gltf ) ;
225225 } )
226226 ) ;
@@ -257,7 +257,7 @@ export default async () => {
257257 listenForRedraw ( uiModel . scene ) ;
258258
259259 uiModel . camera . subscribe (
260- ( camera ) => ( state . cameraIndex = camera !== - 1 ? camera : undefined )
260+ ( camera ) => ( state . cameraNodeIndex = camera !== - 1 ? camera : undefined )
261261 ) ;
262262 listenForRedraw ( uiModel . camera ) ;
263263
@@ -447,21 +447,21 @@ export default async () => {
447447 uiModel . attachCameraChangeObservable ( sceneChangedStateObservable ) ;
448448
449449 uiModel . orbit . subscribe ( ( orbit ) => {
450- if ( state . cameraIndex === undefined ) {
450+ if ( state . cameraNodeIndex === undefined ) {
451451 state . userCamera . orbit ( orbit . deltaPhi , orbit . deltaTheta ) ;
452452 }
453453 } ) ;
454454 listenForRedraw ( uiModel . orbit ) ;
455455
456456 uiModel . pan . subscribe ( ( pan ) => {
457- if ( state . cameraIndex === undefined ) {
457+ if ( state . cameraNodeIndex === undefined ) {
458458 state . userCamera . pan ( pan . deltaX , - pan . deltaY ) ;
459459 }
460460 } ) ;
461461 listenForRedraw ( uiModel . pan ) ;
462462
463463 uiModel . zoom . subscribe ( ( zoom ) => {
464- if ( state . cameraIndex === undefined ) {
464+ if ( state . cameraNodeIndex === undefined ) {
465465 state . userCamera . zoomBy ( zoom . deltaZoom ) ;
466466 }
467467 } ) ;
0 commit comments