Update RN and Viro. iOS build working
This commit is contained in:
@@ -10,7 +10,8 @@ import {
|
||||
Viro3DObject,
|
||||
ViroSpotLight,
|
||||
ViroNode,
|
||||
ViroSurface,
|
||||
ViroQuad,
|
||||
ViroConstants,
|
||||
} from "react-viro"
|
||||
import autobind from "autobind-decorator"
|
||||
import backImage from "./images/back.png"
|
||||
@@ -136,8 +137,13 @@ class WorkItemSceneAR extends React.Component {
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleTrackingInitialized() {
|
||||
this.setState({ trackingInitialized: true })
|
||||
handleTrackingUpdated(state, reason) {
|
||||
if (
|
||||
!this.state.trackingInitialized &&
|
||||
state === ViroConstants.TRACKING_NORMAL
|
||||
) {
|
||||
this.setState({ trackingInitialized: true })
|
||||
}
|
||||
}
|
||||
|
||||
@autobind
|
||||
@@ -169,7 +175,7 @@ class WorkItemSceneAR extends React.Component {
|
||||
<ViroARScene
|
||||
anchorDetectionTypes="PlanesHorizontal"
|
||||
ref={(ref) => (this.arScene = ref)}
|
||||
onTrackingInitialized={this.handleTrackingInitialized}
|
||||
onTrackingUpdated={this.handleTrackingUpdated}
|
||||
onAnchorFound={this.handleAnchorFound}>
|
||||
<ViroAmbientLight color="#ffffff" intensity={200} />
|
||||
<ViroNode
|
||||
@@ -201,7 +207,7 @@ class WorkItemSceneAR extends React.Component {
|
||||
onClick={this.handleClick}
|
||||
/>
|
||||
)}
|
||||
<ViroSurface
|
||||
<ViroQuad
|
||||
rotation={[-90, 0, 0]}
|
||||
position={[0, -0.001, 0]}
|
||||
width={2.5}
|
||||
|
||||
Reference in New Issue
Block a user