Created
May 12, 2020 19:52
-
-
Save iambaljeet/b11f274d8d8bc529ea05d19369c1ab36 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Used to laod models from 'raw' with a callback when loading is complete | |
*/ | |
fun loadModel(@RawRes model: Int, callback: (ModelRenderable) -> Unit) { | |
ModelRenderable | |
.builder() | |
.setSource(this, model) | |
.build() | |
.thenAccept { modelRenderable -> | |
callback(modelRenderable) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment