Skip to content

Instantly share code, notes, and snippets.

@iambaljeet
Created May 12, 2020 19:52
Show Gist options
  • Save iambaljeet/b11f274d8d8bc529ea05d19369c1ab36 to your computer and use it in GitHub Desktop.
Save iambaljeet/b11f274d8d8bc529ea05d19369c1ab36 to your computer and use it in GitHub Desktop.
/**
* 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