Created
July 29, 2019 16:28
-
-
Save andijakl/757cd2b7bb14e9ae01bff29c96e95981 to your computer and use it in GitHub Desktop.
Attach the AR Anchor component to the entity in Amazon Sumerian
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
// Attach AR anchor component to entity | |
// ------------------------------------------------------------------- | |
// First, create the anchor component that is actually attached | |
// to the entity. | |
const arAnchorComponent = new si.ArAnchorComponent(); | |
// To work with this component, we also need the internal entity | |
// that extends the 'normal' entity and provides additional functionality. | |
this.internalAnchorEntity = si.Entity.forPublicEntity(this.anchorEntity); | |
// The internal entity allows us to add an additional component | |
// to its definition - in this case, the ArAnchorComponent we | |
// just created. | |
this.internalAnchorEntity.setComponent(arAnchorComponent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment