[MetaballsKit] Add Geometry file
This commit is contained in:
parent
d8c319bd9b
commit
2441bd0b76
2 changed files with 49 additions and 0 deletions
|
@ -22,6 +22,7 @@
|
||||||
C0BBE3AC1F2E941200E68524 /* Renderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BBE3AB1F2E941200E68524 /* Renderer.swift */; };
|
C0BBE3AC1F2E941200E68524 /* Renderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BBE3AB1F2E941200E68524 /* Renderer.swift */; };
|
||||||
C0BBE3AD1F30CD7E00E68524 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0BBE3A71F2E893A00E68524 /* MetalKit.framework */; };
|
C0BBE3AD1F30CD7E00E68524 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0BBE3A71F2E893A00E68524 /* MetalKit.framework */; };
|
||||||
C0BBE3AF1F314C8200E68524 /* SamplingKernel.metal in Sources */ = {isa = PBXBuildFile; fileRef = C0BBE3AE1F314C8200E68524 /* SamplingKernel.metal */; };
|
C0BBE3AF1F314C8200E68524 /* SamplingKernel.metal in Sources */ = {isa = PBXBuildFile; fileRef = C0BBE3AE1F314C8200E68524 /* SamplingKernel.metal */; };
|
||||||
|
C0CE7C001F362C3F001516B6 /* Geometry.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0CE7BFF1F362C3F001516B6 /* Geometry.swift */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
|
@ -62,6 +63,7 @@
|
||||||
C0BBE3A91F2E91D900E68524 /* Shaders.metal */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.metal; path = Shaders.metal; sourceTree = "<group>"; };
|
C0BBE3A91F2E91D900E68524 /* Shaders.metal */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.metal; path = Shaders.metal; sourceTree = "<group>"; };
|
||||||
C0BBE3AB1F2E941200E68524 /* Renderer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Renderer.swift; sourceTree = "<group>"; };
|
C0BBE3AB1F2E941200E68524 /* Renderer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Renderer.swift; sourceTree = "<group>"; };
|
||||||
C0BBE3AE1F314C8200E68524 /* SamplingKernel.metal */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.metal; path = SamplingKernel.metal; sourceTree = "<group>"; };
|
C0BBE3AE1F314C8200E68524 /* SamplingKernel.metal */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.metal; path = SamplingKernel.metal; sourceTree = "<group>"; };
|
||||||
|
C0CE7BFF1F362C3F001516B6 /* Geometry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Geometry.swift; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
@ -152,6 +154,7 @@
|
||||||
C0BBE38E1F2E81B600E68524 /* MetaballsKit.h */,
|
C0BBE38E1F2E81B600E68524 /* MetaballsKit.h */,
|
||||||
C0BBE38F1F2E81B600E68524 /* Info.plist */,
|
C0BBE38F1F2E81B600E68524 /* Info.plist */,
|
||||||
C0BBE3A31F2E81C700E68524 /* Metaballs.swift */,
|
C0BBE3A31F2E81C700E68524 /* Metaballs.swift */,
|
||||||
|
C0CE7BFF1F362C3F001516B6 /* Geometry.swift */,
|
||||||
C0BBE3AE1F314C8200E68524 /* SamplingKernel.metal */,
|
C0BBE3AE1F314C8200E68524 /* SamplingKernel.metal */,
|
||||||
);
|
);
|
||||||
path = MetaballsKit;
|
path = MetaballsKit;
|
||||||
|
@ -372,6 +375,7 @@
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
C0BBE3A41F2E81C700E68524 /* Metaballs.swift in Sources */,
|
C0BBE3A41F2E81C700E68524 /* Metaballs.swift in Sources */,
|
||||||
|
C0CE7C001F362C3F001516B6 /* Geometry.swift in Sources */,
|
||||||
C0BBE3AF1F314C8200E68524 /* SamplingKernel.metal in Sources */,
|
C0BBE3AF1F314C8200E68524 /* SamplingKernel.metal in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
@ -661,6 +665,7 @@
|
||||||
C0BBE3831F2E816500E68524 /* Release */,
|
C0BBE3831F2E816500E68524 /* Release */,
|
||||||
);
|
);
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
C0BBE3841F2E816500E68524 /* Build configuration list for PBXNativeTarget "MetaballsTests" */ = {
|
C0BBE3841F2E816500E68524 /* Build configuration list for PBXNativeTarget "MetaballsTests" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
|
@ -669,6 +674,7 @@
|
||||||
C0BBE3861F2E816500E68524 /* Release */,
|
C0BBE3861F2E816500E68524 /* Release */,
|
||||||
);
|
);
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
C0BBE39D1F2E81B600E68524 /* Build configuration list for PBXNativeTarget "MetaballsKit" */ = {
|
C0BBE39D1F2E81B600E68524 /* Build configuration list for PBXNativeTarget "MetaballsKit" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
|
@ -677,6 +683,7 @@
|
||||||
C0BBE39F1F2E81B600E68524 /* Release */,
|
C0BBE39F1F2E81B600E68524 /* Release */,
|
||||||
);
|
);
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
C0BBE3A01F2E81B600E68524 /* Build configuration list for PBXNativeTarget "MetaballsKitTests" */ = {
|
C0BBE3A01F2E81B600E68524 /* Build configuration list for PBXNativeTarget "MetaballsKitTests" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
|
@ -685,6 +692,7 @@
|
||||||
C0BBE3A21F2E81B600E68524 /* Release */,
|
C0BBE3A21F2E81B600E68524 /* Release */,
|
||||||
);
|
);
|
||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
};
|
};
|
||||||
|
|
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