[MetaballsKit] Add Geometry file
This commit is contained in:
parent
d8c319bd9b
commit
2441bd0b76
2 changed files with 49 additions and 0 deletions
41
MetaballsKit/Geometry.swift
Normal file
41
MetaballsKit/Geometry.swift
Normal file
|
@ -0,0 +1,41 @@
|
|||
//
|
||||
// Geometry.swift
|
||||
// Metaballs
|
||||
//
|
||||
// Created by Eryn Wells on 8/5/17.
|
||||
// Copyright © 2017 Eryn Wells. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct Point {
|
||||
var x: Float
|
||||
var y: Float
|
||||
|
||||
var CGPoint: CGPoint {
|
||||
return CoreGraphics.CGPoint(x: CGFloat(x), y: CGFloat(y))
|
||||
}
|
||||
|
||||
init() {
|
||||
self.init(x: 0, y: 0)
|
||||
}
|
||||
|
||||
init(x: Float, y: Float) {
|
||||
self.x = x
|
||||
self.y = y
|
||||
}
|
||||
}
|
||||
|
||||
public struct Vector {
|
||||
var dx: Float
|
||||
var dy: Float
|
||||
|
||||
init() {
|
||||
self.init(dx: 0, dy: 0)
|
||||
}
|
||||
|
||||
init(dx: Float, dy: Float) {
|
||||
self.dx = dx
|
||||
self.dy = dy
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue