World
Device tracking, planes, world mesh, hit tests, markers, anchors, and scanning.
Commonly used
DeviceTrackingEnables a SceneObject to align with the movements and orientation of the user's device.WorldQueryModuleProvides access to various APIs which can perform hit test for real surfaces to sample the depth and normal at a certain location.AnchorModuleEntry point to the anchoring system.HitTestSessionOptionsOptions for configuring a HitTestSession.MarkerTrackingComponentUsed to track images in the camera.HitTestSessionClass responsible for detecting intersections between a virtual ray and real-world surfaces.
Guides
World Query ModulePlace virtual objects on real-world surfaces on SPECS with depth-based hit-test raycasting and optional surface classification.World Tracking PlanesThe World Tracking Planes Example provides multiple Tracked Planes on the surfaces your device detects, allowing developers to understand and utilize the physical environment in…World Mesh and Depth TextureWorld Mesh provides a real-time 3D reconstruction of the real world based on what your device sees.Spatial AnchorsBuild Spectacles experiences where virtual content stays locked to real-world locations and persists across sessions using Spatial Anchors.Instant World Hit TestThe Instant World Hit Test asset enables users to start interacting with world-facing Lenses instantly.World Mesh ExampleThe World Mesh example allows you to instantiate and occlude virtual objects based on real world surfaces through real-time 3D mesh reconstruction of what your device sees.
All APIs in this topic
Add components to a scene object, reference assets and other modules with a script input, require modules with require('LensStudio:<name>'), and create events with script.createEvent('<name>').
Components, assets, and modules
| API | Description |
|---|---|
| AnchorComponent SPECS | The active tracker: set its AnchorModule.Anchor and it drives its SceneObject's transform, reporting per-frame tracking state. |
| AnchorModule SPECS | Entry point to the anchoring system. |
| DeviceTracking | Enables a SceneObject to align with the movements and orientation of the user's device. |
| DeviceTrackingModule | The module that allows Device Tracking capabilities in a Lens. |
| MarkerAsset | Represents a texture to be tracked with MarkerTrackingComponent. |
| MarkerTrackingComponent | Used to track images in the camera. |
| ScanModule | Provides access to a Scan system that allows users to scan objects, places, and cars with a database of item labels within a Lens. |
| WorldQueryModule SPECS | Provides access to various APIs which can perform hit test for real surfaces to sample the depth and normal at a certain location. |
| WorldUnderstandingModule | Declares permissions for your Lens project. |
Events
| API | Description |
|---|---|
| WorldTrackingMeshesAddedEvent | Triggered when new world tracking meshes are detected. |
| WorldTrackingMeshesRemovedEvent | Triggered when some world tracking meshes are no longer detected. |
| WorldTrackingMeshesUpdatedEvent | Triggered when world tracking meshes are updated. |
| WorldTrackingPlanesAddedEvent | Triggered when plane(s) are newly detected. |
| WorldTrackingPlanesRemovedEvent | Triggered when plane(s) are no longer detected. |
| WorldTrackingPlanesUpdatedEvent | Triggered when currently detected plane(s) are updated. |
| WorldTrackingResetEvent | If a DeviceTracking component is present in the scene, this event is triggered when the tracking is restarted (typically when the Lens starts, or if the user… |
Event data
| API | Description |
|---|---|
| SurfaceTouchDataArgs SPECS |
Objects and data
| API | Description |
|---|---|
| FileBasedMarkerProvider | Provides an image marker based on an imported image file. |
| HitTestSession SPECS | Class responsible for detecting intersections between a virtual ray and real-world surfaces. |
| HitTestSessionOptions SPECS | Options for configuring a HitTestSession. |
| MarkerProvider | Base class for marker providers. |
| NaturalFeatureMarkerProvider | Base class for marker providers. |
| PointCloud | Represents 3D locations of stationary features in the environment. |
| RotationOptions | Used with DeviceTracking#rotationOptions to change settings for Rotation tracking mode. |
| SnapcodeMarkerProvider | Provides a marker for tracking Snapcodes. |
| SurfaceOptions | Used with DeviceTracking#surfaceOptions to change settings for Surface tracking mode. |
| TrackedMesh | Represents a mesh generated by world tracking. |
| TrackedMeshHistogramResult | Provides histogram information about tracked world mesh faces in a given area. |
| TrackedMeshHitTestResult | Provides information about a TrackedMesh surface hit during a raycast. |
| TrackedPlane | A representation for plane detected by native tracking. |
| TrackedPlaneHitTestResult | The result of a raycast against a TrackedPlane. |
| WorldOptions | Holds settings for world mesh and point cloud tracking in DeviceTracking component. |
| WorldQueryHitTestResult SPECS | The result of the hitTest method call. |
| WorldRaycast | |
| WorldRenderObjectProvider | Provider for RenderMesh data representing the estimated shape of real world objects generated from depth information. |
| WorldTrackingCapabilities | Provides information about whether certain world tracking features are supported by the device. |
Enums
| API | Description |
|---|---|
| DeviceTrackingMode | Tracking modes used by the DeviceTracking component to specify what type of tracking to use. |
| MeshClassificationFormat | Formats of mesh classification used by WorldRenderObjectProvider. |
| NativeARTrackingState | Describes the state of the native AR tracking (SLAM) system that backs DeviceTracking. |
| NativePlaneTrackingType | Tracking type used by the DeviceTracking component to specify what type of plane to detect. |
| SurfaceClassification SPECS | The classification of the surface at the position where the ray intersects with the environment. |
| TrackedMeshFaceClassification | Classifications of mesh face. |
| TrackedPlaneClassification SPECS | The semantic class of a TrackedPlane. |
| TrackedPlaneOrientation |