{"_id":"5a06037134873d0010b39218","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-16T17:23:21.170Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":7,"body":"The `ViroARPlaneSelector` is a composite component written entirely in React Native leveraging [ViroARPlane](doc:viroarplane) that provides developers with an easy way to have the end user select a plane they want to use. This component surfaces all the same properties as [ViroARPlane](doc:viroarplane) but rather than attaching the developer's components to the first surface found, it presents end users with white, transparent surfaces which they can select to indicate where they want to have their AR experience.\n\n**Example use:**\n\n```\n<ViroARPlaneSelector minHeight={.5} minWidth={.5} onPlaneSelected={...}>\n  <ViroBox position={[0, .25, 0]} scale={[.5, .5, .5] />\n  ...\n</ViroARPlaneSelector>\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\": \"**dragType**\",\n    \"17-0\": \"**onScroll**\",\n    \"18-0\": \"**onSwipe**\",\n    \"22-0\": \"**visible**\",\n    \"23-0\": \"**rotation**\",\n    \"24-0\": \"**scale**\",\n    \"25-0\": \"**transformBehaviors**\",\n    \"27-0\": \"**volume**\",\n    \"28-0\": \"**visible**\",\n    \"26-0\": \"**width**\",\n    \"h-0\": \"PropKey\",\n    \"h-1\": \"PropType\",\n    \"0-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    \"17-1\": \"**React.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    \"18-1\": \"**React.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    \"22-1\": \"**PropTypes.bool**\\n\\nFalse if the container should be hidden. By default the container is visible and this value is true.\",\n    \"23-1\": \"PropTypes.arrayOf(PropTypes.number)\\n\\nPut the PropType Description here.\",\n    \"24-1\": \"PropTypes.arrayOf(PropTypes.number)\\n\\nPut the PropType Description here.\",\n    \"25-1\": \"PropTypes.arrayOf(PropTypes.string)\\n\\nPut the PropType Description here.\",\n    \"26-1\": \"PropTypes.number\\n\\nPut the PropType Description here.\",\n    \"27-1\": \"PropTypes.number\\n\\nPut the PropType Description here.\",\n    \"28-1\": \"PropTypes.bool\\n\\nPut the PropType Description here.\",\n    \"13-0\": \"**onHover**\",\n    \"13-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    \"9-0\": \"**onClickState**\",\n    \"9-1\": \"**React.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    \"11-0\": \"**onDrag**\",\n    \"11-1\": \"**React.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    \"19-0\": \"**onTouch**\",\n    \"19-1\": \"**React.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    \"20-0\": \"**opacity**\",\n    \"20-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    \"12-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    \"12-0\": \"**onFuse**\",\n    \"8-0\": \"**onClick**\",\n    \"8-1\": \"**React.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    \"4-0\": \"**minWidth**\",\n    \"3-0\": \"**minHeight**\",\n    \"1-0\": \"**ignoreEventHandling**\",\n    \"14-0\": \"**onPinch**\",\n    \"16-0\": \"**onRotate**\",\n    \"10-0\": \"**onCollision**\",\n    \"21-0\": \"**viroTag**\",\n    \"5-0\": \"**onAnchorFound**\",\n    \"6-0\": \"**onAnchorRemoved**\",\n    \"7-0\": \"**onAnchorUpdated**\",\n    \"2-0\": \"**maxPlanes**\",\n    \"15-0\": \"**onPlaneSelected**\",\n    \"1-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    \"14-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    \"16-1\": \"**React.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    \"3-1\": \"**PropTypes.number**\\n\\nSpecifies the minimum height, in meters, of a plane that this component will \\\"anchor\\\" to.\\n\\nThe default value is 0.\",\n    \"4-1\": \"**PropTypes.number**\\n\\nSpecifies the minimum width, in meters, of a plane that this component will \\\"anchor\\\" to.\\n\\nThe default value is 0.\",\n    \"5-1\": \"**PropTypes.func**\\n\\n**Developer should instead listen to `onPlaneSelected`**\\n\\nCalled when this component is anchored to a plane that is at least `minHeight` by `minWidth` large. This is when the component is made visible. \\n\\n|Parameters  | Description |\\n|---|---|\\n|anchor| see [Anchor](doc:viroarplaneselector#anchor) |\",\n    \"6-1\": \"**PropTypes.func**\\n\\nCalled when this component is detached from a plane and is no longer visible.\",\n    \"7-1\": \"**PropTypes.func**\\n\\nCalled when the plane to which this component is anchored is updated.\\n\\n|Parameters  | Description |\\n|---|---|\\n|anchor| see [Anchor](doc:viroarplaneselector#anchor) |\",\n    \"2-1\": \"**PropTypes.number**\\n\\nThe number of planes to present to the end user for them to select. If the AR system discovers more planes than this number, then it will only display the first `maxPlanes` number of planes to the end user.\\n\\nThe default value is 15.\",\n    \"15-1\": \"**React.PropTypes.func**\\n\\nThis function is called when the end user has selected a plane to use.\",\n    \"10-1\": \"**React.PropTypes.func**\\n\\nCalled when this component's physics body collides with another component's physics body. Also invoked by [ViroScene](doc:viroscene)/[ViroARScene](doc:viroarscene)'s `findCollisions...` functions.\\n\\n|Return Value | Description |\\n|---|---|\\n|viroTag | the given viroTag (string) of the collided component |\\n|collidedPoint | an array of numbers representing the position, in world coordinates, of the point of collision|\\n|collidedNormal | an array representing the normal of the collision in world coordinates. |\",\n    \"21-1\": \"**PropTypes.string**\\n\\nA tag given to other components when their physics body collides with this component's physics body. Refer to [physics](doc:physics) for more information.\"\n  },\n  \"cols\": 2,\n  \"rows\": 23\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Anchor\"\n}\n[/block]\nThis is the object given to the developer through the `onAnchorFound` and `onAnchorUpdated` callback functions.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Value\",\n    \"0-0\": \"position\",\n    \"1-0\": \"rotation\",\n    \"2-0\": \"center\",\n    \"3-0\": \"width\",\n    \"4-0\": \"height\",\n    \"3-1\": \"**number**\\n\\nCurrent width of the attached plane\",\n    \"4-1\": \"**number**\\n\\nCurrent height of the attached plane\",\n    \"0-1\": \"**arrayOf(number)**\\n\\nPosition of the attached plane in world coordinates.\",\n    \"1-1\": \"**arrayOf(number)**\\n\\nRotation of the attached plane in world coordinates.\",\n    \"2-1\": \"**arrayOf(number)**\\n\\nCenter of the underlying plane relative to the plane's position.\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\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\": \"reset()\",\n    \"0-0\": \"This function resets the `ARPlaneSelector` back to the \\\"selection\\\" state which presents the end user with all planes that have been found by the AR system (up to `maxPlanes` number of planes).\"\n  },\n  \"cols\": 1,\n  \"rows\": 1\n}\n[/block]","excerpt":"","slug":"viroarplaneselector","type":"basic","title":"ViroARPlaneSelector"}

