Update RN and Viro. iOS build working

This commit is contained in:
John Lyon-Smith
2018-05-09 11:23:11 -07:00
parent 93cfa3b4dc
commit ccd159bb47
13 changed files with 1886 additions and 2274 deletions

View File

@@ -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}