Skip to content

Instantly share code, notes, and snippets.

@prideout
Created April 3, 2020 02:41
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 prideout/6b9925faf6915c8da5d6008f2fe64f8d to your computer and use it in GitHub Desktop.
Save prideout/6b9925faf6915c8da5d6008f2fe64f8d to your computer and use it in GitHub Desktop.
getting-started-extension-functions
private fun Int.getTransform(): Mat4 {
val tm = modelViewer.engine.transformManager
return Mat4.of(*tm.getTransform(tm.getInstance(this), null))
}
private fun Int.setTransform(mat: Mat4) {
val tm = modelViewer.engine.transformManager
tm.setTransform(tm.getInstance(this), mat.toFloatArray())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment