public class

VidinotiArViewerActivity

extends VidinotiBaseArViewerActivity
implements VidinotiArJavascriptInterface.Listener
java.lang.Object
   ↳ AppCompatActivity
     ↳ com.vidinoti.android.vdarsdk.arcore.VidinotiBaseArViewerActivity
       ↳ com.vidinoti.android.vdarsdk.arcore.VidinotiArViewerActivity

Class Overview

Activity that runs ARCore with a web view on top of the camera view. The camera projection and view matrix are retrieved from the web page and a 3D scene can then be rendered using WebGL. For launching the activity, use the Intent returned by createViewIntent(Context, String, String)

Summary

Public Constructors
VidinotiArViewerActivity()
Public Methods
static float calculateDistanceToPlane(Pose planePose, Pose cameraPose)
Calculate the normal distance to plane from cameraPose, the given planePose should have y axis parallel to plane's normal, for example plane's center pose or hit test pose.
void closeBrowser()
Called when the AR view must be closed (e.g.
static Intent createViewIntent(Context context, String url, String modelPath)
Creates the intent for starting the activity with the required parameters.
void onFrameUpdate(Frame frame)
void onRequestAutomaticImagePlacement(String id, String imageUrl, Float widthInMeters)
Called when the WebView content requested the detection of an image.
void onRequestAutomaticPlanePlacement(String id)
Called when the WebView content requested the detection of a plane.
void onRequestContinuousPlanePlacement()
Called when a continuous hit testing must be performed
void onRequestScreenCapture()
Called when the WebView content requested a image capture of the camera.
void onValidatePlacement()
Called when the last placement must be used as anchor
void stopAR()
Called when the ARCore session can be stopped
Protected Methods
void onCreate(Bundle savedInstanceState)
void onDestroy()
void onPause()
void onResume()
[Expand]
Inherited Methods
From class com.vidinoti.android.vdarsdk.arcore.VidinotiBaseArViewerActivity
From class java.lang.Object
From interface android.opengl.GLSurfaceView.Renderer
From interface com.vidinoti.android.vdarsdk.arcore.VidinotiArJavascriptInterface.Listener

Public Constructors

public VidinotiArViewerActivity ()

Public Methods

public static float calculateDistanceToPlane (Pose planePose, Pose cameraPose)

Calculate the normal distance to plane from cameraPose, the given planePose should have y axis parallel to plane's normal, for example plane's center pose or hit test pose.

Parameters
planePose pose of the plane anchor
cameraPose pose of the camera
Returns
  • the distance

public void closeBrowser ()

Called when the AR view must be closed (e.g. at the end of an animation)

public static Intent createViewIntent (Context context, String url, String modelPath)

Creates the intent for starting the activity with the required parameters.

Parameters
context the context
url the URL that must be loaded, either remote (http/https) or local (relative to the modelPath)
modelPath the path where the model files are stored
Returns

public void onFrameUpdate (Frame frame)

public void onRequestAutomaticImagePlacement (String id, String imageUrl, Float widthInMeters)

Called when the WebView content requested the detection of an image. Once an image has been detected, the anchor matrix must be updated (See sendAnchorMatrix(float[]) and sendAnchorPlaced(String) called.

Parameters
id the id corresponding to the placement request
imageUrl the url of the image to track
widthInMeters the physical width of the image, it improves the tracking to specify the physical size

public void onRequestAutomaticPlanePlacement (String id)

Called when the WebView content requested the detection of a plane. Once a plane has been detected, the anchor matrix must be updated (See sendAnchorMatrix(float[]) and sendAnchorPlaced(String) called.

Parameters
id the id corresponding to the placement request

public void onRequestContinuousPlanePlacement ()

Called when a continuous hit testing must be performed

public void onRequestScreenCapture ()

Called when the WebView content requested a image capture of the camera. The screen capture must be sent via sendScreenCapture(String)

public void onValidatePlacement ()

Called when the last placement must be used as anchor

public void stopAR ()

Called when the ARCore session can be stopped

Protected Methods

protected void onCreate (Bundle savedInstanceState)

protected void onDestroy ()

protected void onPause ()

protected void onResume ()