Skip to content

Instantly share code, notes, and snippets.

@andijakl
Last active August 8, 2019 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andijakl/8c09b1cea515f183c0dc6bf6bd1976c1 to your computer and use it in GitHub Desktop.
Save andijakl/8c09b1cea515f183c0dc6bf6bd1976c1 to your computer and use it in GitHub Desktop.
Call-back from the hit test: register an AR anchor at this position through Amazon Sumerian's ArSystem.
// Hit test callback. If the hit test was successful (i.e., detected a
// point in the real world), registers an anchor with that point.
hitTestCallback(anchorTransform) {
if (anchorTransform) {
console.log("Transform from hit test: " + anchorTransform + ". Registering anchor...");
this.arSystem.registerAnchor(anchorTransform, (anchorId) => this.registerAnchorCallback(anchorId));
} else {
console.log("No transform received from hit test");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment