Attempt #1 at getting a texture of indexes
This commit is contained in:
parent
f4a9f56fa7
commit
2ed72491b1
2 changed files with 51 additions and 1 deletions
|
@ -119,6 +119,9 @@ public class Field {
|
|||
|
||||
public var defaults = UserDefaults.standard
|
||||
private var parameters: Parameters
|
||||
private lazy var marchingSquares: MarchingSquares = {
|
||||
return MarchingSquares(field: self)
|
||||
}()
|
||||
|
||||
internal var bounds: CGRect {
|
||||
return CGRect(origin: CGPoint(), size: CGSize(size: size))
|
||||
|
@ -155,7 +158,10 @@ public class Field {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
populateBallBuffer()
|
||||
marchingSquares.sampleField()
|
||||
marchingSquares.populateIndexes()
|
||||
}
|
||||
|
||||
func add(ballWithRadius radius: Float) {
|
||||
|
@ -264,6 +270,7 @@ public class Field {
|
|||
self.device = device
|
||||
populateParametersBuffer()
|
||||
populateBallBuffer()
|
||||
marchingSquares.setupMetal(withDevice: device)
|
||||
}
|
||||
|
||||
// MARK: - Notifications
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue