Class ARView

All Implemented Interfaces:
Animation, Editable, StyleListener, Iterable<Component>

public final class ARView extends Container

Component that renders the AR camera image composited with the session's anchored 3D content. Created via ARSession#createView() and added to a form like any other component.

To place content where the user taps, convert the pointer coordinate to the normalized view coordinate expected by ARSession#hitTest(float, float):

view.addPointerReleasedListener(e -> {
    float xn = (e.getX() - view.getAbsoluteX()) / (float) view.getWidth();
    float yn = (e.getY() - view.getAbsoluteY()) / (float) view.getHeight();
    session.hitTest(xn, yn).ready(hits -> { ... });
});
  • Method Details

    • getSession

      public ARSession getSession()
      The ARSession backing this view.
    • getViewPeer

      public PeerComponent getViewPeer()
      Exposed for ports that need to reach the native view directly.