Skip to content

Instantly share code, notes, and snippets.

View mr-ryan-james's full-sized avatar
💬
hi there

Ryan Pfister mr-ryan-james

💬
hi there
  • Valencia, Spain
View GitHub Profile
@mr-ryan-james
mr-ryan-james / GameplayKitMatrixOperations.swift
Last active August 22, 2017 17:12
Convert Gameplaykit simd_float3x3 to simd_float4x4 (and back)
import Foundation
import GameplayKit
func convertToFloat3x3(float4x4: simd_float4x4) -> simd_float3x3 {
let column0 = convertToFloat3 ( float4: float4x4.columns.0 )
let column1 = convertToFloat3 ( float4: float4x4.columns.1 )
let column2 = convertToFloat3 ( float4: float4x4.columns.2 )
return simd_float3x3.init(column0, column1, column2)
}