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
import Cocoa | |
// Say we have a Person model | |
enum V1 { | |
struct Person: Codable { | |
let name: String | |
var age: Int | |
} | |
} |
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
// This is a GLSL implementation of | |
// "Computing the Singular Value Decomposition of 3 x 3 matrices with | |
// minimal branching and elementary floating point operations" | |
// by Aleka McAdams et.al. | |
// http://pages.cs.wisc.edu/~sifakis/papers/SVD_TR1690.pdf | |
// This should also work on the CPU using glm | |
// Then you probably should use glm::quat instead of vec4 | |
// and mat3_cast to convert to mat3. |
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
#ifndef __QUATERNION_INCLUDED__ | |
#define __QUATERNION_INCLUDED__ | |
#define QUATERNION_IDENTITY float4(0, 0, 0, 1) | |
#ifndef PI | |
#define PI 3.14159265359f | |
#endif | |
// Quaternion multiplication |