Call-back when the AR system of the device (ARCore / ARKit) sends the anchor ID to our scene, so that we can link it to the entity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Anchor registration callback. Sets the anchor ID of the entity's | |
// ArAnchorComponent. The engine's ArSystem will automatically update | |
// the world position and orientation of entities with a valid anchor ID. | |
registerAnchorCallback(anchorId) { | |
if (anchorId) { | |
this.internalAnchorEntity.getComponent('ArAnchorComponent').anchorId = anchorId; | |
console.log("Registered AR anchor: " + anchorId); | |
this.placeMode.set(false); | |
this.worldPlacedEvent.emit(); | |
console.log("Quit place mode and sent WorldPlaced event"); | |
} else { | |
console.log("No Anchor ID received"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment