- 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.
GesturePointersUtility
Stay organized with collections
Save and categorize content based on your preferences.
Retains/Releases pointer Ids so that each pointer can only be used in one gesture at a time.
Provides helper functions for converting touch coordinates between pixels and inches.
Public Methods
float |
|
boolean |
|
static Vector3
|
|
float |
|
void |
|
void |
|
Inherited Methods
From class
java.lang.Object
Public Methods
public
float
inchesToPixels
(float inches)
public
boolean
isPointerIdRetained
(int pointerId)
public
float
pixelsToInches
(float pixels)
public
void
releasePointerId
(int pointerId)
public
void
retainPointerId
(int pointerId)
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\u003eThe \u003ccode\u003eGesturePointersUtility\u003c/code\u003e class manages pointer IDs to ensure each pointer is used in only one gesture at a time.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for converting touch coordinates between pixels and inches (\u003ccode\u003einchesToPixels\u003c/code\u003e, \u003ccode\u003epixelsToInches\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eYou can check if a pointer ID is currently retained using \u003ccode\u003eisPointerIdRetained\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003emotionEventToPosition\u003c/code\u003e method converts a MotionEvent and pointer ID into a 3D position vector.\u003c/p\u003e\n"],["\u003cp\u003ePointer IDs can be retained and released using \u003ccode\u003eretainPointerId\u003c/code\u003e and \u003ccode\u003ereleasePointerId\u003c/code\u003e, respectively.\u003c/p\u003e\n"]]],["`GesturePointersUtility` manages pointer IDs, ensuring each is used in only one gesture. It converts touch coordinates between pixels and inches using `pixelsToInches` and `inchesToPixels`. `retainPointerId` reserves a pointer ID, while `releasePointerId` frees it. `isPointerIdRetained` checks if an ID is in use. `motionEventToPosition` translates a MotionEvent and pointer ID into a Vector3 position. The constructor requires `DisplayMetrics`.\n"],null,["# GesturePointersUtility\n\npublic class **GesturePointersUtility** \nRetains/Releases pointer Ids so that each pointer can only be used in one gesture at a time.\nProvides helper functions for converting touch coordinates between pixels and inches. \n\n### Public Constructors\n\n|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [GesturePointersUtility](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility#GesturePointersUtility(android.util.DisplayMetrics))([DisplayMetrics](https://developer.android.com/reference/android/util/DisplayMetrics) displayMetrics) |\n\n### Public Methods\n\n|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| float | [inchesToPixels](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility#inchesToPixels(float))(float inches) |\n| boolean | [isPointerIdRetained](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility#isPointerIdRetained(int))(int pointerId) |\n| static [Vector3](/sceneform/reference/com/google/ar/sceneform/math/Vector3) | [motionEventToPosition](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility#motionEventToPosition(android.view.MotionEvent,%20int))([MotionEvent](https://developer.android.com/reference/android/view/MotionEvent) me, int pointerId) |\n| float | [pixelsToInches](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility#pixelsToInches(float))(float pixels) |\n| void | [releasePointerId](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility#releasePointerId(int))(int pointerId) |\n| void | [retainPointerId](/sceneform/reference/com/google/ar/sceneform/ux/GesturePointersUtility#retainPointerId(int))(int pointerId) |\n\n### Inherited Methods\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**GesturePointersUtility**\n([DisplayMetrics](https://developer.android.com/reference/android/util/DisplayMetrics) displayMetrics)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| displayMetrics | |\n|----------------|---|\n\nPublic Methods\n--------------\n\n#### public float\n**inchesToPixels**\n(float inches)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| inches | |\n|--------|---|\n\n#### public boolean\n**isPointerIdRetained**\n(int pointerId)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| pointerId | |\n|-----------|---|\n\n#### public static [Vector3](/sceneform/reference/com/google/ar/sceneform/math/Vector3)\n**motionEventToPosition**\n([MotionEvent](https://developer.android.com/reference/android/view/MotionEvent) me, int pointerId)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| me | |\n| pointerId | |\n|-----------|---|\n\n#### public float\n**pixelsToInches**\n(float pixels)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| pixels | |\n|--------|---|\n\n#### public void\n**releasePointerId**\n(int pointerId)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| pointerId | |\n|-----------|---|\n\n#### public void\n**retainPointerId**\n(int pointerId)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| pointerId | |\n|-----------|---|"]]