Skip to content

Instantly share code, notes, and snippets.

@andijakl
Created July 29, 2019 16:28
Show Gist options
  • Save andijakl/757cd2b7bb14e9ae01bff29c96e95981 to your computer and use it in GitHub Desktop.
Save andijakl/757cd2b7bb14e9ae01bff29c96e95981 to your computer and use it in GitHub Desktop.
Attach the AR Anchor component to the entity in Amazon Sumerian
// 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