Most visited

Recently visited

ARNode

public class ARNode
extends Node

java.lang.Object
   ↳ com.viro.core.Node
     ↳ com.viro.core.ARNode


ARNode is a specialized Node that corresponds to a detected ARAnchor. ARNodes are automatically created by Viro and added to the Scene as they are detected, and by default hold no content and have no children. Each ARNode is continually updated to stay in sync with its corresponding ARAnchor: if the anchor's position, orientation, or other detected properties change, the ARNode will be changed as well.

ARNode is the mechanism through which you can attach virtual content to real-world objects. For example, if an ARPlaneAnchor is detected, you can add a 3D model to that plane by loading the Object3D and making it a child of the ARNode.

To get an ARNode, attach a ARScene.Listener to the ARScene, and listen for onAnchorFound(ARAnchor, ARNode), which is invoked each time a new ARAnchor is found, with its corresponding ARNode.

Summary

Public methods

void setPauseUpdates(boolean pauseUpdates)

Set to true to pause automatic synchronization between this ARNode and its ARAnchor.

void setPosition(Vector position)

This operation is not valid for ARNodes.

void setRotation(Vector rotation)

This operation is not valid for ARNodes.

Public methods

setPauseUpdates

void setPauseUpdates (boolean pauseUpdates)

Set to true to pause automatic synchronization between this ARNode and its ARAnchor. ARAnchors are periodically updated by the AR tracking system as its estimates of the anchor's properties are refined. By default, updates to the ARAnchor are synchronized to the ARNode; for example, if the tracking system determines that an ARAnchor has moved, the ARNode will move as well.

It may be useful to pause updates if you wish to ensure the stability of your Scene for a period of time. The ARNode will be immediately updated to its anchor's latest position when pause updates is turned off.

Parameters
pauseUpdates boolean: True to pause updates, false to resume updating. When set to false, the ARNode will immediately be updated to match its ARAnchor.

setPosition

void setPosition (Vector position)

This operation is not valid for ARNodes. This is because their transforms are constantly updated by the underlying AR tracking system. Calling this function will throw an IllegalAccessError.

Parameters
position Vector: The position as a Vector.

setRotation

void setRotation (Vector rotation)

This operation is not valid for ARNodes. This is because their transforms are constantly updated by the underlying AR tracking system. Calling this function will throw an IllegalAccessError.

Parameters
rotation Vector: Vector containing the rotation as three Euler angles in radians.

Hooray!