-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow auto-deployment with react-native-pod #117
Open
rhdeck
wants to merge
11
commits into
react-native-ar:master
Choose a base branch
from
rhdeck:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6d22bde
Changing dependency to use the PocketSVG pod
rhdeck 908925e
Adding react-native-pod peer dependency
rhdeck 699e26a
Adding sample app code
rhdeck 582a9a4
Adding sample app for make-demo
rhdeck fd87a53
Fixing sample package.json to remove reference to the make-demo-app
rhdeck fafdbd2
Removing sample app files - adding sample app pointer
rhdeck 70f9338
Fixing package.json typo
rhdeck b6c8c6f
Merge branch 'master' into master
rhdeck e694cf4
Merge https://github.com/HippoAR/react-native-arkit
rhdeck 66a6eea
Adding peer dependency of react-native-fix-ios-version because this r…
rhdeck 62c9821
Merge remote-tracking branch 'upstream/master'
rhdeck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
import React, { Component } from 'react'; | ||
import { AppRegistry, View , NativeModules} from 'react-native'; | ||
import { ARKit } from 'react-native-arkit'; | ||
export default class App extends Component { | ||
constructor() { | ||
super(); | ||
this.state = { | ||
text: "beginning text" | ||
} | ||
setTimeout(()=>{ | ||
this.setState(()=>{ | ||
return {text:"He's OK"} | ||
}); | ||
}, 5000) | ||
} | ||
componentDidMount() { | ||
this.setState(()=> { | ||
return {text: "Wilkimg is the best!"} | ||
}) | ||
|
||
} | ||
render() { | ||
return ( | ||
<View style={{ flex: 1 }}> | ||
<ARKit | ||
style={{ flex: 1 }} | ||
debug | ||
planeDetection | ||
// enable light estimation (defaults to true) | ||
lightEstimationEnabled | ||
// get the current lightEstimation (if enabled) | ||
// it fires rapidly, so better poll it from outside with | ||
// ARKit.getCurrentLightEstimation() | ||
onLightEstimation={e => console.log(e.nativeEvent)} | ||
onPlaneDetected={console.log} // event listener for plane detection | ||
onPlaneUpdate={console.log} // event listener for plane update | ||
> | ||
<ARKit.Box | ||
position={{ x: 0, y: 0, z: 0 }} | ||
shape={{ width: 0.1, height: 0.1, length: 0.1, chamfer: 0.01 }} | ||
/> | ||
<ARKit.Sphere | ||
position={{ x: 0.2, y: 0, z: 0 }} | ||
shape={{ radius: 0.05 }} | ||
/> | ||
<ARKit.Cylinder | ||
position={{ x: 0.4, y: 0, z: 0 }} | ||
shape={{ radius: 0.05, height: 0.1 }} | ||
/> | ||
<ARKit.Cone | ||
position={{ x: 0, y: 0.2, z: 0 }} | ||
shape={{ topR: 0, bottomR: 0.05, height: 0.1 }} | ||
/> | ||
<ARKit.Pyramid | ||
position={{ x: 0.2, y: 0.15, z: 0 }} | ||
shape={{ width: 0.1, height: 0.1, length: 0.1 }} | ||
/> | ||
<ARKit.Tube | ||
position={{ x: 0.4, y: 0.2, z: 0 }} | ||
shape={{ innerR: 0.03, outerR: 0.05, height: 0.1 }} | ||
/> | ||
<ARKit.Torus | ||
position={{ x: 0, y: 0.4, z: 0 }} | ||
shape={{ ringR: 0.06, pipeR: 0.02 }} | ||
/> | ||
<ARKit.Capsule | ||
position={{ x: 0.2, y: 0.4, z: 0 }} | ||
shape={{ capR: 0.02, height: 0.06 }} | ||
/> | ||
<ARKit.Plane | ||
position={{ x: 0.4, y: 0.4, z: 0 }} | ||
shape={{ width: 0.1, height: 0.1 }} | ||
/> | ||
<ARKit.Text | ||
text={this.state.text} | ||
position={{ x: 0.2, y: 0.6, z: 0 }} | ||
font={{ size: 0.15, depth: 0.05 }} | ||
/> | ||
<ARKit.Light | ||
position={{ x: 1, y: 3, z: 2 }} | ||
type={ARKit.LightType.Omni} | ||
color="white" | ||
/> | ||
<ARKit.Light | ||
position={{ x: 0, y: 1, z: 0 }} | ||
type={ARKit.LightType.Spot} | ||
eulerAngles={{ x: -Math.PI / 2 }} | ||
spotInnerAngle={45} | ||
spotOuterAngle={45} | ||
color="green" | ||
/> | ||
<ARKit.Model | ||
position={{ x: -0.2, y: 0, z: 0, frame: 'local' }} | ||
scale={0.01} | ||
model={{ | ||
file: 'art.scnassets/ship.scn', // make sure you have the model file in the ios project | ||
}} | ||
/> | ||
<ARKit.Shape | ||
position={{ x: -1, y: 0, z: 0 }} | ||
eulerAngles={{ | ||
x: Math.PI, | ||
}} | ||
scale={0.01} | ||
shape={{ | ||
// specify shape by svg! See https://github.com/HippoAR/react-native-arkit/pull/89 for details | ||
pathSvg: ` | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> | ||
<path d="M50,30c9-22 42-24 48,0c5,40-40,40-48,65c-8-25-54-25-48-65c 6-24 39-22 48,0 z" fill="#F00" stroke="#000"/> | ||
</svg>`, | ||
pathFlatness: 0.1, | ||
// it's also possible to specify a chamfer profile: | ||
chamferRadius: 5, | ||
chamferProfilePathSvg: ` | ||
<path d="M.6 94.4c.7-7 0-13 6-18.5 1.6-1.4 5.3 1 6-.8l9.6 2.3C25 70.8 20.2 63 21 56c0-1.3 2.3-1 3.5-.7 7.6 1.4 7 15.6 14.7 13.2 1-.2 1.7-1 2-2 2-5-11.3-28.8-3-30.3 2.3-.4 5.7 1.8 6.7 0l8.4 6.5c.3-.4-8-17.3-2.4-21.6 7-5.4 14 5.3 17.7 7.8 1 .8 3 2 3.8 1 6.3-10-6-8.5-3.2-19 2-8.2 18.2-2.3 20.3-3 2.4-.6 1.7-5.6 4.2-6.4"/> | ||
`, | ||
extrusion: 10, | ||
}} | ||
/> | ||
</ARKit> | ||
</View> | ||
); | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,31 @@ | |
"type": "git", | ||
"url": "https://github.com/HippoAR/react-native-arkit.git" | ||
}, | ||
"sampleApp": {"module":"react-native-arkit-sample"}, | ||
"version": "0.6.1-beta.1", | ||
"description": "React Native binding for iOS ARKit", | ||
"author": "Zehao Li <[email protected]>", | ||
"license": "MIT", | ||
"homepage": "https://github.com/HippoAR/react-native-arkit", | ||
"keywords": ["react-native", "react", "native", "ARKit", "AR"], | ||
"keywords": [ | ||
"react-native", | ||
"react", | ||
"native", | ||
"ARKit", | ||
"AR" | ||
], | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"peerDependencies": { | ||
"react-native": ">=0.46.0", | ||
"prop-types": "*", | ||
"react": "*", | ||
"prop-types": "*" | ||
"react-native": ">=0.46.0", | ||
"react-native-pod": "^1.1.0" | ||
}, | ||
"dependencies": { | ||
"@panter/react-animation-frame": "^0.3.7", | ||
"_PocketSVG": "https://github.com/pocketsvg/PocketSVG", | ||
"fast-deep-equal": "^1.0.0", | ||
"lodash": "^4.17.4", | ||
"prop-types": "^15.5.7" | ||
|
@@ -38,7 +45,10 @@ | |
"eslint-plugin-prettier": "^2.1.1", | ||
"eslint-plugin-react": "^7.0.1", | ||
"prettier": "^1.3.1", | ||
"react": "16.0.0-alpha.12", | ||
"prop-types": "^15.5.8" | ||
"prop-types": "^15.5.8", | ||
"react": "16.0.0-alpha.12" | ||
}, | ||
"pods": { | ||
"PocketSVG": "*" | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will remove all the appsample stuff. I learned how to do a react-native template, and it is a better approach.