Skip to content

Commit 6c2a17b

Browse files
committed
CA: add Transform3D.identity
This adds a definition for `Transform3D.identity`.
1 parent 8be441a commit 6c2a17b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Sources/SwiftWin32/CA/Transform3D.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,17 @@ public struct Transform3D {
100100
/// The entry at position 4,4 in the matrix.
101101
var m44: Double
102102
}
103+
104+
extension Transform3D {
105+
/// The identity transform.
106+
/// [1, 0, 0, 0]
107+
/// [0, 1, 0, 0]
108+
/// [0, 0, 1, 0]
109+
/// [0, 0, 0, 1]
110+
public static var identity: Transform3D {
111+
Transform3D(m11: 1, m12: 0, m13: 0, m14: 0,
112+
m21: 0, m22: 1, m23: 0, m24: 0,
113+
m31: 0, m32: 0, m33: 1, m34: 0,
114+
m41: 0, m42: 0, m43: 0, m44: 1)
115+
}
116+
}

0 commit comments

Comments
 (0)