Class ARAnchor
java.lang.Object
com.codename1.ar.ARAnchor
- Direct Known Subclasses:
ARFaceAnchor, ARImageAnchor
A fixed position and orientation in the real world that the AR session
keeps tracking as its understanding of the environment improves. Anchors
are the attachment points for virtual content: create one with
ARSession#createAnchor(ARPose) or ARHitResult#createAnchor() and hang
an ARNode on it with #setNode(ARNode).
The session refines anchor poses over time; updates are delivered through
the session's ARAnchorListener and reflected by #getPose().
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddetach()Removes this anchor (and any attached content) from the session.getId()The stable identifier of this anchor.getNode()The content root rendered at this anchor, or null when none is attached.getPose()The current world pose.The tracking quality of this anchor.booleanTrue once#detach()has been called or the platform removed the anchor.voidAttaches (or replaces) the content root rendered at this anchor.
-
Constructor Details
-
ARAnchor
-
-
Method Details
-
getId
The stable identifier of this anchor. -
getPose
The current world pose. Updated on the EDT as tracking refines. -
getTrackingState
The tracking quality of this anchor. -
getNode
The content root rendered at this anchor, or null when none is attached. -
setNode
Attaches (or replaces) the content root rendered at this anchor. Pass null to remove the content while keeping the anchor.
Parameters
node: the root node to render at this anchor, or null
-
detach
public void detach()Removes this anchor (and any attached content) from the session. No-op when already detached. -
isDetached
public boolean isDetached()True once#detach()has been called or the platform removed the anchor.
-