Created
September 13, 2018 18:36
-
-
Save elijahzarlin/a781153d8200d3c31c31a1d98c3b9126 to your computer and use it in GitHub Desktop.
world-scale-ar-3
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
| internal extension matrix_float4x4 { | |
| func rotationAroundY(radians: Float) -> matrix_float4x4 { | |
| var matrix: matrix_float4x4 = self | |
| matrix.columns.0.x = cos(radians) | |
| matrix.columns.0.z = -sin(radians) | |
| matrix.columns.2.x = sin(radians) | |
| matrix.columns.2.z = cos(radians) | |
| return matrix.inverse | |
| } | |
| func translationMatrix(_ translation : vector_float4) -> matrix_float4x4 { | |
| var matrix: matrix_float4x4 = self | |
| matrix.columns.3 = translation | |
| return matrix | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment