[MetaballsKit] Make Field a class
This commit is contained in:
parent
fda6890669
commit
2e70c76fb0
1 changed files with 2 additions and 6 deletions
|
@ -28,7 +28,7 @@ public struct Ball {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct Field {
|
public class Field {
|
||||||
public var size: CGSize {
|
public var size: CGSize {
|
||||||
didSet {
|
didSet {
|
||||||
// Remove balls that fall outside the new bounds.
|
// Remove balls that fall outside the new bounds.
|
||||||
|
@ -70,11 +70,7 @@ public struct Field {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func sample(at point: CGPoint) throws -> CGFloat {
|
public func add(ball: Ball) throws {
|
||||||
return 0.0
|
|
||||||
}
|
|
||||||
|
|
||||||
public mutating func add(ball: Ball) throws {
|
|
||||||
guard bounds.contains(ball.bounds) else {
|
guard bounds.contains(ball.bounds) else {
|
||||||
/// TODO: Throw an error.
|
/// TODO: Throw an error.
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue