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 lightIntensity, float colorTemperature)

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()

Invoked when tracking is initialized and functional.

Public methods

onAmbientLightUpdate

void onAmbientLightUpdate (float lightIntensity, 
                float colorTemperature)

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
lightIntensity float: The light intensity detected.

colorTemperature float: The color temperature detected.

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 ()

Invoked when tracking is initialized and functional.

Hooray!