Add color rotation matrix to Parameters
This commit is contained in:
parent
0844fbc010
commit
d3190dd7e7
3 changed files with 13 additions and 3 deletions
|
@ -13,6 +13,7 @@ import simd
|
|||
public typealias Float2 = packed_float2
|
||||
public typealias Float3 = float3
|
||||
public typealias Float4 = float4
|
||||
public typealias Matrix2x2 = float2x2
|
||||
public typealias Matrix3x3 = float3x3
|
||||
public typealias Matrix4x4 = float4x4
|
||||
|
||||
|
@ -42,6 +43,15 @@ extension Float4 {
|
|||
}
|
||||
}
|
||||
|
||||
extension Matrix2x2 {
|
||||
static func rotation(theta: Float) -> Matrix2x2 {
|
||||
return self.init(rows: [
|
||||
Float2(cos(theta), -sin(theta)),
|
||||
Float2(sin(theta), cos(theta)),
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
extension Matrix4x4 {
|
||||
/// Create a 4x4 orthographic projection matrix with the provided 6-tuple.
|
||||
/// @see https://en.wikipedia.org/wiki/Orthographic_projection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue