{"_id":"5a06037134873d0010b3922a","category":{"_id":"5a06037134873d0010b39204","version":"5a06037134873d0010b391fe","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-01T23:04:12.838Z","from_sync":false,"order":5,"slug":"api-reference","title":"API Reference"},"project":"578c4badbd223d2000cc1441","user":"576c22a3808cf02b00d37419","parentDoc":null,"version":{"_id":"5a06037134873d0010b391fe","project":"578c4badbd223d2000cc1441","__v":1,"createdAt":"2017-11-10T19:52:17.163Z","releaseDate":"2017-11-10T19:52:17.163Z","categories":["5a06037134873d0010b391ff","5a06037134873d0010b39200","5a06037134873d0010b39201","5a06037134873d0010b39202","5a06037134873d0010b39203","5a06037134873d0010b39204"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.1.0","version":"2.1.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-18T19:05:26.283Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":25,"body":"A component that allows the set up of a sub-scene only rendered and accessible through the use of a [ViroPortal](doc:viroportal) component.\n\n######Example use:\n```\n<ViroScene>\n  <ViroPortalScene position={[0, -1, 0]}>\n    <ViroPortal position={[0, 0, -1]} scale={[.5, .5, .5]}>\n      <Viro3DObject source={require('./res/portalFrame.obj')} type=\"OBJ\"/>\n    </ViroPortal>\n    ...\n  </ViroPortalScene>\n  ...\n</ViroScene>\n```\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Props\"\n}\n[/block]\n\n##Optional Props\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**animation**\",\n    \"12-0\": \"**onScroll**\",\n    \"13-0\": \"**onSwipe**\",\n    \"18-0\": \"**position**\",\n    \"19-0\": \"**rotation**\",\n    \"21-0\": \"**scale**\",\n    \"23-0\": \"**transformBehaviors**\",\n    \"24-0\": \"**visible**\",\n    \"25-0\": \"**rotation**\",\n    \"26-0\": \"**scale**\",\n    \"27-0\": \"**transformBehaviors**\",\n    \"29-0\": \"**volume**\",\n    \"30-0\": \"**visible**\",\n    \"28-0\": \"**width**\",\n    \"h-0\": \"PropKey\",\n    \"h-1\": \"PropType\",\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    \"12-1\": \"**PropTypes.func**\\n\\nCalled when the user performs a scroll action, while hovering on the control.\\n\\nFor example:\\n```  \\n_onScroll(scrollPos, source)  {\\n    // scrollPos[0]: x scroll position from 0.0 to 1.0. \\n    // scrollPos[1]: y scroll position from 0.0 to 1.0.\\n}\\n```\\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.\\n\\nUnsupported VR Platforms: Cardboard(Android and iOS)\",\n    \"13-1\": \"**PropTypes.func**\\n\\nCalled when the user performs a swipe gesture on the physical controller, while hovering on this control. \\n\\nFor example:\\n```  \\n_onSwipe(state, source)  {\\n    if(state == 1) {\\n        // Swiped up\\n    } else if(state == 2) {\\n        // Swiped down\\n    } else if(state == 3) { \\n       // Swiped left\\n    } else if(state == 4) { \\n       // Swiped right\\n    }\\n}\\n```\\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.\\n\\nUnsupported VR Platforms: Cardboard(Android and iOS)\",\n    \"18-1\": \"**PropTypes.arrayOf(PropTypes.number)**\\n\\nCartesian position in 3D space, stored as [x, y, z].\",\n    \"19-1\": \"**PropTypes.arrayOf(PropTypes.number)**\\n\\nThe rotation of the container  around it's local axis specified as Euler angles [x, y, z]. Units for each angle are specified in degrees.\",\n    \"21-1\": \"**PropTypes.arrayOf(PropTypes.number)**\\n\\nThe scale of the container in 3D space, specified as [x,y,z]. A scale of 1 represents the current size of the container. A scale value of < 1 will make the container proportionally smaller while a value >1 will make the container proportionally bigger along the specified axis.\",\n    \"23-1\": \"**PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string),PropTypes.string])**\\n\\nAn array of transform constraints that affect the transform of the container. For example, putting the value \\\"billboard\\\" will ensure the container is facing the user as the user rotates their head on any axis. This is useful for having the container always face the user on a particular axis.\\n\\nAllowed values(values are case sensitive):\\n\\n|Value|Description|\\n|:------|:----------:|\\n|billboard| Billboard object on x,y,z axis |\\n|billboardX| Billboard object on the x axis|\\n|billboardY| Billboard object on the y axis|\",\n    \"24-1\": \"**PropTypes.bool**\\n\\nFalse if the container should be hidden. By default the container is visible and this value is true.\",\n    \"25-1\": \"PropTypes.arrayOf(PropTypes.number)\\n\\nPut the PropType Description here.\",\n    \"26-1\": \"PropTypes.arrayOf(PropTypes.number)\\n\\nPut the PropType Description here.\",\n    \"27-1\": \"PropTypes.arrayOf(PropTypes.string)\\n\\nPut the PropType Description here.\",\n    \"28-1\": \"PropTypes.number\\n\\nPut the PropType Description here.\",\n    \"29-1\": \"PropTypes.number\\n\\nPut the PropType Description here.\",\n    \"30-1\": \"PropTypes.bool\\n\\nPut the PropType Description here.\",\n    \"7-0\": \"**onHover**\",\n    \"7-1\": \"**React.PropTypes.func**\\nFunction to be invoked when the user hovers on or off the container view. If defined, this is only invoked if the child hovered upon doesn't have onHover defined. \\n\\nFor instance, let's say you have a <ViroFlexView> that contains a few buttons and text. If none of them have a onHover handler defined, and they get hovered upon, then this function will invoke, effectively capturing the onHover event from it's children.\\n\\nFor example:\\n```  \\n_onHover(isHovering)  {\\n    if(isHovering) {\\n        // user is hovering on the container view.\\n    } else {\\n        // user is no longer hovering on the container view.\\n    }\\n}\\n```\",\n    \"4-0\": \"**onClickState**\",\n    \"4-1\": \"**PropTypes.func**\\n\\nCalled for each click state an object goes through as it is clicked. Supported click states and their values are the following:\\n\\n|State Value|Description|\\n|:------|:----------:|\\n|1| Click Down: Triggered when the user has performed a click down action while hovering on this control.|\\n|2| Click Up: Triggered when the user has performed a click up action while hovering on this control.|\\n|3| Clicked: Triggered when the user has performed both a click down and click up action on this control sequentially, thereby having \\\"Clicked\\\" the object.|\\n\\nExample code:\\n```  \\n_onClickState(stateValue, source)  {\\n    if(stateValue == 1) {\\n        // Click Down\\n    } else if(stateValue == 2) {\\n        // Click Up\\n    } else if(stateValue == 3) { \\n        // Clicked\\n    }\\n}\\n```\\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.\",\n    \"5-0\": \"**onDrag**\",\n    \"5-1\": \"**PropTypes.func**\\n\\nCalled when the view is currently being dragged. The dragToPos parameter provides the current 3D location of the dragged object. \\n\\nExample code:\\n```  \\n_onDrag(dragToPos, source)  {\\n    // dragtoPos[0]: x position\\n    // dragtoPos[1]: y position\\n    // dragtoPos[2]: z position\\n}\\n``` \\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section. \\n\\nUnsupported VR Platforms: Cardboard iOS\",\n    \"14-0\": \"**onTouch**\",\n    \"14-1\": \"**PropTypes.func**\\n\\nCalled when the user performs a touch action, while hovering on the control. Provides the touch state type, and the x/y coordinate at which this touch event has occurred.\\n\\n|State Value|Description|\\n|:------|:----------:|\\n|1| Touch Down: Triggered when the user  makes physical contact with the touch pad on the controller. |\\n|2| Touch Down Move: Called when the user moves around the touch pad immediately after having performed a Touch Down action. |\\n|3| Touch Up: Triggered after the user is no longer in physical contact with the touch pad after a Touch Down action. |\\n\\nFor example:\\n```  \\n_onTouch(state, touchPos, source)  {\\n   var touchX = touchPos[0];\\n   var touchY = touchPos[1];\\n    if(state == 1) {\\n        // Touch Down\\n    } else if(state == 2) {\\n        // Touch Down Move\\n    } else if(state == 3) { \\n        // Touch Up\\n    }\\n}\\n```\\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.\\n\\nUnsupported VR Platforms: Cardboard(Android and iOS).\",\n    \"16-0\": \"**opacity**\",\n    \"16-1\": \"**PropTypes.number**\\n\\nA number from 0 to 1 that specifies the opacity of the container. A value of 1 translates into a fully opaque node while 0 represents full transparency.\",\n    \"6-1\": \"**PropTypes.oneOfType**\\n```  \\nPropTypes.oneOfType([\\n      React.PropTypes.shape({\\n        callback: React.PropTypes.func.isRequired,\\n        timeToFuse: PropTypes.number\\n      }),\\n      React.PropTypes.func,\\n])\\n```  \\nAs shown above, onFuse takes one of the types - either a callback, or a dictionary with a callback and duration. \\n\\nIt is called after the user hovers onto and remains hovered on the control for a certain duration of time, as indicated in timeToFuse that represents the duration of time in milliseconds. \\n\\nWhile hovering, the reticle will display a count down animation while fusing towards timeToFuse.\\n\\nNote that timeToFuse defaults to 2000ms.\\n\\nFor example:\\n```  \\n_onFuse(source){\\n   // User has hovered over object for timeToFuse milliseconds\\n}\\n```\\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.\",\n    \"6-0\": \"**onFuse**\",\n    \"22-0\": \"**scalePivot**\",\n    \"20-0\": \"**rotationPivot**\",\n    \"3-0\": \"**onClick**\",\n    \"3-1\": \"**PropTypes.func**\\n\\nCalled when an objeect has been clicked.\\n\\nExample code:\\n```  \\n_onClick(source)  {\\n    // user has clicked the object\\n}\\n```\",\n    \"15-0\": \"**onTransformUpdate**\",\n    \"2-0\": \"**ignoreEventHandling**\",\n    \"1-0\": \"**dragType**\",\n    \"8-0\": \"**onPinch**\",\n    \"1-1\": \"**PropTypes.oneOf([\\\"FixedDistance\\\", \\\"FixedToWorld\\\"])**\\n\\nDetermines the behavior of drag if **onDrag** is specified.\\n\\n|Value|Description|\\n|:------|:----------:|\\n|FixedDistance| Dragging is limited to a fixed radius around the user|\\n|FixedToWorld| Dragging is based on intersection with real world objects. **Available only in AR** |\\n\\nThe default value is \\\"FixedDistance\\\".\",\n    \"2-1\": \"**PropTypes.bool**\\n\\nWhen set to true, this control will ignore events and not prevent controls behind it from receiving event callbacks.\\n\\nThe default value is false.\",\n    \"8-1\": \"**React.PropTypes.func**\\n\\nCalled when the user performs a pinch gesture on the control. When the pinch starts, the scale factor is set to 1 is relative to the points of the two touch points.  \\n\\nFor example:\\n```\\n  _onPinch(pinchState, scaleFactor, source) {\\n       if(pinchState == 3) {\\n      // update scale of obj by multiplying by scaleFactor  when pinch ends.\\n        return;\\n       }\\n     //set scale using native props to reflect pinch.\\n  }\\n```\\npinchState can be the following values:\\n\\n|State Value|Description|\\n|:------|:----------:|\\n|1| Pinch Start: Triggered when the user has started a pinch gesture.|\\n|2| Pinch Move: Triggered when the user has adjusted the pinch, moving both fingers. |\\n|3| Pinch End: When the user has finishes the pinch gesture and released both touch points. |\\n\\n**This event is only available in AR iOS**.\",\n    \"20-1\": \"**PropTypes.arrayOf(PropTypes.number) **\\n\\nCartesian position in [x,y,z] about which rotation is applied relative to the component's position.\",\n    \"22-1\": \"**PropTypes.arrayOf(PropTypes.number) **\\n\\nCartesian position in [x,y,z] from which scale is applied relative to the component's position.\",\n    \"15-1\": \"**PropTypes.func**\\n\\nA function that is invoked when the component moves and provides an array of numbers representing the component's position in world coordinates.\",\n    \"17-0\": \"**passable**\",\n    \"9-0\": \"**onPortalEnter**\",\n    \"10-0\": \"**onPortalExit**\",\n    \"11-0\": \"**onRotate**\",\n    \"11-1\": \"**PropTypes.func**\\n\\nCalled when the user performs a rotation touch gesture on the control. Rotation factor is returned in degrees.\\n\\nWhen setting rotation, the rotation should be relative to it's current rotation, *not* set to the absolute value of the given rotationFactor.\\n\\nFor example:\\n\\n```\\n    _onRotate(rotateState, rotationFactor, source) {\\n\\n      if (rotateState == 3) {\\n        //set to current rotation - rotationFactor.\\n        return;\\n      }\\n     //update rotation using setNativeProps\\n    },\\n\\n```\\nrotationFactor can be the following values:\\n\\n|State Value|Description|\\n|:------|:----------:|\\n|1| Rotation Start: Triggered when the user has started a rotation gesture.|\\n|2| Rotation **Move**: Triggered when the user has adjusted the rotation, moving both fingers. |\\n|3| Rotation End: When the user has finishes the rotation gesture and released both touch points. |\\n\\n**This event is only available in AR iOS**.\",\n    \"9-1\": \"**PropTypes.func**\\n\\nCalled when the user enters into this `ViroPortalScene` through a [ViroPortal](doc:viroportal).\",\n    \"10-1\": \"**PropTypes.func**\\n\\nCalled when the user exits this `ViroPortalScene` through any [ViroPortal](doc:viroportal).\",\n    \"17-1\": \"**PropTypes.bool**\\n\\nIf true, then user is able to enter this `ViroPortalScene` through its [ViroPortal](doc:viroportal).\"\n  },\n  \"cols\": 2,\n  \"rows\": 25\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\": \"async getTransformAsync()\",\n    \"0-0\": \"[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function that returns the component's transform (position, scale and rotation).\\n\\n|Return value | Description|\\n|---|---|\\n| transform | an object that contains \\\"position\\\", \\\"scale\\\" and \\\"rotation\\\" keys which point to number arrays |\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\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":"viroportalscene","type":"basic","title":"ViroPortalScene"}
A component that allows the set up of a sub-scene only rendered and accessible through the use of a [ViroPortal](doc:viroportal) component. ######Example use: ``` <ViroScene> <ViroPortalScene position={[0, -1, 0]}> <ViroPortal position={[0, 0, -1]} scale={[.5, .5, .5]}> <Viro3DObject source={require('./res/portalFrame.obj')} type="OBJ"/> </ViroPortal> ... </ViroPortalScene> ... </ViroScene> ``` [block:api-header] { "type": "basic", "title": "Props" } [/block] ##Optional Props [block:parameters] { "data": { "0-0": "**animation**", "12-0": "**onScroll**", "13-0": "**onSwipe**", "18-0": "**position**", "19-0": "**rotation**", "21-0": "**scale**", "23-0": "**transformBehaviors**", "24-0": "**visible**", "25-0": "**rotation**", "26-0": "**scale**", "27-0": "**transformBehaviors**", "29-0": "**volume**", "30-0": "**visible**", "28-0": "**width**", "h-0": "PropKey", "h-1": "PropType", "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.", "12-1": "**PropTypes.func**\n\nCalled when the user performs a scroll action, while hovering on the control.\n\nFor example:\n``` \n_onScroll(scrollPos, source) {\n // scrollPos[0]: x scroll position from 0.0 to 1.0. \n // scrollPos[1]: y scroll position from 0.0 to 1.0.\n}\n```\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.\n\nUnsupported VR Platforms: Cardboard(Android and iOS)", "13-1": "**PropTypes.func**\n\nCalled when the user performs a swipe gesture on the physical controller, while hovering on this control. \n\nFor example:\n``` \n_onSwipe(state, source) {\n if(state == 1) {\n // Swiped up\n } else if(state == 2) {\n // Swiped down\n } else if(state == 3) { \n // Swiped left\n } else if(state == 4) { \n // Swiped right\n }\n}\n```\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.\n\nUnsupported VR Platforms: Cardboard(Android and iOS)", "18-1": "**PropTypes.arrayOf(PropTypes.number)**\n\nCartesian position in 3D space, stored as [x, y, z].", "19-1": "**PropTypes.arrayOf(PropTypes.number)**\n\nThe rotation of the container around it's local axis specified as Euler angles [x, y, z]. Units for each angle are specified in degrees.", "21-1": "**PropTypes.arrayOf(PropTypes.number)**\n\nThe scale of the container in 3D space, specified as [x,y,z]. A scale of 1 represents the current size of the container. A scale value of < 1 will make the container proportionally smaller while a value >1 will make the container proportionally bigger along the specified axis.", "23-1": "**PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string),PropTypes.string])**\n\nAn array of transform constraints that affect the transform of the container. For example, putting the value \"billboard\" will ensure the container is facing the user as the user rotates their head on any axis. This is useful for having the container always face the user on a particular axis.\n\nAllowed values(values are case sensitive):\n\n|Value|Description|\n|:------|:----------:|\n|billboard| Billboard object on x,y,z axis |\n|billboardX| Billboard object on the x axis|\n|billboardY| Billboard object on the y axis|", "24-1": "**PropTypes.bool**\n\nFalse if the container should be hidden. By default the container is visible and this value is true.", "25-1": "PropTypes.arrayOf(PropTypes.number)\n\nPut the PropType Description here.", "26-1": "PropTypes.arrayOf(PropTypes.number)\n\nPut the PropType Description here.", "27-1": "PropTypes.arrayOf(PropTypes.string)\n\nPut the PropType Description here.", "28-1": "PropTypes.number\n\nPut the PropType Description here.", "29-1": "PropTypes.number\n\nPut the PropType Description here.", "30-1": "PropTypes.bool\n\nPut the PropType Description here.", "7-0": "**onHover**", "7-1": "**React.PropTypes.func**\nFunction to be invoked when the user hovers on or off the container view. If defined, this is only invoked if the child hovered upon doesn't have onHover defined. \n\nFor instance, let's say you have a <ViroFlexView> that contains a few buttons and text. If none of them have a onHover handler defined, and they get hovered upon, then this function will invoke, effectively capturing the onHover event from it's children.\n\nFor example:\n``` \n_onHover(isHovering) {\n if(isHovering) {\n // user is hovering on the container view.\n } else {\n // user is no longer hovering on the container view.\n }\n}\n```", "4-0": "**onClickState**", "4-1": "**PropTypes.func**\n\nCalled for each click state an object goes through as it is clicked. Supported click states and their values are the following:\n\n|State Value|Description|\n|:------|:----------:|\n|1| Click Down: Triggered when the user has performed a click down action while hovering on this control.|\n|2| Click Up: Triggered when the user has performed a click up action while hovering on this control.|\n|3| Clicked: Triggered when the user has performed both a click down and click up action on this control sequentially, thereby having \"Clicked\" the object.|\n\nExample code:\n``` \n_onClickState(stateValue, source) {\n if(stateValue == 1) {\n // Click Down\n } else if(stateValue == 2) {\n // Click Up\n } else if(stateValue == 3) { \n // Clicked\n }\n}\n```\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.", "5-0": "**onDrag**", "5-1": "**PropTypes.func**\n\nCalled when the view is currently being dragged. The dragToPos parameter provides the current 3D location of the dragged object. \n\nExample code:\n``` \n_onDrag(dragToPos, source) {\n // dragtoPos[0]: x position\n // dragtoPos[1]: y position\n // dragtoPos[2]: z position\n}\n``` \nFor the mapping of sources to controller inputs, see the [Events](doc:events) section. \n\nUnsupported VR Platforms: Cardboard iOS", "14-0": "**onTouch**", "14-1": "**PropTypes.func**\n\nCalled when the user performs a touch action, while hovering on the control. Provides the touch state type, and the x/y coordinate at which this touch event has occurred.\n\n|State Value|Description|\n|:------|:----------:|\n|1| Touch Down: Triggered when the user makes physical contact with the touch pad on the controller. |\n|2| Touch Down Move: Called when the user moves around the touch pad immediately after having performed a Touch Down action. |\n|3| Touch Up: Triggered after the user is no longer in physical contact with the touch pad after a Touch Down action. |\n\nFor example:\n``` \n_onTouch(state, touchPos, source) {\n var touchX = touchPos[0];\n var touchY = touchPos[1];\n if(state == 1) {\n // Touch Down\n } else if(state == 2) {\n // Touch Down Move\n } else if(state == 3) { \n // Touch Up\n }\n}\n```\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.\n\nUnsupported VR Platforms: Cardboard(Android and iOS).", "16-0": "**opacity**", "16-1": "**PropTypes.number**\n\nA number from 0 to 1 that specifies the opacity of the container. A value of 1 translates into a fully opaque node while 0 represents full transparency.", "6-1": "**PropTypes.oneOfType**\n``` \nPropTypes.oneOfType([\n React.PropTypes.shape({\n callback: React.PropTypes.func.isRequired,\n timeToFuse: PropTypes.number\n }),\n React.PropTypes.func,\n])\n``` \nAs shown above, onFuse takes one of the types - either a callback, or a dictionary with a callback and duration. \n\nIt is called after the user hovers onto and remains hovered on the control for a certain duration of time, as indicated in timeToFuse that represents the duration of time in milliseconds. \n\nWhile hovering, the reticle will display a count down animation while fusing towards timeToFuse.\n\nNote that timeToFuse defaults to 2000ms.\n\nFor example:\n``` \n_onFuse(source){\n // User has hovered over object for timeToFuse milliseconds\n}\n```\nFor the mapping of sources to controller inputs, see the [Events](doc:events) section.", "6-0": "**onFuse**", "22-0": "**scalePivot**", "20-0": "**rotationPivot**", "3-0": "**onClick**", "3-1": "**PropTypes.func**\n\nCalled when an objeect has been clicked.\n\nExample code:\n``` \n_onClick(source) {\n // user has clicked the object\n}\n```", "15-0": "**onTransformUpdate**", "2-0": "**ignoreEventHandling**", "1-0": "**dragType**", "8-0": "**onPinch**", "1-1": "**PropTypes.oneOf([\"FixedDistance\", \"FixedToWorld\"])**\n\nDetermines the behavior of drag if **onDrag** is specified.\n\n|Value|Description|\n|:------|:----------:|\n|FixedDistance| Dragging is limited to a fixed radius around the user|\n|FixedToWorld| Dragging is based on intersection with real world objects. **Available only in AR** |\n\nThe default value is \"FixedDistance\".", "2-1": "**PropTypes.bool**\n\nWhen set to true, this control will ignore events and not prevent controls behind it from receiving event callbacks.\n\nThe default value is false.", "8-1": "**React.PropTypes.func**\n\nCalled when the user performs a pinch gesture on the control. When the pinch starts, the scale factor is set to 1 is relative to the points of the two touch points. \n\nFor example:\n```\n _onPinch(pinchState, scaleFactor, source) {\n if(pinchState == 3) {\n // update scale of obj by multiplying by scaleFactor when pinch ends.\n return;\n }\n //set scale using native props to reflect pinch.\n }\n```\npinchState can be the following values:\n\n|State Value|Description|\n|:------|:----------:|\n|1| Pinch Start: Triggered when the user has started a pinch gesture.|\n|2| Pinch Move: Triggered when the user has adjusted the pinch, moving both fingers. |\n|3| Pinch End: When the user has finishes the pinch gesture and released both touch points. |\n\n**This event is only available in AR iOS**.", "20-1": "**PropTypes.arrayOf(PropTypes.number) **\n\nCartesian position in [x,y,z] about which rotation is applied relative to the component's position.", "22-1": "**PropTypes.arrayOf(PropTypes.number) **\n\nCartesian position in [x,y,z] from which scale is applied relative to the component's position.", "15-1": "**PropTypes.func**\n\nA function that is invoked when the component moves and provides an array of numbers representing the component's position in world coordinates.", "17-0": "**passable**", "9-0": "**onPortalEnter**", "10-0": "**onPortalExit**", "11-0": "**onRotate**", "11-1": "**PropTypes.func**\n\nCalled when the user performs a rotation touch gesture on the control. Rotation factor is returned in degrees.\n\nWhen setting rotation, the rotation should be relative to it's current rotation, *not* set to the absolute value of the given rotationFactor.\n\nFor example:\n\n```\n _onRotate(rotateState, rotationFactor, source) {\n\n if (rotateState == 3) {\n //set to current rotation - rotationFactor.\n return;\n }\n //update rotation using setNativeProps\n },\n\n```\nrotationFactor can be the following values:\n\n|State Value|Description|\n|:------|:----------:|\n|1| Rotation Start: Triggered when the user has started a rotation gesture.|\n|2| Rotation **Move**: Triggered when the user has adjusted the rotation, moving both fingers. |\n|3| Rotation End: When the user has finishes the rotation gesture and released both touch points. |\n\n**This event is only available in AR iOS**.", "9-1": "**PropTypes.func**\n\nCalled when the user enters into this `ViroPortalScene` through a [ViroPortal](doc:viroportal).", "10-1": "**PropTypes.func**\n\nCalled when the user exits this `ViroPortalScene` through any [ViroPortal](doc:viroportal).", "17-1": "**PropTypes.bool**\n\nIf true, then user is able to enter this `ViroPortalScene` through its [ViroPortal](doc:viroportal)." }, "cols": 2, "rows": 25 } [/block] [block:api-header] { "title": "Methods" } [/block] [block:parameters] { "data": { "h-0": "async getTransformAsync()", "0-0": "[Async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function that returns the component's transform (position, scale and rotation).\n\n|Return value | Description|\n|---|---|\n| transform | an object that contains \"position\", \"scale\" and \"rotation\" keys which point to number arrays |" }, "cols": 1, "rows": 1 } [/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]