{"_id":"5bec8a15287d1b00426efe0a","category":{"_id":"5bec8a15287d1b00426efdcb","version":"5bec8a15287d1b00426efe54","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-01T23:04:12.838Z","from_sync":false,"order":8,"slug":"api-reference","title":"API Reference"},"project":"578c4badbd223d2000cc1441","user":"576c22a3808cf02b00d37419","parentDoc":null,"version":{"_id":"5bec8a15287d1b00426efe54","project":"578c4badbd223d2000cc1441","__v":0,"forked_from":"5ba2b5747091250003437507","createdAt":"2018-04-23T20:03:35.726Z","releaseDate":"2018-04-23T20:03:35.726Z","categories":["5bec8a15287d1b00426efdc6","5bec8a15287d1b00426efdc7","5bec8a15287d1b00426efdc8","5bec8a15287d1b00426efdc9","5bec8a15287d1b00426efdca","5bec8a15287d1b00426efdcb","5bec8a15287d1b00426efdcc","5bec8a15287d1b00426efdcd","5bec8a15287d1b00426efdce"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.12.0","version":"2.12.0"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-16T17:39:19.099Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":14,"body":"`ViroARSceneNavigator` is the entry point for AR applications with Viro. For more information about developing in AR, see our Develop page for [Augmented Reality (AR)](doc:augmented-reality-ar).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Props\"\n}\n[/block]\n##Required Props\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"PropKey\",\n    \"h-1\": \"PropType\",\n    \"1-1\": \"**PropTypes.shape( {scene: PropTypes.func.isRequired
} ),**
\\n\\nThe initial AR scene to display for your application on application start.\\n\\nNote: ViroARSceneNavigator only accepts [ViroARScene](doc:viroarscene)\",\n    \"1-0\": \"**initialScene**\",\n    \"0-0\": \"**apiKey**\",\n    \"0-1\": \"**PropTypes.string.isRequired
**
\\n\\nRequired API Key\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n##Optional Props\n[block:parameters]\n{\n  \"data\": {\n    \"h-1\": \"PropType\",\n    \"h-0\": \"PropKey\",\n    \"8-0\": \"**worldAlignment**\",\n    \"8-1\": \"*iOS only - has no effect on Android/ARCore*\\n\\n**PropTypes.oneOf([\\\"Gravity\\\", \\\"GravityAndHeading\\\", \\\"Camera\\\"])**\\n\\nThis property determines the initial orientation/alignment of the world's coordinate system.\\n\\nGravity - origin is the device's starting location and the X-Z plane is perpendicular to gravity.\\nGravityAndHeading - origin is the device's starting location and the X and Z axes are latitudinally and longitudinally aligned.\\nCamera - coordinate system is locked to the camera's current orientation.\",\n    \"0-0\": \"**autofocus**\",\n    \"0-1\": \"**PropTypes.bool**\\n\\nWhether or not to enable autofocus for this AR session.\\n\\nDefault value is true for iOS, false for Android.\\n\\nFalse on Android, since currently (as of ARCore 1.4.0), ARCore's tracking is optimized for auto-focus turned off.\",\n    \"6-0\": \"**videoQuality**\",\n    \"6-1\": \"**iOS 11.3+/ARKit 1.5+ only**\\n\\n**PropTypes.oneOf([\\\"High\\\", \\\"Low\\\"])**\\n\\nSets the video quality either to the highest or lowest possible if the device supports more than 1 applicable video quality.\\n\\nDefault value is \\\"High\\\".\",\n    \"7-0\": \"**viroAppProps**\",\n    \"7-1\": \"**PropTypes.object**\\n\\nA javascript object containing properties for this viro app.  One use would be to pass in properties from native if you're using a hybrid applications.\\n\\nAccess this given props from within [ViroARScene](doc:viroarscene) objects through `this.props.sceneNavigator.viroAppProps`\",\n    \"1-0\": \"**bloomEnabled**\",\n    \"1-1\": \"**PropTypes.bool**\\n\\nEnable or disable bloom. Bloom adds a soft glow to bright areas in scene, simulating the way bright highlights appear to the human eye. To make an object bloom, this property must be enabled, and the objects's threshold for bloom must be set via its material's ```bloomThreshold``` property.\",\n    \"2-0\": \"**hdrEnabled**\",\n    \"2-1\": \"**PropTypes.bool**\\n\\nWhen HDR rendering is enabled, Viro uses a deeper color space and renders to a floating point texture, then applies a tone-mapping algorithm to preserve fine details in both bright and dark regions of the scene. If HDR is disabled, then features like Bloom and PBR will not work, and tone-mapping will be disabled.\\n\\nHDR is not supported on all devices.\",\n    \"4-0\": \"**pbrEnabled**\",\n    \"4-1\": \"**PropTypes.bool**\\n\\nEnable or disable physically-based rendering. Physically based rendering, or PBR, produces more realistic lighting results for your scenes, and provides a more intuitive workflow for artists. To use PBR, this property must be enabled, and materials must use the ```physicallyBased``` lighting model. PBR is controlled by a variety of properties, see [PBR guide](doc:physically-based-rendering) for details.\",\n    \"5-0\": \"**shadowsEnabled**\",\n    \"5-1\": \"**PropTypes.bool**\\n\\nEnable or disable rendering dynamic shadows. If shadows are disabled here, shadow casting lights will simply not cast a shadow.\",\n    \"3-0\": \"**numberOfTrackedImages**\",\n    \"3-1\": \"**iOS 12+/ARKit 2.0+ only** \\n\\n  * **PropTypes.number**\\n\\nTracked images are images that track continuously.  This property represents the max amount of images that should be tracked concurrently. For example, if this number is set to 3, then the first 3 images visible in a scene will be tracked. Even if there are 5 total ViroARImageMarkers only the first 3 will be tracked, if one marker leaves the view, then an untracked marker will then be tracked. \\n\\nKeep in mind that this number should be kept low as the higher the number, the worse the performance.\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Methods\"\n}\n[/block]\nThe following functions are available on the `ViroARSceneNavigator` component. You can get the handle to the `ViroARSceneNavigator`, from your `ViroScene`. Each `ViroScene` added to a `ViroARSceneNavigator` provides its parent navigator in the variable: `this.props.sceneNavigator`.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Push the given scene onto scene stack, displaying the scene to the user.\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|scene    | Scene that will be pushed onto the stack and displayed to the user |\",\n    \"h-0\": \"push(scene: ViroARScene)\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"pop()\",\n    \"0-0\": \"Pop the top most scene of the stack, effectively going back to the previous scene.\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"pop(n: number)\",\n    \"0-0\": \"Go back n scenes at once. If n is equal to 1 this is equivalent to calling pop().\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"jump(scene: ViroARScene)\",\n    \"0-0\": \"Move to the given scene in the stack, removing it from its current position in the stack and placing it on top, thereby displaying it to the user. If the scene is not already on the stack, this method pushes the scene to the top of the stack, displaying it to the user. This is best used in applications where the user jumps between a set of scenes frequently.\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|scene    | Scene that will be moved or pushed to the top of the stack and displayed to the user |\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Replace the currently displayed scene (the scene at the top of the stack) with the given scene, displaying it to the user. This leaves the remainder of the stack unchanged.\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|scene    | Scene that will replace the scene at the top of stack and be displayed to the user |\",\n    \"h-0\": \"replace(scene: ViroARScene)\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"resetARSession(resetTracking: boolean, removeAnchors:boolean)\",\n    \"0-0\": \"**iOS Only**\\n\\nCall this function to reset the ARSession with a combination of the two flags:\\n\\nresetTracking - if true, the scene will realign with the camera's position and orientation.\\nremoveAnchors - if true, the anchors will all be removed (`onAnchorRemoved` will be called on the [ViroARScene](doc:viroarscene)). It's recommended to also set `removeAnchor` to true if `resetTracking` is also set to true.\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"setWorldOrigin(offset:Object)\",\n    \"0-0\": \"**iOS 11.3+/ARKit 1.5+ Only!**\\n\\nThis function transforms the world origin by the given offset. Multiple calls to this function are additive, translating the worldOrigin by the given position/rotation.\\n\\nThe offset `Object` can contain a position and/or a rotation key w/ corresponding values, ie:\\n\\n```\\nthis.arSceneNavigator.setWorldOrigin({\\n  position : [x, y, z],\\n  rotation : [x, y, z],\\n})\\n```\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"startVideoRecording(fileName: string, saveToCameraRoll: bool, onError: func)\",\n    \"0-0\": \"Starts a recording of the ViroARSceneNavigator capturing only Viro-rendered components and external audio (microphone and camera permissions required).\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|fileName    | name of the file saved to app's temporary files. If the name matches an existing file at the location, it will be overridden. A file extension will automatically be added. |\\n|saveToCameraRoll | Whether or not the file should also be saved to the user's Photos at the end of recording. (Requires photo/video saving permissions) |\\n|onError | a function invoked w/ an errorCode if recording encounters an issue. Possible error codes [here](doc:viroconstants#section-video-recording-screenshot-errors).|\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"async stopVideoRecording()\",\n    \"0-0\": \"[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function called to stop video recording.\\n\\n| Return Values | Description |\\n| ------------- |:------------- |\\n| success |  true/false if stopping was successful|\\n| url | path to the file in the application's temporary files. |\\n|errorCode | a number representing an error while stopping recording. Possible error codes [here](doc:viroconstants#section-video-recording-screenshot-errors).|\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"async takeScreenshot(fileName: string, saveToCameraRoll: bool)\",\n    \"0-0\": \"[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function called to take a screenshot of the ViroARSceneNavigator capturing only Viro-rendered components.\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|fileName    | name of the file saved to app's temporary files. If the name matches an existing file at the location, it will be overridden. A file extension will automatically be added. |\\n|saveToCameraRoll | Whether or not the file should also be saved to the user's Photos at the end of recording. (Requires photo/video saving permissions) |\\n\\n| Return Values | Description |\\n| ------------- |:------------- |\\n| success |  true/false if stopping was successful|\\n| url | path to the file in the application's temporary files. |\\n|errorCode | a number representing an error while taking/saving the screenshot. Possible error codes [here](doc:viroconstants#section-video-recording-screenshot-errors).|\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"async project(point:array)\",\n    \"0-0\": \"[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function called that takes a 3d vector representing a 3d world position and returns a vector representing a x,y screen position.\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|point    | A 3d vector that represents a 3d world position. For example, a value of [-1, 4, -5] would represent the point (x:-1, y:4, z:-5) in world space. |\\n\\n| Return Values | Description |\\n| ------------- |:------------- |\\n|screenPosition   | A 2d vector that represents the projected screen position of the passed in **point **parameter. screenPosition[0] will represent the x screen position. screenPosition[1] will store the y screen position. |\\n\\nExample use:\\n```\\n    this.props.arSceneNavigator.project(projectPoint).then((returnPos)=> {\\n      this.setState({\\n          screenX: returnPos[\\\"screenPosition\\\"][0],\\n          screenY: returnPos[\\\"screenPosition\\\"][1],\\n      });\\n    });\\n \\n```\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"async unproject(point:array)\",\n    \"0-0\": \"[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function called that takes a 3d vector representing a 2d screen position plus a value from 0 to 1 representing a interpolation from the near clipping plane and far clipping plane,  and returns a vector representing a x,y,z world space position of the given screen position.\\n\\n|Parameters    | Description |        \\n| ------------- |:------------- |\\n|point    | A 3d vector. point[0] represents the screen x position. point[1] represents the screen y position. point[2] is a value from 0 to 1. 0 will unproject the point on the near clipping plane. A value of 1 will unproject the point on the far clipping plane. A value between 0 and 1 will interpolate between the two planes and unproject the point at that interpolated distance.  For example, a value of [100, 400, 0] would inform the method to unproject the screen position(x:100, y:400) onto the near clipping plane. |\\n\\n| Return Values | Description |\\n| ------------- |:------------- |\\n|position   | A 3d vector that represents the unprojected world position. position[0] will represent the x position. position[1] will store the y position. position[2] will store the z position.\\n\\nExample use:\\n```\\n  this.props.arSceneNavigator.unproject(unprojectPoint).then((returnDict)=> {\\n        this.setState({\\n            unprojectedPoint: returnDict[\\\"position\\\"],\\n        });\\n    });\\n \\n```\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"viroarscenenavigator","type":"basic","title":"ViroARSceneNavigator"}

ViroARSceneNavigator


`ViroARSceneNavigator` is the entry point for AR applications with Viro. For more information about developing in AR, see our Develop page for [Augmented Reality (AR)](doc:augmented-reality-ar). [block:api-header] { "type": "basic", "title": "Props" } [/block] ##Required Props [block:parameters] { "data": { "h-0": "PropKey", "h-1": "PropType", "1-1": "**PropTypes.shape( {scene: PropTypes.func.isRequired
} ),**
\n\nThe initial AR scene to display for your application on application start.\n\nNote: ViroARSceneNavigator only accepts [ViroARScene](doc:viroarscene)", "1-0": "**initialScene**", "0-0": "**apiKey**", "0-1": "**PropTypes.string.isRequired
**
\n\nRequired API Key" }, "cols": 2, "rows": 2 } [/block] ##Optional Props [block:parameters] { "data": { "h-1": "PropType", "h-0": "PropKey", "8-0": "**worldAlignment**", "8-1": "*iOS only - has no effect on Android/ARCore*\n\n**PropTypes.oneOf([\"Gravity\", \"GravityAndHeading\", \"Camera\"])**\n\nThis property determines the initial orientation/alignment of the world's coordinate system.\n\nGravity - origin is the device's starting location and the X-Z plane is perpendicular to gravity.\nGravityAndHeading - origin is the device's starting location and the X and Z axes are latitudinally and longitudinally aligned.\nCamera - coordinate system is locked to the camera's current orientation.", "0-0": "**autofocus**", "0-1": "**PropTypes.bool**\n\nWhether or not to enable autofocus for this AR session.\n\nDefault value is true for iOS, false for Android.\n\nFalse on Android, since currently (as of ARCore 1.4.0), ARCore's tracking is optimized for auto-focus turned off.", "6-0": "**videoQuality**", "6-1": "**iOS 11.3+/ARKit 1.5+ only**\n\n**PropTypes.oneOf([\"High\", \"Low\"])**\n\nSets the video quality either to the highest or lowest possible if the device supports more than 1 applicable video quality.\n\nDefault value is \"High\".", "7-0": "**viroAppProps**", "7-1": "**PropTypes.object**\n\nA javascript object containing properties for this viro app. One use would be to pass in properties from native if you're using a hybrid applications.\n\nAccess this given props from within [ViroARScene](doc:viroarscene) objects through `this.props.sceneNavigator.viroAppProps`", "1-0": "**bloomEnabled**", "1-1": "**PropTypes.bool**\n\nEnable or disable bloom. Bloom adds a soft glow to bright areas in scene, simulating the way bright highlights appear to the human eye. To make an object bloom, this property must be enabled, and the objects's threshold for bloom must be set via its material's ```bloomThreshold``` property.", "2-0": "**hdrEnabled**", "2-1": "**PropTypes.bool**\n\nWhen HDR rendering is enabled, Viro uses a deeper color space and renders to a floating point texture, then applies a tone-mapping algorithm to preserve fine details in both bright and dark regions of the scene. If HDR is disabled, then features like Bloom and PBR will not work, and tone-mapping will be disabled.\n\nHDR is not supported on all devices.", "4-0": "**pbrEnabled**", "4-1": "**PropTypes.bool**\n\nEnable or disable physically-based rendering. Physically based rendering, or PBR, produces more realistic lighting results for your scenes, and provides a more intuitive workflow for artists. To use PBR, this property must be enabled, and materials must use the ```physicallyBased``` lighting model. PBR is controlled by a variety of properties, see [PBR guide](doc:physically-based-rendering) for details.", "5-0": "**shadowsEnabled**", "5-1": "**PropTypes.bool**\n\nEnable or disable rendering dynamic shadows. If shadows are disabled here, shadow casting lights will simply not cast a shadow.", "3-0": "**numberOfTrackedImages**", "3-1": "**iOS 12+/ARKit 2.0+ only** \n\n * **PropTypes.number**\n\nTracked images are images that track continuously. This property represents the max amount of images that should be tracked concurrently. For example, if this number is set to 3, then the first 3 images visible in a scene will be tracked. Even if there are 5 total ViroARImageMarkers only the first 3 will be tracked, if one marker leaves the view, then an untracked marker will then be tracked. \n\nKeep in mind that this number should be kept low as the higher the number, the worse the performance." }, "cols": 2, "rows": 9 } [/block] [block:api-header] { "type": "basic", "title": "Methods" } [/block] The following functions are available on the `ViroARSceneNavigator` component. You can get the handle to the `ViroARSceneNavigator`, from your `ViroScene`. Each `ViroScene` added to a `ViroARSceneNavigator` provides its parent navigator in the variable: `this.props.sceneNavigator`. [block:parameters] { "data": { "0-0": "Push the given scene onto scene stack, displaying the scene to the user.\n\n|Parameters | Description | \n| ------------- |:------------- |\n|scene | Scene that will be pushed onto the stack and displayed to the user |", "h-0": "push(scene: ViroARScene)" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "pop()", "0-0": "Pop the top most scene of the stack, effectively going back to the previous scene." }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "pop(n: number)", "0-0": "Go back n scenes at once. If n is equal to 1 this is equivalent to calling pop()." }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "jump(scene: ViroARScene)", "0-0": "Move to the given scene in the stack, removing it from its current position in the stack and placing it on top, thereby displaying it to the user. If the scene is not already on the stack, this method pushes the scene to the top of the stack, displaying it to the user. This is best used in applications where the user jumps between a set of scenes frequently.\n\n|Parameters | Description | \n| ------------- |:------------- |\n|scene | Scene that will be moved or pushed to the top of the stack and displayed to the user |" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "0-0": "Replace the currently displayed scene (the scene at the top of the stack) with the given scene, displaying it to the user. This leaves the remainder of the stack unchanged.\n\n|Parameters | Description | \n| ------------- |:------------- |\n|scene | Scene that will replace the scene at the top of stack and be displayed to the user |", "h-0": "replace(scene: ViroARScene)" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "resetARSession(resetTracking: boolean, removeAnchors:boolean)", "0-0": "**iOS Only**\n\nCall this function to reset the ARSession with a combination of the two flags:\n\nresetTracking - if true, the scene will realign with the camera's position and orientation.\nremoveAnchors - if true, the anchors will all be removed (`onAnchorRemoved` will be called on the [ViroARScene](doc:viroarscene)). It's recommended to also set `removeAnchor` to true if `resetTracking` is also set to true." }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "setWorldOrigin(offset:Object)", "0-0": "**iOS 11.3+/ARKit 1.5+ Only!**\n\nThis function transforms the world origin by the given offset. Multiple calls to this function are additive, translating the worldOrigin by the given position/rotation.\n\nThe offset `Object` can contain a position and/or a rotation key w/ corresponding values, ie:\n\n```\nthis.arSceneNavigator.setWorldOrigin({\n position : [x, y, z],\n rotation : [x, y, z],\n})\n```" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "startVideoRecording(fileName: string, saveToCameraRoll: bool, onError: func)", "0-0": "Starts a recording of the ViroARSceneNavigator capturing only Viro-rendered components and external audio (microphone and camera permissions required).\n\n|Parameters | Description | \n| ------------- |:------------- |\n|fileName | name of the file saved to app's temporary files. If the name matches an existing file at the location, it will be overridden. A file extension will automatically be added. |\n|saveToCameraRoll | Whether or not the file should also be saved to the user's Photos at the end of recording. (Requires photo/video saving permissions) |\n|onError | a function invoked w/ an errorCode if recording encounters an issue. Possible error codes [here](doc:viroconstants#section-video-recording-screenshot-errors).|" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "async stopVideoRecording()", "0-0": "[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function called to stop video recording.\n\n| Return Values | Description |\n| ------------- |:------------- |\n| success | true/false if stopping was successful|\n| url | path to the file in the application's temporary files. |\n|errorCode | a number representing an error while stopping recording. Possible error codes [here](doc:viroconstants#section-video-recording-screenshot-errors).|" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "async takeScreenshot(fileName: string, saveToCameraRoll: bool)", "0-0": "[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function called to take a screenshot of the ViroARSceneNavigator capturing only Viro-rendered components.\n\n|Parameters | Description | \n| ------------- |:------------- |\n|fileName | name of the file saved to app's temporary files. If the name matches an existing file at the location, it will be overridden. A file extension will automatically be added. |\n|saveToCameraRoll | Whether or not the file should also be saved to the user's Photos at the end of recording. (Requires photo/video saving permissions) |\n\n| Return Values | Description |\n| ------------- |:------------- |\n| success | true/false if stopping was successful|\n| url | path to the file in the application's temporary files. |\n|errorCode | a number representing an error while taking/saving the screenshot. Possible error codes [here](doc:viroconstants#section-video-recording-screenshot-errors).|" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "async project(point:array)", "0-0": "[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function called that takes a 3d vector representing a 3d world position and returns a vector representing a x,y screen position.\n\n|Parameters | Description | \n| ------------- |:------------- |\n|point | A 3d vector that represents a 3d world position. For example, a value of [-1, 4, -5] would represent the point (x:-1, y:4, z:-5) in world space. |\n\n| Return Values | Description |\n| ------------- |:------------- |\n|screenPosition | A 2d vector that represents the projected screen position of the passed in **point **parameter. screenPosition[0] will represent the x screen position. screenPosition[1] will store the y screen position. |\n\nExample use:\n```\n this.props.arSceneNavigator.project(projectPoint).then((returnPos)=> {\n this.setState({\n screenX: returnPos[\"screenPosition\"][0],\n screenY: returnPos[\"screenPosition\"][1],\n });\n });\n \n```" }, "cols": 1, "rows": 1 } [/block] [block:parameters] { "data": { "h-0": "async unproject(point:array)", "0-0": "[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function called that takes a 3d vector representing a 2d screen position plus a value from 0 to 1 representing a interpolation from the near clipping plane and far clipping plane, and returns a vector representing a x,y,z world space position of the given screen position.\n\n|Parameters | Description | \n| ------------- |:------------- |\n|point | A 3d vector. point[0] represents the screen x position. point[1] represents the screen y position. point[2] is a value from 0 to 1. 0 will unproject the point on the near clipping plane. A value of 1 will unproject the point on the far clipping plane. A value between 0 and 1 will interpolate between the two planes and unproject the point at that interpolated distance. For example, a value of [100, 400, 0] would inform the method to unproject the screen position(x:100, y:400) onto the near clipping plane. |\n\n| Return Values | Description |\n| ------------- |:------------- |\n|position | A 3d vector that represents the unprojected world position. position[0] will represent the x position. position[1] will store the y position. position[2] will store the z position.\n\nExample use:\n```\n this.props.arSceneNavigator.unproject(unprojectPoint).then((returnDict)=> {\n this.setState({\n unprojectedPoint: returnDict[\"position\"],\n });\n });\n \n```" }, "cols": 1, "rows": 1 } [/block]