Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@andijakl
Created August 8, 2019 11:01
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/0d317b8cd88a495d98255a6124ac7d1b to your computer and use it in GitHub Desktop.
Save andijakl/0d317b8cd88a495d98255a6124ac7d1b to your computer and use it in GitHub Desktop.
Registering the hit test call back. Stores it in a variable to allow removing the event listener later, and using an arrow function to preserver this.
// Listeners and Callbacks
// -------------------------------------------------------------------
// First, create a variable that stores an arrow function to the
// performHitTest method of this class. This method takes care of
// starting the hit test in the native AR system.
// We need this as an arrow function to have access to "this" in
// the class scope. Creating this function in a variable allows
// to remove the event listener once the scene closes.
var performHitTestCallback = (evt) => this.performHitTest(evt);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment