Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creating an Anchor with ARCore for Amazon Sumerian
@JavascriptInterface
public void registerAnchor(final String requestId, final float[] matrix) {
if (requestId == null || matrix == null) {
return;
}
mSurfaceView.queueEvent(new Runnable() {
@Override
public void run() {
Pose anchorPose = Pose.makeTranslation(matrix[12], matrix[13], matrix[14]);
Anchor anchor = mSession.createAnchor(anchorPose);
final String scriptString = "ARCoreBridge.registerAnchorResponse('" + requestId + "', '" + String.valueOf(anchor.hashCode()) + "');";
evaluateWebViewJavascript(scriptString);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.