{"_id":"5b36797811baf70003a153a4","category":{"_id":"5b36797811baf70003a15361","version":"5b36797811baf70003a153e5","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","parentDoc":null,"user":"57bb7defafc18c0e00529cf1","version":{"_id":"5b36797811baf70003a153e5","project":"578c4badbd223d2000cc1441","__v":0,"forked_from":"5b17376c3b44af00030764f0","createdAt":"2018-04-23T20:03:35.726Z","releaseDate":"2018-04-23T20:03:35.726Z","categories":["5b36797811baf70003a1535c","5b36797811baf70003a1535d","5b36797811baf70003a1535e","5b36797811baf70003a1535f","5b36797811baf70003a15360","5b36797811baf70003a15361","5b36797811baf70003a15362","5b36797811baf70003a15363","5b36797811baf70003a15364"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.8.1","version":"2.8.1"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-18T04:00:35.605Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":14,"body":"A stationary look around camera through which the user views the world. More than 1 camera may be placed within a scene.\n\n######Example use:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<ViroCamera\\n    position={[0, 0, 0]}\\n    rotation={[45, 0, 0]}\\n    active={true}\\n />\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Props\"\n}\n[/block]\n##Required props\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**active**\",\n    \"0-1\": \"**PropTypes.bool**\\n\\nIf true, sets the corresponding camera as the active one from which we render the world. Setting more than one active camera within a scene will result in undefined behavior.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n##Optional Props \n[block:parameters]\n{\n  \"data\": {\n    \"4-0\": \"**rotation**\",\n    \"5-0\": \"**style**\",\n    \"6-0\": \"**text**\",\n    \"7-0\": \"**transformBehaviors**\",\n    \"9-0\": \"**visible**\",\n    \"8-0\": \"**width**\",\n    \"h-0\": \"PropKey\",\n    \"h-1\": \"PropType\",\n    \"4-1\": \"PropTypes.arrayOf(PropTypes.number)\\n\\nPut the PropType Description here.\",\n    \"5-1\": \"stylePropType\",\n    \"6-1\": \"PropTypes.string\\n\\nPut the PropType Description here.\",\n    \"7-1\": \"PropTypes.arrayOf(PropTypes.string)\\n\\nPut the PropType Description here.\",\n    \"8-1\": \"PropTypes.number\\n\\nPut the PropType Description here.\",\n    \"9-1\": \"PropTypes.bool\\n\\nPut the PropType Description here.\",\n    \"1-0\": \"**fieldOfView**\",\n    \"1-1\": \"**PropTypes.number**\\n\\nSet the field of view for this camera, along the major (larger) axis. Field of view is an angle that determines how wide or narrow the camera lens is when rendering the scene.\\n\\nThis value sets the field of view, in degrees, for the major axis. The major axis is the axis with the larger dimension: the X axis in landscape mode, or the Y axis in portrait mode. By specifying the field of view in terms of the major axis, Viro can keep the field of view consistent upon orientation changes, when the major/minor axes swap. The minor axis field of view is automatically computed from the major axis field of view and the viewport.\\n\\nThis value is ignored on VR and AR platforms, where the FOV is fixed by the VR headset or the AR camera. Else, in non-VR (360 mode) the FOV defaults to 90.\",\n    \"3-0\": \"**rotation**\",\n    \"3-1\": \"**PropTypes.arrayOf(PropTypes.number)**\\n\\nCartesian rotation of the camera in 3D world space, specified as [x, y, z].\",\n    \"2-0\": \"**position**\",\n    \"2-1\": \"**PropTypes.arrayOf(PropTypes.number)**\\n\\nCartesian position of the camera in 3D world space, specified as [x, y, z].\",\n    \"0-0\": \"**animation**\",\n    \"0-1\": \"**PropTypes.shape({\\n      name: PropTypes.string,\\n      delay: PropTypes.number,\\n      loop: PropTypes.bool,\\n      onStart: PropTypes.func,\\n      onFinish: PropTypes.func,\\n      run: PropTypes.bool,\\n    })**\\n\\nA collection of parameters that determine if this component should animate. For more information on animated components please see our [Animation](doc:animation) Guide.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Methods\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"setNativeProps(nativeProps: object)\",\n    \"0-0\": \"A wrapper function around the native component's setNativeProps which allow users to set values on the native component without changing state/setting props and re-rendering. Refer to the React Native documentation on [Direct Manipulation](https://facebook.github.io/react-native/docs/direct-manipulation.html) for more information.\\n\\n|Parameter|Description|\\n|---|---|\\n|nativeProps | an object where the keys are the properties to set and the values are the values to set  |\\n\\nFor example, setting position natively would look like this:\\n\\n```\\ncomponentRef.setNativeProps({\\n    position : [0, 0, -1]\\n});\\n```\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"virocamera","type":"basic","title":"ViroCamera"}
A stationary look around camera through which the user views the world. More than 1 camera may be placed within a scene. ######Example use: [block:code] { "codes": [ { "code": "<ViroCamera\n position={[0, 0, 0]}\n rotation={[45, 0, 0]}\n active={true}\n />", "language": "javascript" } ] } [/block] [block:api-header] { "type": "basic", "title": "Props" } [/block] ##Required props [block:parameters] { "data": { "0-0": "**active**", "0-1": "**PropTypes.bool**\n\nIf true, sets the corresponding camera as the active one from which we render the world. Setting more than one active camera within a scene will result in undefined behavior." }, "cols": 2, "rows": 1 } [/block] ##Optional Props [block:parameters] { "data": { "4-0": "**rotation**", "5-0": "**style**", "6-0": "**text**", "7-0": "**transformBehaviors**", "9-0": "**visible**", "8-0": "**width**", "h-0": "PropKey", "h-1": "PropType", "4-1": "PropTypes.arrayOf(PropTypes.number)\n\nPut the PropType Description here.", "5-1": "stylePropType", "6-1": "PropTypes.string\n\nPut the PropType Description here.", "7-1": "PropTypes.arrayOf(PropTypes.string)\n\nPut the PropType Description here.", "8-1": "PropTypes.number\n\nPut the PropType Description here.", "9-1": "PropTypes.bool\n\nPut the PropType Description here.", "1-0": "**fieldOfView**", "1-1": "**PropTypes.number**\n\nSet the field of view for this camera, along the major (larger) axis. Field of view is an angle that determines how wide or narrow the camera lens is when rendering the scene.\n\nThis value sets the field of view, in degrees, for the major axis. The major axis is the axis with the larger dimension: the X axis in landscape mode, or the Y axis in portrait mode. By specifying the field of view in terms of the major axis, Viro can keep the field of view consistent upon orientation changes, when the major/minor axes swap. The minor axis field of view is automatically computed from the major axis field of view and the viewport.\n\nThis value is ignored on VR and AR platforms, where the FOV is fixed by the VR headset or the AR camera. Else, in non-VR (360 mode) the FOV defaults to 90.", "3-0": "**rotation**", "3-1": "**PropTypes.arrayOf(PropTypes.number)**\n\nCartesian rotation of the camera in 3D world space, specified as [x, y, z].", "2-0": "**position**", "2-1": "**PropTypes.arrayOf(PropTypes.number)**\n\nCartesian position of the camera in 3D world space, specified as [x, y, z].", "0-0": "**animation**", "0-1": "**PropTypes.shape({\n name: PropTypes.string,\n delay: PropTypes.number,\n loop: PropTypes.bool,\n onStart: PropTypes.func,\n onFinish: PropTypes.func,\n run: PropTypes.bool,\n })**\n\nA collection of parameters that determine if this component should animate. For more information on animated components please see our [Animation](doc:animation) Guide." }, "cols": 2, "rows": 4 } [/block] [block:api-header] { "title": "Methods" } [/block] [block:parameters] { "data": { "h-0": "setNativeProps(nativeProps: object)", "0-0": "A wrapper function around the native component's setNativeProps which allow users to set values on the native component without changing state/setting props and re-rendering. Refer to the React Native documentation on [Direct Manipulation](https://facebook.github.io/react-native/docs/direct-manipulation.html) for more information.\n\n|Parameter|Description|\n|---|---|\n|nativeProps | an object where the keys are the properties to set and the values are the values to set |\n\nFor example, setting position natively would look like this:\n\n```\ncomponentRef.setNativeProps({\n position : [0, 0, -1]\n});\n```" }, "cols": 1, "rows": 1 } [/block]