Skip to content

Commit c7b34c8

Browse files
authored
Clip Plane Invalidation. (#98)
1 parent 5fd4e29 commit c7b34c8

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Sources/VimKit/Database+Models.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ extension Database {
965965

966966
public var scale: Float
967967
public var camera: Camera?
968+
public var element: Element?
968969

969970
/// Initializer.
970971
public required init() {
@@ -1008,6 +1009,9 @@ extension Database {
10081009
if let idx = data["Camera"] as? Int64, idx != .empty {
10091010
camera = cache.findOrCreate(idx)
10101011
}
1012+
if let idx = data["Element"] as? Int64, idx != .empty {
1013+
element = cache.findOrCreate(idx)
1014+
}
10111015
}
10121016
}
10131017

Sources/VimKit/Extensions/Array+Extensions.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,13 @@ extension Array where Element == SIMD3<Float> {
6262
}
6363
}
6464

65+
extension Array where Element == SIMD4<Float> {
6566

67+
/// Invalidates all elements of the array by assigning the values as `.invalid`.
68+
public mutating func invalidate() {
69+
guard self.isNotEmpty else { return }
70+
for i in 0..<self.count {
71+
self[i] = .invalid
72+
}
73+
}
74+
}

0 commit comments

Comments
 (0)