@@ -126,7 +126,7 @@ export default async () => {
126
126
state . gltf = gltf ;
127
127
const defaultScene = state . gltf . scene ;
128
128
state . sceneIndex = defaultScene === undefined ? 0 : defaultScene ;
129
- state . cameraIndex = undefined ;
129
+ state . cameraNodeIndex = undefined ;
130
130
131
131
if ( state . gltf . scenes . length != 0 ) {
132
132
if ( state . sceneIndex > state . gltf . scenes . length - 1 ) {
@@ -171,7 +171,7 @@ export default async () => {
171
171
. then ( ( gltf ) => {
172
172
state . gltf = gltf ;
173
173
state . sceneIndex = 0 ;
174
- state . cameraIndex = undefined ;
174
+ state . cameraNodeIndex = undefined ;
175
175
176
176
uiModel . exitLoadingState ( ) ;
177
177
redraw = true ;
@@ -200,7 +200,7 @@ export default async () => {
200
200
const sceneChangedObservable = uiModel . scene . pipe (
201
201
map ( ( sceneIndex ) => {
202
202
state . sceneIndex = sceneIndex ;
203
- state . cameraIndex = undefined ;
203
+ state . cameraNodeIndex = undefined ;
204
204
const scene = state . gltf . scenes [ state . sceneIndex ] ;
205
205
if ( scene !== undefined ) {
206
206
scene . applyTransformHierarchy ( state . gltf ) ;
@@ -218,9 +218,9 @@ export default async () => {
218
218
const cameraExportChangedObservable = uiModel . cameraValuesExport . pipe (
219
219
map ( ( ) => {
220
220
const camera =
221
- state . cameraIndex === undefined
221
+ state . cameraNodeIndex === undefined
222
222
? state . userCamera
223
- : state . gltf . cameras [ state . cameraIndex ] ;
223
+ : state . gltf . cameras [ state . cameraNodeIndex ] ;
224
224
return camera . getDescription ( state . gltf ) ;
225
225
} )
226
226
) ;
@@ -257,7 +257,7 @@ export default async () => {
257
257
listenForRedraw ( uiModel . scene ) ;
258
258
259
259
uiModel . camera . subscribe (
260
- ( camera ) => ( state . cameraIndex = camera !== - 1 ? camera : undefined )
260
+ ( camera ) => ( state . cameraNodeIndex = camera !== - 1 ? camera : undefined )
261
261
) ;
262
262
listenForRedraw ( uiModel . camera ) ;
263
263
@@ -447,21 +447,21 @@ export default async () => {
447
447
uiModel . attachCameraChangeObservable ( sceneChangedStateObservable ) ;
448
448
449
449
uiModel . orbit . subscribe ( ( orbit ) => {
450
- if ( state . cameraIndex === undefined ) {
450
+ if ( state . cameraNodeIndex === undefined ) {
451
451
state . userCamera . orbit ( orbit . deltaPhi , orbit . deltaTheta ) ;
452
452
}
453
453
} ) ;
454
454
listenForRedraw ( uiModel . orbit ) ;
455
455
456
456
uiModel . pan . subscribe ( ( pan ) => {
457
- if ( state . cameraIndex === undefined ) {
457
+ if ( state . cameraNodeIndex === undefined ) {
458
458
state . userCamera . pan ( pan . deltaX , - pan . deltaY ) ;
459
459
}
460
460
} ) ;
461
461
listenForRedraw ( uiModel . pan ) ;
462
462
463
463
uiModel . zoom . subscribe ( ( zoom ) => {
464
- if ( state . cameraIndex === undefined ) {
464
+ if ( state . cameraNodeIndex === undefined ) {
465
465
state . userCamera . zoomBy ( zoom . deltaZoom ) ;
466
466
}
467
467
} ) ;
0 commit comments