Most visited

Recently visited

ARScene.Listener

public static interface ARScene.Listener

com.viro.core.ARScene.Listener


Callback interface for ARScene events. These include the detection of ambient light and the tracking of real-world features.

Summary

Public methods

abstract void onAmbientLightUpdate(float intensity, Vector color)

Invoked when the AR system's estimation of the current ambient light levels are updated.

abstract void onAnchorFound(ARAnchor anchor, ARNode arNode)

Invoked when a real-world ARAnchor is detected.

abstract void onAnchorRemoved(ARAnchor anchor, ARNode arNode)

Invoked when an ARAnchor is removed from the world.

abstract void onAnchorUpdated(ARAnchor anchor, ARNode arNode)

Invoked when a real-world ARAnchor is updated.

abstract void onTrackingInitialized()

This method is deprecated. Use onTrackingUpdated(TrackingState, TrackingStateReason).

abstract void onTrackingUpdated(ARScene.TrackingState state, ARScene.TrackingStateReason reason)

Invoked when the tracking state of the device changes.

Public methods

onAmbientLightUpdate

void onAmbientLightUpdate (float intensity, 
                Vector color)

Invoked when the AR system's estimation of the current ambient light levels are updated. These values can be pumped into an AmbientLight to match the lighting used by the virtual world to the lighting observed in the real world.

Parameters
intensity float: The light intensity detected, in lumens.

color Vector: The color of the light detected in RGB [0, 1].

onAnchorFound

void onAnchorFound (ARAnchor anchor, 
                ARNode arNode)

Invoked when a real-world ARAnchor is detected. You can associate virtual content with this new anchor by adding said content to the associated ARNode. Note that the ARNode is automatically added to the Scene, and will be continually updated to stay in the sync with the anchor as the anchor's properties, orientation, or position change.

Parameters
anchor ARAnchor: The detected ARAnchor representing a real-world feature.

arNode ARNode: The virtual world ARNode associated with the ARAnchor.

onAnchorRemoved

void onAnchorRemoved (ARAnchor anchor, 
                ARNode arNode)

Invoked when an ARAnchor is removed from the world. This occurs if the AR tracking system loses confidence in the ARAnchor and can no longer place it, or when an ARAnchor gets subsumed by another: for example, if the tracking system realizes that two separate horizontal planes are actually one larger plane.

Parameters
anchor ARAnchor: The ARAnchor that was removed.

arNode ARNode: The corresponding ARNode, which is also removed from the Scene.

onAnchorUpdated

void onAnchorUpdated (ARAnchor anchor, 
                ARNode arNode)

Invoked when a real-world ARAnchor is updated. This occurs when the AR tracking system refines its estimation about the size or orientation or position of an ARAnchor, or when other underlying properties of the anchor change.

Parameters
anchor ARAnchor: The ARAnchor that was updated.

arNode ARNode: The ARNode corresponding to the anchor.

onTrackingInitialized

void onTrackingInitialized ()

This method is deprecated.
Use onTrackingUpdated(TrackingState, TrackingStateReason).

Invoked when tracking is initialized and functional.

onTrackingUpdated

void onTrackingUpdated (ARScene.TrackingState state, 
                ARScene.TrackingStateReason reason)

Invoked when the tracking state of the device changes. ARScene.TrackingState indicates how well the device is able to track its position within the real world. Tracking state is subject to lighting conditions, the speed at which the device is moving, and other environmental factors.

Parameters
state ARScene.TrackingState: The ARScene.TrackingState of the device.

reason ARScene.TrackingStateReason: Should the tracking state be sub-optimal, the ARScene.TrackingStateReason indicates why.

Hooray!