func makeQuaternionRotationMatrix(angleRadians: Float, axis: simd_float3) -> matrix_float4x4 { let normalizedAxis = normalize(axis) let halfAngle = angleRadians / 2 let w = cos(halfAngle) let sinHalfAngle = sin(halfAngle) let x = sinHalfAngle * normalizedAxis.x let y = sinHalfAngle * normalizedAxis.y let z = sinHalfAngle * normalizedAxis.z
let quaternion = simd_quatf(ix: x, iy: y, iz: z, r: w) let rotationMatrix = matrix_float4x4(quaternion)