{"id":15038401,"url":"https://github.com/tuarua/ar-ane","last_synced_at":"2025-04-09T23:41:11.526Z","repository":{"id":55421300,"uuid":"113234829","full_name":"tuarua/AR-ANE","owner":"tuarua","description":"ARKit Adobe Air Native Extension for iOS11","archived":false,"fork":false,"pushed_at":"2020-12-31T18:44:40.000Z","size":15828,"stargazers_count":35,"open_issues_count":0,"forks_count":7,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-24T01:35:15.490Z","etag":null,"topics":["actionscript","adobe-air","air-native-extensions","ane","arkit","augmented-reality","ios","native-extension","swift-4"],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuarua.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"tuarua","custom":["paypal.me/tuarua"]}},"created_at":"2017-12-05T21:26:52.000Z","updated_at":"2021-02-23T06:50:46.000Z","dependencies_parsed_at":"2022-08-15T00:00:38.086Z","dependency_job_id":null,"html_url":"https://github.com/tuarua/AR-ANE","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuarua%2FAR-ANE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuarua%2FAR-ANE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuarua%2FAR-ANE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuarua%2FAR-ANE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuarua","download_url":"https://codeload.github.com/tuarua/AR-ANE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131467,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actionscript","adobe-air","air-native-extensions","ane","arkit","augmented-reality","ios","native-extension","swift-4"],"created_at":"2024-09-24T20:38:19.172Z","updated_at":"2025-04-09T23:41:11.506Z","avatar_url":"https://github.com/tuarua.png","language":"ActionScript","funding_links":["https://github.com/sponsors/tuarua","paypal.me/tuarua","https://paypal.me/tuarua"],"categories":[],"sub_categories":[],"readme":"![Adobe AIR + ARKit](arane2.png)\n\nARKit Adobe Air Native Extension for iOS 11.0+\nThis ANE provides bindings for the ARKit API\n\n[ASDocs Documentation](https://tuarua.github.io/asdocs/arane/index.html)\n\n-------------\n\nMuch time, skill and effort has gone into this. Help support the project\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://paypal.me/tuarua)\n\n-------------\n\n## Prerequisites\n\nYou will need:\n\n- IntelliJ IDEA\n- AIR 33.1.1.217+\n- Xcode 14.3\n- [.Net Core Runtime](https://dotnet.microsoft.com/download/dotnet-core/3.1)\n- [AIR-Tools](https://github.com/tuarua/AIR-Tools/)\n\n#### The ANE + Dependencies\n \nChange directory into the _example_ folder eg\n\n```bash\ncd /MyMac/dev/AIR/AR-ANE/example\n```\n\nRun the _\"air-tools\"_ command (You will need [AIR-Tools](https://github.com/tuarua/AIR-Tools/) installed)\n\n```bash\nair-tools install\n```\n\n\n**NEW** This tool now: \n\n1. Downloads the AdMobANE and dependencies.\n1. Applies all required Android Manifest, InfoAdditons and Entitlements to your app.xml. See air package.json\n\n\u003eN.B. You must use a Mac to build an iOS app using this ANE. Windows is **NOT** supported.\n\n#### iOS: Packaging Frameworks Dependencies\n\nThe iOS ANEs are written in Swift. We need to package the Swift libraries (along with a couple of dynamic frameworks) with our AIR app\n\n![https://raw.githubusercontent.com/wiki/tuarua/Firebase-ANE/images/frameworks-package.png](https://raw.githubusercontent.com/wiki/tuarua/Firebase-ANE/images/frameworks-package.png)\n\n-------------\n\n### Getting Started\n\nFirstly, familiarise yourself with the concepts of Apple's ARKit. This ANE is at its core a binding for the ARKit APIs.\n\n### Usage\n```actionscript\narkit = ARANE.arkit;\nif (!arkit.isSupported) {\n    trace(\"ARKIT is NOT Supported on this device\");\n    return;\n}\n\narkit.view3D.showsStatistics = false;\narkit.view3D.automaticallyUpdatesLighting = true;\narkit.view3D.antialiasingMode = AntialiasingMode.multisampling4X;\narkit.view3D.init();\nvar config:WorldTrackingConfiguration = new WorldTrackingConfiguration();\nif (arkit.iosVersion \u003e= 11.3) {\n    config.planeDetection = [PlaneDetection.horizontal, PlaneDetection.vertical];\n} else {\n    config.planeDetection = [PlaneDetection.horizontal];\n}\narkit.view3D.session.run(config, [RunOptions.resetTracking, RunOptions.removeExistingAnchors]);\n```\n### Geometries\n\nThe following geometries based on their SCNKit equivalents are available:\nBox, Sphere, Capsule, Cone, Cylinder, Plane, Pyramid, Torus, Tube\n\n```actionscript\nvar cone:Cone = new Cone(0, 0.05, 0.1);\nvar node:Node = new Node(cone);\narkit.view3D.scene.rootNode.addChildNode(node);\n```\n\n### Materials\n\nMaterials can be supplied as:   \nARGB uint   \nBitmapData   \nString path to image file\n\n```actionscript\nbox.firstMaterial.diffuse.contents = ColorARGB.RED;\n\nsphere.firstMaterial.diffuse.contents = \"materials/globe.png\";\n\n//supply 6 materials for 6 sides of box\nbox.materials = new \u003cMaterial\u003e[redMat, greenMat, blueMat, yellowMat, brownMat, whiteMat];\n```\n\n### Physics\n\n```actionscript\nvar box:Box = new Box(0.1, 0.1, 0.1);\nbox.firstMaterial.diffuse.contents = ColorARGB.ORANGE;\nvar boxNode:Node = new Node(box);\nvar boxShape:PhysicsShape = new PhysicsShape(box);\nvar physicsBody:PhysicsBody = new PhysicsBody(PhysicsBodyType.dynamic, boxShape);\nphysicsBody.allowsResting = true;\n\nboxNode.physicsBody = physicsBody;\nboxNode.position = new Vector3D(0, 0.5, 0);\n\narkit.view3D.scene.rootNode.addChildNode(boxNode);\n```\n\n### Detecting Planes\n\n```actionscript\narkit = ARANE.arkit;\nif (arkit.iosVersion \u003e= 11.3) {\n    config.planeDetection = [PlaneDetection.horizontal, PlaneDetection.vertical];\n} else {\n    config.planeDetection = [PlaneDetection.horizontal];\n}\narkit.addEventListener(PlaneDetectedEvent.ON_PLANE_DETECTED, onPlaneDetected);\n\nprivate function onPlaneDetected(event:PlaneDetectedEvent):void {\n    var planeAnchor:PlaneAnchor = event.anchor;\n    var node:Node = event.node;\n    \n    var plane:Box = new Box(planeAnchor.extent.x, planeAnchor.extent.z, 0);\n    var gridTexture:String = \"materials/grid.png\";\n    plane.firstMaterial.diffuse.contents = gridTexture;\n    \n    var planeNode:Node = new Node(plane);\n    planeNode.position = new Vector3D(planeAnchor.center.x, 0, planeAnchor.center.z)\n    var boxShape:PhysicsShape = new PhysicsShape(plane);\n    planeNode.physicsBody = new PhysicsBody(PhysicsBodyType.static, boxShape);\n    planeNode.eulerAngles = new Vector3D(-Math.PI / 2, 0, 0);\n    node.addChildNode(planeNode);\n}\n```\n\n### Camera Tracking\n\n```actionscript\narkit = ARANE.arkit;\narkit.addEventListener(CameraTrackingEvent.ON_STATE_CHANGE, onCameraTrackingStateChange);\n\nprivate function onCameraTrackingStateChange(event:CameraTrackingEvent):void {\n    switch (event.state) {\n        case TrackingState.notAvailable:\n            break;\n        case TrackingState.normal:\n            break;\n        case TrackingState.limited:\n            switch (event.reason) {\n                case TrackingStateReason.excessiveMotion:\n                    break;\n                case TrackingStateReason.initializing:\n                    break;\n                case TrackingStateReason.insufficientFeatures:\n                    break;\n                case TrackingStateReason.relocalizing:\n                    break;\n            }\n            break;\n    }\n}\n```\n\n### Detecting Touches\n\n```actionscript\narkit = ARANE.arkit;\narkit.addEventListener(TapEvent.ON_SCENE3D_TAP, onSceneTapped);\nprivate function onSceneTapped(event:TapEvent):void {\n    if (event.location) {\n        // look for planes\n        var arHitTestResult:ARHitTestResult = arkit.view3D.hitTest3D(event.location, [HitTestResultType.existingPlaneUsingExtent]);\n        if (arHitTestResult) {\n            // plane tapped\n        }\n        \n        var hitTestResult:HitTestResult = arkit.view3D.hitTest(event.location, new HitTestOptions());\n        trace(\"hitTestResult\", hitTestResult);\n        if (hitTestResult) {\n            // node tapped on\n        }\n    }\n}\n```\n\n### Running on Simulator\n\nARKit won't run on the simulator\n\n### Running on Device\n\nThe example project can be run on the device from IntelliJ using AIR 32.\n\n### Issues\n\nThe Issues section is for bugs and API requests **only**.     \nUse the supplied template or the ticket will be closed.   \nPaid Premium support is available.\n\n### Contributing\n\nIf you have knowledge of ARKit contributions are welcome. This includes adding documentation, sample code and Scenekit models.   \nLikewise, sponsorship or donations will go a long way to pushing the ANE further along.\n\n### Prerequisites\n\nYou will need:\n- a Mac. Windows is not supported\n- an iOS device with an A9 or later processor\n- IntelliJ IDEA / Flash Builder\n- AIR 33.0.2.338+\n- Xcode 11.3\n- wget on macOS via `brew install wget`\n\n### Task List\n\n* Planes\n    - [x] Horizontal Plane Detection\n    - [x] Vertical Plane Detection (iOS 11.3)\n    - [x] Plane Updates\n    - [x] Plane Removal\n    - [x] Apple Sample 'Focus Square'\n* Geometry\n    - [x] Box\n    - [x] Capsule\n    - [x] Cone\n    - [x] Cylinder\n    - [x] Plane\n    - [x] Pyramid\n    - [x] Shape (from SVG)\n    - [x] Sphere\n    - [x] Models\n        - [x] from .scn\n        - [x] from .dae\n    - [ ] Text\n    - [x] Torus\n    - [x] Tube\n* Lighting\n* Materials\n    - [x] Colour\n    - [x] Image\n    - [x] BitmapData\n* Physics\n    - [x] Body\n    - [x] Collision Events\n    - [ ] Vehicle\n* Animation\n* Camera\n   - [x] Tracking\n   - [x] Autofocus (iOS 11.3)\n* Touch\n    - [x] Tap\n    - [x] Swipe\n    - [x] Pinch\n    - [x] Long Press\n* Permissions\n    - [x] Camera\n* Hit Test\n    - [x] Planes\n    - [x] Nodes\n* Image Detection\n    - [x] AR Reference images (iOS 11.3)\n* Object Detection\n    - [x] AR Reference object (iOS 12.0)\n\n\n### References\n* [https://developer.apple.com/documentation/arkit]\n* [https://github.com/eh3rrera/ARKitSceneKitExample]\n* [https://github.com/rosberry/pARtfolio]\n* [https://www.appcoda.com/arkit-physics-scenekit/]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuarua%2Far-ane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuarua%2Far-ane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuarua%2Far-ane/lists"}