Created
April 3, 2020 02:41
-
-
Save prideout/6b9925faf6915c8da5d6008f2fe64f8d to your computer and use it in GitHub Desktop.
getting-started-extension-functions
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
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