- Sceneform SDK for Android
was open sourced and archived ( github.com/google-ar/sceneform-android-sdk
) with version 1.16.0.
- This site ( developers.google.com/sceneform
) serves as the documentation archive for the previous version, Sceneform SDK for Android
1.15.0.
- Do not use version 1.17.0 of the Sceneform Maven artifacts
.
- The 1.17.1 Maven artifacts can be used. Other than the version, however, the 1.17.1 artifacts are identical to the 1.15.0 artifacts.
TwistGestureRecognizer
Stay organized with collections
Save and categorize content based on your preferences.
Gesture Recognizer for when the user performs a two-finger twist motion on the touch screen.
Nested Classes
interface
Interface definition for a callbacks to be invoked when a TwistGesture
starts.
Inherited Methods
From class
java.lang.Object
Protected Methods
protected
void
tryCreateGestures
( HitTestResult
hitTestResult, MotionEvent
motionEvent)
Parameters
hitTestResult |
motionEvent |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 UTC."],[[["\u003cp\u003eTwistGestureRecognizer detects two-finger twist motions on a touchscreen for user interaction in AR scenes.\u003c/p\u003e\n"],["\u003cp\u003eIt provides a listener to be notified when a twist gesture begins (\u003ca href=\"/sceneform/reference/com/google/ar/sceneform/ux/TwistGestureRecognizer.OnGestureStartedListener\"\u003eOnGestureStartedListener\u003c/a\u003e).\u003c/p\u003e\n"],["\u003cp\u003eIt inherits functionalities from BaseGestureRecognizer to manage gestures and touch events.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use tryCreateGestures to handle gesture creation based on hitTestResult and motionEvent.\u003c/p\u003e\n"]]],["The `TwistGestureRecognizer` class detects two-finger twist motions on a touchscreen. It includes an `OnGestureStartedListener` interface for twist start callbacks. Key actions involve creating the recognizer with `GesturePointersUtility`, using `tryCreateGestures` to initiate gesture recognition based on `HitTestResult` and `MotionEvent`. Inherited methods manage adding/removing listeners and touch input. `BaseGestureRecognizer` class also contains useful methods like `onTouch` and `addOnGestureStartedListener`.\n"],null,["# TwistGestureRecognizer\n\npublic class **TwistGestureRecognizer** \nGesture Recognizer for when the user performs a two-finger twist motion on the touch screen. \n\n### Nested Classes\n\n|-----------|---|---|------------------------------------------------------------------------------------------------------------------------------------------------|\n| interface | [TwistGestureRecognizer.OnGestureStartedListener](/sceneform/reference/com/google/ar/sceneform/ux/TwistGestureRecognizer.OnGestureStartedListener) || Interface definition for a callbacks to be invoked when a [TwistGesture](/sceneform/reference/com/google/ar/sceneform/ux/TwistGesture) starts. |\n\n### Inherited Fields\n\nFrom class [com.google.ar.sceneform.ux.BaseGestureRecognizer](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer) \n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|---|\n| protected final [GesturePointersUtility](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility) | [gesturePointersUtility](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer#gesturePointersUtility) | |\n| protected final [ArrayList](https://developer.android.com/reference/java/util/ArrayList)\\\u003cT extends [BaseGesture](/sceneform/reference/com/google/ar/sceneform/ux/BaseGesture)\\\u003cT\\\u003e\\\u003e | [gestures](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer#gestures) | |\n\n### Public Constructors\n\n|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [TwistGestureRecognizer](/sceneform/reference/com/google/ar/sceneform/ux/TwistGestureRecognizer#TwistGestureRecognizer(com.google.ar.sceneform.ux.GesturePointersUtility))([GesturePointersUtility](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility) gesturePointersUtility) |\n\n### Protected Methods\n\n|------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [tryCreateGestures](/sceneform/reference/com/google/ar/sceneform/ux/TwistGestureRecognizer#tryCreateGestures(com.google.ar.sceneform.HitTestResult,%20android.view.MotionEvent))([HitTestResult](/sceneform/reference/com/google/ar/sceneform/HitTestResult) hitTestResult, [MotionEvent](https://developer.android.com/reference/android/view/MotionEvent) motionEvent) |\n\n### Inherited Methods\n\nFrom class [com.google.ar.sceneform.ux.BaseGestureRecognizer](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer) \n\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [addOnGestureStartedListener](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer#addOnGestureStartedListener(com.google.ar.sceneform.ux.BaseGestureRecognizer.OnGestureStartedListener\u003cT\u003e))([OnGestureStartedListener](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer.OnGestureStartedListener)\\\u003c[TwistGesture](/sceneform/reference/com/google/ar/sceneform/ux/TwistGesture)\\\u003e listener) |\n| void | [onTouch](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer#onTouch(com.google.ar.sceneform.HitTestResult,%20android.view.MotionEvent))([HitTestResult](/sceneform/reference/com/google/ar/sceneform/HitTestResult) hitTestResult, [MotionEvent](https://developer.android.com/reference/android/view/MotionEvent) motionEvent) |\n| void | [removeOnGestureStartedListener](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer#removeOnGestureStartedListener(com.google.ar.sceneform.ux.BaseGestureRecognizer.OnGestureStartedListener\u003cT\u003e))([OnGestureStartedListener](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer.OnGestureStartedListener)\\\u003c[TwistGesture](/sceneform/reference/com/google/ar/sceneform/ux/TwistGesture)\\\u003e listener) |\n| abstract void | [tryCreateGestures](/sceneform/reference/com/google/ar/sceneform/ux/BaseGestureRecognizer#tryCreateGestures(com.google.ar.sceneform.HitTestResult,%20android.view.MotionEvent))([HitTestResult](/sceneform/reference/com/google/ar/sceneform/HitTestResult) hitTestResult, [MotionEvent](https://developer.android.com/reference/android/view/MotionEvent) motionEvent) |\n\nFrom class java.lang.Object \n\n|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [Object](https://developer.android.com/reference/java/lang/Object) | clone() |\n| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object) arg0) |\n| void | finalize() |\n| final [Class](https://developer.android.com/reference/java/lang/Class)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](https://developer.android.com/reference/java/lang/String) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public\n**TwistGestureRecognizer**\n([GesturePointersUtility](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility) gesturePointersUtility)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| gesturePointersUtility | |\n|------------------------|---|\n\nProtected Methods\n-----------------\n\n#### protected void\n**tryCreateGestures**\n([HitTestResult](/sceneform/reference/com/google/ar/sceneform/HitTestResult) hitTestResult, [MotionEvent](https://developer.android.com/reference/android/view/MotionEvent) motionEvent)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| hitTestResult | |\n| motionEvent | |\n|---------------|---|"]]