@@ -36,7 +36,7 @@ const EngineScreen: FunctionComponent<ViewProps> = (props: ViewProps) => {
36
36
( scene . activeCamera as ArcRotateCamera ) . beta -= Math . PI / 8 ;
37
37
setCamera ( scene . activeCamera ! ) ;
38
38
scene . createDefaultLight ( true ) ;
39
- const rootNode = new TransformNode ( " Root Container" , scene ) ;
39
+ const rootNode = new TransformNode ( ' Root Container' , scene ) ;
40
40
setRootNode ( rootNode ) ;
41
41
42
42
const deviceSourceManager = new DeviceSourceManager ( engine ) ;
@@ -63,7 +63,7 @@ const EngineScreen: FunctionComponent<ViewProps> = (props: ViewProps) => {
63
63
}
64
64
} ) ;
65
65
66
- const transformContainer = new TransformNode ( " Transform Container" , scene ) ;
66
+ const transformContainer = new TransformNode ( ' Transform Container' , scene ) ;
67
67
transformContainer . parent = rootNode ;
68
68
transformContainer . scaling . scaleInPlace ( 0.2 ) ;
69
69
transformContainer . position . y -= .2 ;
@@ -72,7 +72,7 @@ const EngineScreen: FunctionComponent<ViewProps> = (props: ViewProps) => {
72
72
transformContainer . rotate ( Vector3 . Up ( ) , 0.005 * scene . getAnimationRatio ( ) ) ;
73
73
} ;
74
74
75
- SceneLoader . ImportMeshAsync ( "" , " https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/BoxAnimated/glTF-Binary/BoxAnimated.glb" ) . then ( result => {
75
+ SceneLoader . ImportMeshAsync ( '' , ' https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/BoxAnimated/glTF-Binary/BoxAnimated.glb' ) . then ( result => {
76
76
const mesh = result . meshes [ 0 ] ;
77
77
mesh . parent = transformContainer ;
78
78
} ) ;
@@ -86,7 +86,7 @@ const EngineScreen: FunctionComponent<ViewProps> = (props: ViewProps) => {
86
86
} , [ rootNode , scale ] ) ;
87
87
88
88
const trackingStateToString = ( trackingState : WebXRTrackingState | undefined ) : string => {
89
- return trackingState === undefined ? "" : WebXRTrackingState [ trackingState ] ;
89
+ return trackingState === undefined ? '' : WebXRTrackingState [ trackingState ] ;
90
90
} ;
91
91
92
92
const onToggleXr = useCallback ( ( ) => {
@@ -96,7 +96,7 @@ const EngineScreen: FunctionComponent<ViewProps> = (props: ViewProps) => {
96
96
} else {
97
97
if ( rootNode !== undefined && scene !== undefined ) {
98
98
const xr = await scene . createDefaultXRExperienceAsync ( { disableDefaultUI : true , disableTeleportation : true } )
99
- const session = await xr . baseExperience . enterXRAsync ( " immersive-ar" , " unbounded" , xr . renderTarget ) ;
99
+ const session = await xr . baseExperience . enterXRAsync ( ' immersive-ar' , ' unbounded' , xr . renderTarget ) ;
100
100
setXrSession ( session ) ;
101
101
session . onXRSessionEnded . add ( ( ) => {
102
102
setXrSession ( undefined ) ;
@@ -124,24 +124,24 @@ const EngineScreen: FunctionComponent<ViewProps> = (props: ViewProps) => {
124
124
125
125
const onSnapshot = useCallback ( async ( ) => {
126
126
if ( engineViewCallbacks ) {
127
- setSnapshotData ( " data:image/jpeg;base64," + await engineViewCallbacks . takeSnapshot ( ) ) ;
127
+ setSnapshotData ( ' data:image/jpeg;base64,' + await engineViewCallbacks . takeSnapshot ( ) ) ;
128
128
}
129
129
} , [ engineViewCallbacks ] ) ;
130
130
131
131
return (
132
132
< >
133
133
< View style = { props . style } >
134
134
< Button title = "Toggle EngineView" onPress = { ( ) => { setToggleView ( ! toggleView ) } } />
135
- < Button title = { xrSession ? " Stop XR" : " Start XR" } onPress = { onToggleXr } />
135
+ < Button title = { xrSession ? ' Stop XR' : ' Start XR' } onPress = { onToggleXr } />
136
136
{ ! toggleView &&
137
137
< View style = { { flex : 1 } } >
138
138
{ enableSnapshots &&
139
139
< View style = { { flex : 1 } } >
140
- < Button title = { " Take Snapshot" } onPress = { onSnapshot } />
140
+ < Button title = { ' Take Snapshot' } onPress = { onSnapshot } />
141
141
< Image style = { { flex : 1 } } source = { { uri : snapshotData } } />
142
142
</ View >
143
143
}
144
- < EngineView style = { props . style } camera = { camera } onInitialized = { onInitialized } />
144
+ < EngineView camera = { camera } onInitialized = { onInitialized } />
145
145
< Slider style = { { position : 'absolute' , minHeight : 50 , margin : 10 , left : 0 , right : 0 , bottom : 0 } } minimumValue = { 0.2 } maximumValue = { 2 } step = { 0.01 } value = { defaultScale } onValueChange = { setScale } />
146
146
< Text style = { { fontSize : 12 , color : 'yellow' , position : 'absolute' , margin : 10 } } > { trackingStateToString ( trackingState ) } </ Text >
147
147
</ View >
@@ -163,7 +163,7 @@ const App = () => {
163
163
return (
164
164
< >
165
165
< StatusBar barStyle = "dark-content" />
166
- < SafeAreaView style = { { flex : 1 , backgroundColor : " white" } } >
166
+ < SafeAreaView style = { { flex : 1 , backgroundColor : ' white' } } >
167
167
{ ! toggleScreen &&
168
168
< EngineScreen style = { { flex : 1 } } />
169
169
}
@@ -173,7 +173,7 @@ const App = () => {
173
173
< Text style = { { fontSize : 12 } } > Engine has been disposed, and will be recreated.</ Text >
174
174
</ View >
175
175
}
176
- < Button title = "Toggle EngineScreen" onPress = { ( ) => { setToggleScreen ( ! toggleScreen ) } } />
176
+ < Button title = "Toggle EngineScreen" onPress = { ( ) => { setToggleScreen ( ! toggleScreen ) ; } } />
177
177
</ SafeAreaView >
178
178
</ >
179
179
) ;
0 commit comments