Created
August 8, 2019 11:01
-
-
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.
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
// 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