קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ARCore for Jetpack XR מאפשר לאפליקציות לעבוד עם מושגים בסיסיים של מציאות רבודה (AR), באמצעות פרימיטיבים של הבנת סצנות ברמה נמוכה ומעקב אחר תנועה. משתמשים ב-ARCore ל-Jetpack XR כשיוצרים חוויות במציאות רבודה וצריך להשתמש בנתונים מישוריים או להצמיד תוכן למיקום קבוע במרחב.
גישה אל Session
כשמשתמשים ב-ARCore ל-Jetpack XR, Session צריך ליצור.
כשמשתמשים ב-Jetpack Compose ל-XR, משתמשים ב-LocalSession כדי לגשת לסשן שנוצר בשבילכם.
הגדרת Session
יכול להיות שחלק מהתכונות מושבתות כברירת מחדל, וצריך להגדיר אותן כדי שהן יפעלו. כדי להגדיר סשן, משתמשים בפקודה configure() ומציינים את אפשרויות ההגדרה שנדרשות ל-Session. לדוגמה, כדי להפעיל את המעקב אחרי תנועות הידיים, הערך של HandTrackingMode מוגדר למצב HandTrackingMode.BOTH:
valnewConfig=session.config.copy(handTracking=Config.HandTrackingMode.BOTH)when(valresult=session.configure(newConfig)){isSessionConfigureConfigurationNotSupported->
TODO(/* Some combinations of configurations are not valid. Handle this failure case. */)isSessionConfigureSuccess->TODO(/* Success! */)else->
TODO(/* A different unhandled exception was thrown. */)}
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-08-27 (שעון UTC)."],[],[],null,["ARCore for Jetpack XR allows apps to work with basic concepts of augmented\nreality (AR), using low-level scene understanding primitives and motion\ntracking. Use ARCore for Jetpack XR when building AR experiences and you need to\nuse planar data or anchor content to a fixed location in space.\n| **Preview:** ARCore for Jetpack XR is currently only available on Android XR devices.\n\nAccess a `Session`\n\nA `Session` must [be created](/develop/xr/jetpack-xr-sdk/add-session#access-session) when using ARCore for Jetpack XR.\n\nWhen using Jetpack Compose for XR, use [`LocalSession`](/reference/kotlin/androidx/xr/compose/platform/package-summary#LocalSession()) to access the session\nthat is created for you.\n\nConfigure a `Session`\n\nSome features may be disabled by default and must be configured in order to\nfunction. To configure a session, use `configure()` and specify [the\nconfiguration options](/reference/kotlin/androidx/xr/runtime/Config) that your `Session` needs. For example, to enable\n[hand tracking](/develop/xr/jetpack-xr-sdk/arcore/hands), the `HandTrackingMode` is set to the\n[`HandTrackingMode.BOTH`](/reference/kotlin/androidx/xr/runtime/Config.HandTrackingMode#BOTH()) mode:\n\n\n```kotlin\nval newConfig = session.config.copy(\n handTracking = Config.HandTrackingMode.BOTH\n)\nwhen (val result = session.configure(newConfig)) {\n is SessionConfigureConfigurationNotSupported -\u003e\n TODO(/* Some combinations of configurations are not valid. Handle this failure case. */)\n is SessionConfigureSuccess -\u003e TODO(/* Success! */)\n else -\u003e\n TODO(/* A different unhandled exception was thrown. */)\n}https://github.com/android/snippets/blob/5673ffc60b614daf028ee936227128eb8c4f9781/xr/src/main/java/com/example/xr/arcore/Hands.kt#L39-L48\n```\n\n\u003cbr /\u003e\n\nSee also\n\n- [Work with Anchors using ARCore for Jetpack XR](/develop/xr/jetpack-xr-sdk/arcore/anchors)\n- [Work with Planes using ARCore for Jetpack XR](/develop/xr/jetpack-xr-sdk/arcore/planes)\n- [Work with Hands using ARCore for Jetpack XR](/develop/xr/jetpack-xr-sdk/arcore/hands)"]]