ViroARPlaneSelector


The `ViroARPlaneSelector` is a composite component written entirely in React Native leveraging [ViroARPlane](doc:viroarplane) that provides developers with an easy way to have the end user select a plane they want to use. This component surfaces all the same properties as [ViroARPlane](doc:viroarplane) but rather than attaching the developer's components to the first surface found, it presents end users with white, transparent surfaces which they can select to indicate where they want to have their AR experience. **Example use:** ``` <ViroARPlaneSelector minHeight={.5} minWidth={.5} onPlaneSelected={...}> <ViroBox position={[0, .25, 0]} scale={[.5, .5, .5] /> ... </ViroARPlaneSelector> ``` [block:api-header] { "type": "basic", "title": "Props" } [/block] ##Optional Props [block:parameters] { "data": { "0-0": "**dragType**", "17-0": "**onScroll**", "18-0": "**onSwipe**", "22-0": "**visible**", "23-0": "**rotation**", "24-0": "**scale**", "25-0": "**transformBehaviors**", "27-0": "**volume**", "28-0": "**visible**", "26-0": "**width**", "h-0": "PropKey", "h-1": "PropType", "0-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\".", "17-1": "**React.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)", "18-1": "**React.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)", "22-1": "**PropTypes.bool**\n\nFalse if the container should be hidden. By default the container is visible and this value is true.", "23-1": "PropTypes.arrayOf(PropTypes.number)\n\nPut the PropType Description here.", "24-1": "PropTypes.arrayOf(PropTypes.number)\n\nPut the PropType Description here.", "25-1": "PropTypes.arrayOf(PropTypes.string)\n\nPut the PropType Description here.", "26-1": "PropTypes.number\n\nPut the PropType Description here.", "27-1": "PropTypes.number\n\nPut the PropType Description here.", "28-1": "PropTypes.bool\n\nPut the PropType Description here.", "13-0": "**onHover**", "13-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```", "9-0": "**onClickState**", "9-1": "**React.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.", "11-0": "**onDrag**", "11-1": "**React.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", "19-0": "**onTouch**", "19-1": "**React.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).", "20-0": "**opacity**", "20-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.", "12-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.", "12-0": "**onFuse**", "8-0": "**onClick**", "8-1": "**React.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```", "4-0": "**minWidth**", "3-0": "**minHeight**", "1-0": "**ignoreEventHandling**", "14-0": "**onPinch**", "16-0": "**onRotate**", "10-0": "**onCollision**", "21-0": "**viroTag**", "5-0": "**onAnchorFound**", "6-0": "**onAnchorRemoved**", "7-0": "**onAnchorUpdated**", "2-0": "**maxPlanes**", "15-0": "**onPlaneSelected**", "1-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.", "14-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**.", "16-1": "**React.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**.", "3-1": "**PropTypes.number**\n\nSpecifies the minimum height, in meters, of a plane that this component will \"anchor\" to.\n\nThe default value is 0.", "4-1": "**PropTypes.number**\n\nSpecifies the minimum width, in meters, of a plane that this component will \"anchor\" to.\n\nThe default value is 0.", "5-1": "**PropTypes.func**\n\n**Developer should instead listen to `onPlaneSelected`**\n\nCalled when this component is anchored to a plane that is at least `minHeight` by `minWidth` large. This is when the component is made visible. \n\n|Parameters | Description |\n|---|---|\n|anchor| see [Anchor](doc:viroarplaneselector#anchor) |", "6-1": "**PropTypes.func**\n\nCalled when this component is detached from a plane and is no longer visible.", "7-1": "**PropTypes.func**\n\nCalled when the plane to which this component is anchored is updated.\n\n|Parameters | Description |\n|---|---|\n|anchor| see [Anchor](doc:viroarplaneselector#anchor) |", "2-1": "**PropTypes.number**\n\nThe number of planes to present to the end user for them to select. If the AR system discovers more planes than this number, then it will only display the first `maxPlanes` number of planes to the end user.\n\nThe default value is 15.", "15-1": "**React.PropTypes.func**\n\nThis function is called when the end user has selected a plane to use.", "10-1": "**React.PropTypes.func**\n\nCalled when this component's physics body collides with another component's physics body. Also invoked by [ViroScene](doc:viroscene)/[ViroARScene](doc:viroarscene)'s `findCollisions...` functions.\n\n|Return Value | Description |\n|---|---|\n|viroTag | the given viroTag (string) of the collided component |\n|collidedPoint | an array of numbers representing the position, in world coordinates, of the point of collision|\n|collidedNormal | an array representing the normal of the collision in world coordinates. |", "21-1": "**PropTypes.string**\n\nA tag given to other components when their physics body collides with this component's physics body. Refer to [physics](doc:physics) for more information." }, "cols": 2, "rows": 23 } [/block] [block:api-header] { "title": "Anchor" } [/block] This is the object given to the developer through the `onAnchorFound` and `onAnchorUpdated` callback functions. [block:parameters] { "data": { "h-0": "Key", "h-1": "Value", "0-0": "position", "1-0": "rotation", "2-0": "center", "3-0": "width", "4-0": "height", "3-1": "**number**\n\nCurrent width of the attached plane", "4-1": "**number**\n\nCurrent height of the attached plane", "0-1": "**arrayOf(number)**\n\nPosition of the attached plane in world coordinates.", "1-1": "**arrayOf(number)**\n\nRotation of the attached plane in world coordinates.", "2-1": "**arrayOf(number)**\n\nCenter of the underlying plane relative to the plane's position." }, "cols": 2, "rows": 5 } [/block] [block:api-header] { "title": "Methods" } [/block] [block:parameters] { "data": { "h-0": "reset()", "0-0": "This function resets the `ARPlaneSelector` back to the \"selection\" state which presents the end user with all planes that have been found by the AR system (up to `maxPlanes` number of planes)." }, "cols": 1, "rows": 1 } [/block]