Add scale to models
This commit is contained in:
@@ -95,11 +95,11 @@ def enableProguardInReleaseBuilds = false
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
buildToolsVersion "27.0.3"
|
buildToolsVersion "27.0.3"
|
||||||
compileSdkVersion 25
|
compileSdkVersion 27
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.deightonar"
|
applicationId "com.deightonar"
|
||||||
minSdkVersion 23
|
minSdkVersion 24
|
||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0.0"
|
versionName "1.0.0"
|
||||||
|
|||||||
@@ -22,14 +22,17 @@ const shapes = {
|
|||||||
order: {
|
order: {
|
||||||
source: require("./models/hardhat_obj.obj"),
|
source: require("./models/hardhat_obj.obj"),
|
||||||
resources: [require("./models/hardhat.mtl")],
|
resources: [require("./models/hardhat.mtl")],
|
||||||
|
scale: [0.5, 0.5, 0.5],
|
||||||
},
|
},
|
||||||
complaint: {
|
complaint: {
|
||||||
source: require("./models/question_obj.obj"),
|
source: require("./models/question_obj.obj"),
|
||||||
resources: [require("./models/question.mtl")],
|
resources: [require("./models/question.mtl")],
|
||||||
|
scale: [1, 1, 1],
|
||||||
},
|
},
|
||||||
inspection: {
|
inspection: {
|
||||||
source: require("./models/clipboard_obj.obj"),
|
source: require("./models/clipboard_obj.obj"),
|
||||||
resources: [require("./models/clipboard.mtl")],
|
resources: [require("./models/clipboard.mtl")],
|
||||||
|
scale: [1, 1, 1],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +51,6 @@ class WorkItemSceneAR extends React.Component {
|
|||||||
this.state = {
|
this.state = {
|
||||||
position: [0, 0, 0],
|
position: [0, 0, 0],
|
||||||
rotation: [0, 0, 0],
|
rotation: [0, 0, 0],
|
||||||
scale: [0.2, 0.2, 0.2],
|
|
||||||
shouldBillboard: true,
|
shouldBillboard: true,
|
||||||
trackingInitialized: false,
|
trackingInitialized: false,
|
||||||
haveAnchor: false,
|
haveAnchor: false,
|
||||||
@@ -85,8 +87,8 @@ class WorkItemSceneAR extends React.Component {
|
|||||||
(result.transform.position[2] - position[2]) *
|
(result.transform.position[2] - position[2]) *
|
||||||
(result.transform.position[2] - position[2])
|
(result.transform.position[2] - position[2])
|
||||||
)
|
)
|
||||||
if (distance > 0.2 && distance < 10) {
|
if (distance > 1 && distance < 15) {
|
||||||
// If we found a plane greater than .2 and less than 10 meters away then choose it!
|
// If we found a plane a decent distance away, choose it!
|
||||||
hitResultPosition = result.transform.position
|
hitResultPosition = result.transform.position
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -95,7 +97,7 @@ class WorkItemSceneAR extends React.Component {
|
|||||||
// then we'll use it as the initial display point
|
// then we'll use it as the initial display point
|
||||||
let d = distance(position, result.transform.position)
|
let d = distance(position, result.transform.position)
|
||||||
|
|
||||||
if (d > 0.2 && d < 10) {
|
if (d > 1 && d < 15) {
|
||||||
hitResultPosition = result.transform.position
|
hitResultPosition = result.transform.position
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -180,13 +182,12 @@ class WorkItemSceneAR extends React.Component {
|
|||||||
ref={(ref) => (this.arNode = ref)}
|
ref={(ref) => (this.arNode = ref)}
|
||||||
transformBehaviors={shouldBillboard ? "billboardY" : []}
|
transformBehaviors={shouldBillboard ? "billboardY" : []}
|
||||||
position={position}
|
position={position}
|
||||||
scale={scale}
|
|
||||||
rotation={rotation}>
|
rotation={rotation}>
|
||||||
<ViroSpotLight
|
<ViroSpotLight
|
||||||
innerAngle={5}
|
innerAngle={5}
|
||||||
outerAngle={20}
|
outerAngle={20}
|
||||||
direction={[0, -1, 0]}
|
direction={[0, -1, 0]}
|
||||||
position={[0, 15, 0]}
|
position={[0, 30, 0]}
|
||||||
color="#ffffff"
|
color="#ffffff"
|
||||||
castsShadow={true}
|
castsShadow={true}
|
||||||
shadowNearZ={0.1}
|
shadowNearZ={0.1}
|
||||||
@@ -200,6 +201,7 @@ class WorkItemSceneAR extends React.Component {
|
|||||||
position={[0, 0, -1]}
|
position={[0, 0, -1]}
|
||||||
source={shape.source}
|
source={shape.source}
|
||||||
resources={shape.resources}
|
resources={shape.resources}
|
||||||
|
scale={shape.scale}
|
||||||
type="OBJ"
|
type="OBJ"
|
||||||
onLoadEnd={this.handleLoadEnd}
|
onLoadEnd={this.handleLoadEnd}
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
@@ -207,7 +209,7 @@ class WorkItemSceneAR extends React.Component {
|
|||||||
)}
|
)}
|
||||||
<ViroQuad
|
<ViroQuad
|
||||||
rotation={[-90, 0, 0]}
|
rotation={[-90, 0, 0]}
|
||||||
position={[0, -0.001, 0]}
|
position={[0, -0.01, 0]}
|
||||||
width={2.5}
|
width={2.5}
|
||||||
height={2.5}
|
height={2.5}
|
||||||
arShadowReceiver={true}
|
arShadowReceiver={true}
|
||||||
|
|||||||
@@ -338,32 +338,6 @@ export class Home extends React.Component {
|
|||||||
flexBasis: 0,
|
flexBasis: 0,
|
||||||
width: "100%",
|
width: "100%",
|
||||||
}}>
|
}}>
|
||||||
{/*
|
|
||||||
// TODO: Search feature
|
|
||||||
<View
|
|
||||||
style={{
|
|
||||||
flexDirection: "row",
|
|
||||||
alignItems: "center",
|
|
||||||
width: "100%",
|
|
||||||
height: 40,
|
|
||||||
backgroundColor: "white",
|
|
||||||
}}>
|
|
||||||
<Icon
|
|
||||||
name="search"
|
|
||||||
size={16}
|
|
||||||
style={{ marginLeft: 10, marginRight: 5, tintColor: "gray" }}
|
|
||||||
/>
|
|
||||||
<TextInput
|
|
||||||
style={{ flexGrow: 1, flexBasis: 0, height: "100%" }}
|
|
||||||
underlineColorAndroid="white"
|
|
||||||
placeholder="Search"
|
|
||||||
/>
|
|
||||||
<Icon
|
|
||||||
style={{ marginLeft: 5, marginRight: 10 }}
|
|
||||||
name="cancel"
|
|
||||||
size={16}
|
|
||||||
/>
|
|
||||||
</View> */}
|
|
||||||
<SectionList
|
<SectionList
|
||||||
ref={(ref) => (this.sectionList = ref)}
|
ref={(ref) => (this.sectionList = ref)}
|
||||||
style={{ width: "100%", flexGrow: 1 }}
|
style={{ width: "100%", flexGrow: 1 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user