public class

VidinotiArJavascriptInterface

extends Object
java.lang.Object
   ↳ com.vidinoti.android.vdarsdk.arcore.VidinotiArJavascriptInterface

Class Overview

Interface that can be called by the javascript. It is used for accessing variables like the projection matrix and view matrix of ARCore and for calling methods like "requestAutomaticPlanePlacement".

Summary

Nested Classes
interface VidinotiArJavascriptInterface.Listener Interface defining the methods that can be called from the javascript  
Public Methods
void closeBrowser()
String getAnchorMatrix()
The string representation of the anchor matrix
String getCommunicationMode()
Returns the communication mode.
String getType()
Returns the type of device
int getVersion()
Returns the bridge version
String getViewMatrix()
The string representation of the view matrix
void requestAutomaticImagePlacement(String id, String imageUrl, Float widthInMeters)
Request the placement of an anchor in the center of an image
void requestAutomaticPlanePlacement(String id)
Request the placement of an anchor on an horizontal plane
void requestContinuousPlanePlacement()
Request continuous plane hit testing.
void requestScreenCapture()
Request an image of the camera.
void stopAR()
void validatePlacement()
Validates latest placement hit test.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void closeBrowser ()

public String getAnchorMatrix ()

The string representation of the anchor matrix

Returns
  • an 1-dimension array of floats (e.g. "[1.0, 0.0, ...]")

public String getCommunicationMode ()

Returns the communication mode. Here it returns "polling" because the javascript must call the view matrix at each frame being rendered. It is faster than sending the view matrix value to the javascript via evaluateJavascript(String, ValueCallback).

Returns
  • "polling"

public String getType ()

Returns the type of device

Returns
  • "android"

public int getVersion ()

Returns the bridge version

Returns
  • the version

public String getViewMatrix ()

The string representation of the view matrix

Returns
  • an 1-dimension array of floats (e.g. "[1.0,0.0,...]")

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

Request the placement of an anchor in the center of an image

Parameters
id id representing the anchor
imageUrl the url of the image to track
widthInMeters the physical width of the image, it helps tracking to specify the physical width

public void requestAutomaticPlanePlacement (String id)

Request the placement of an anchor on an horizontal plane

Parameters
id id representing the anchor

public void requestContinuousPlanePlacement ()

Request continuous plane hit testing.

public void requestScreenCapture ()

Request an image of the camera.

public void stopAR ()

public void validatePlacement ()

Validates latest placement hit test.