Skip to main content

World

Device tracking, planes, world mesh, hit tests, markers, anchors, and scanning.

Commonly used

Guides

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

APIDescription
AnchorComponent SPECSThe active tracker: set its AnchorModule.Anchor and it drives its SceneObject's transform, reporting per-frame tracking state.
AnchorModule SPECSEntry point to the anchoring system.
DeviceTrackingEnables a SceneObject to align with the movements and orientation of the user's device.
DeviceTrackingModuleThe module that allows Device Tracking capabilities in a Lens.
MarkerAssetRepresents a texture to be tracked with MarkerTrackingComponent.
MarkerTrackingComponentUsed to track images in the camera.
ScanModuleProvides access to a Scan system that allows users to scan objects, places, and cars with a database of item labels within a Lens.
WorldQueryModule SPECSProvides access to various APIs which can perform hit test for real surfaces to sample the depth and normal at a certain location.
WorldUnderstandingModuleDeclares permissions for your Lens project.

Events

APIDescription
WorldTrackingMeshesAddedEventTriggered when new world tracking meshes are detected.
WorldTrackingMeshesRemovedEventTriggered when some world tracking meshes are no longer detected.
WorldTrackingMeshesUpdatedEventTriggered when world tracking meshes are updated.
WorldTrackingPlanesAddedEventTriggered when plane(s) are newly detected.
WorldTrackingPlanesRemovedEventTriggered when plane(s) are no longer detected.
WorldTrackingPlanesUpdatedEventTriggered when currently detected plane(s) are updated.
WorldTrackingResetEventIf 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

APIDescription
SurfaceTouchDataArgs SPECS

Objects and data

APIDescription
FileBasedMarkerProviderProvides an image marker based on an imported image file.
HitTestSession SPECSClass responsible for detecting intersections between a virtual ray and real-world surfaces.
HitTestSessionOptions SPECSOptions for configuring a HitTestSession.
MarkerProviderBase class for marker providers.
NaturalFeatureMarkerProviderBase class for marker providers.
PointCloudRepresents 3D locations of stationary features in the environment.
RotationOptionsUsed with DeviceTracking#rotationOptions to change settings for Rotation tracking mode.
SnapcodeMarkerProviderProvides a marker for tracking Snapcodes.
SurfaceOptionsUsed with DeviceTracking#surfaceOptions to change settings for Surface tracking mode.
TrackedMeshRepresents a mesh generated by world tracking.
TrackedMeshHistogramResultProvides histogram information about tracked world mesh faces in a given area.
TrackedMeshHitTestResultProvides information about a TrackedMesh surface hit during a raycast.
TrackedPlaneA representation for plane detected by native tracking.
TrackedPlaneHitTestResultThe result of a raycast against a TrackedPlane.
WorldOptionsHolds settings for world mesh and point cloud tracking in DeviceTracking component.
WorldQueryHitTestResult SPECSThe result of the hitTest method call.
WorldRaycast
WorldRenderObjectProviderProvider for RenderMesh data representing the estimated shape of real world objects generated from depth information.
WorldTrackingCapabilitiesProvides information about whether certain world tracking features are supported by the device.

Enums

APIDescription
DeviceTrackingModeTracking modes used by the DeviceTracking component to specify what type of tracking to use.
MeshClassificationFormatFormats of mesh classification used by WorldRenderObjectProvider.
NativeARTrackingStateDescribes the state of the native AR tracking (SLAM) system that backs DeviceTracking.
NativePlaneTrackingTypeTracking type used by the DeviceTracking component to specify what type of plane to detect.
SurfaceClassification SPECSThe classification of the surface at the position where the ray intersects with the environment.
TrackedMeshFaceClassificationClassifications of mesh face.
TrackedPlaneClassification SPECSThe semantic class of a TrackedPlane.
TrackedPlaneOrientation